Booting from raid-1 on USB-attached SSDs as / (root) disables TRIM support
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c, linux
- Domain
- operating-systems
Research direction
Start by reproducing the issue with the provided lsblk -D output, comparing boot from the SD card with boot from the RAID root. Trace how RAID is assembled in the initramfs and how discard/TRIM capability is propagated; done means the RAID exposes the SSDs' supported TRIM capability when used as the root device.
Written by the indexing model from the issue text.
Description
Describe the bug
TRIM support is disabled if system boots from a raid-1 based on USB-attached SSDs. /boot is still on a SD-card. RAID is build on RAW, unpartitioned disks as you can see from the device name md127p1.
When I boot from a SD-card normally, and attach both SSDs via USB TRIM is working, after also providing the unmap udev rule.
The same is true when these SSDs are attached before booting from the SD-card.
But when I boot from the RAID(1), lsblk -D shows following output where you can see that the SSDs actually support TRIM but the RAID does not:
lsblk -D
NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda 0 512B 4G 0
└─md127 0 0B 0B 0
└─md127p1 0 0B 0B 0
sdb 0 512B 4G 0
└─md127 0 0B 0B 0
└─md127p1 0 0B 0B 0
mmcblk0 0 4M 584M 0
└─mmcblk0p1 3145728 4M 584M 0
zram0 0 4K 2T 0
/dev/md127p1 246059232 32765012 203262700 14% /
/dev/mmcblk0p1 468456 57224 411232 13% /boot
It seems to me that the RAID-support backed into initramfs on my /boot-only-SD-card does something different than if the RAID is assembled later during the booting from a normal SD-Card.
Issue happens on any RPI I tested on, including RPI3+ and RPI400
Steps to reproduce the behaviour
see above.
Device (s)
Raspberry Pi 3 Mod. B+
System
vcgencmd version
Oct 11 2022 17:50:10
Copyright (c) 2012 Broadcom
version 5da7b38ef2434a6d18a3f6054ba239f1e4a52594 (clean) (release) (start)
uname -a
Linux homeserver 5.15.78-1-MANJARO-ARM-RPI #1 SMP PREEMPT Sat Nov 12 17:13:38 UTC 2022 aarch64 GNU/Linux
Logs
No response
Additional context
No response
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 22
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
raspberrypi/linux#7635 · 1 comment ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
libsdl-org/SDL#16360 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api7/lua-resty-saml#63 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·