Skip to content

Conversation

@fnordic
Copy link

@fnordic fnordic commented Oct 7, 2025

Fixes # Installation with mdraid mirroring with oem-resize and oem-systemsize set.

Changes proposed in this pull request:

do not device lock the not yet started $RaidDev:

Otherwise we observe in the boot.kiwi debug log:

...
+ declare kiwi_RaidDev=/dev/md0
+ set_device_lock /dev/md0 mdadm --assemble --scan /dev/md0 --update=devicesize
+ udevadm lock --help
+ udevadm lock --device /dev/md0 mdadm --assemble --scan /dev/md0 
Failed to find whole block device for '/dev/md0': No such file or directory
+ wait_for_storage_device /dev/md0
+ declare DEVICE_TIMEOUT=
+ local device=/dev/md
...

I removed the set_device_lock for raid activation.

set partition type to fd for raid:

Not strictly necessary:
If we do not enable oem-resize the partition type would be fd/raid and name p.lxraid as created by the kiwi/storage/disky.py.

assemble once after repart with devicesize update:

Otherwise the btrfs resize fails, because writing to raid device fails.
The mdadm --grow succeeds but if we look at the raid status afterwords in /proc/mdstat we observed:

Personalities : [raid1] 
md0 : broken raid1 sda4[0]
      2373568 blocks super 1.2 [2/1] [U_]

and with mdadm --examine for the underlying root partition, we still see the old partition size at "Avail Dev Size".
With an additional assemble the Avail Dev Size is reported correctly. Then the mdadm --grow actually resizes and is in state active and ready for the btrfs resize.

I added a new helper function update_devicesize_mdraid to assemble with --update=devicesize option and stop the array afterwards. The raid array is then ready for activation/resize.

@fnordic fnordic force-pushed the fix-raid-root-repart branch from 604280d to d80c4a4 Compare October 7, 2025 14:18
@fnordic fnordic changed the title fix: root repartitioning for root on raid: do not device lock not yet… fix: Installation with mdraid mirroring with oem-resize and oem-systemsize set Oct 7, 2025
@fnordic fnordic force-pushed the fix-raid-root-repart branch from d80c4a4 to 83e3cb6 Compare October 7, 2025 14:26
@fnordic fnordic marked this pull request as ready for review October 7, 2025 14:30
… started RaidDev, set partition type to fd for raid, assemble once after repart with devicesize update
@fnordic fnordic force-pushed the fix-raid-root-repart branch from 83e3cb6 to 9c5bb43 Compare October 7, 2025 15:39
Copy link
Collaborator

@schaefi schaefi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thanks much 👍

@schaefi schaefi merged commit e0730cd into OSInside:main Oct 14, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants