Automatically grow luks root partition on boot
Hi, The RPI4 JeOS image (https://en.opensuse.org/HCL:Raspberry_Pi4) automatically grows the root filesystem partition on boot. I have a custom partition setup based on this image where the root filesystem is encrypted. It has 3 partitions: 1. fat16 UEFI, 2. ext4 /boot partition 3. luks ext4 root partition. I create an image of this setup to use on several machines, and I'd like to automatically grow the luks partition on boot. My understanding is that it's normally done by systemd-repart, but it is possible to set it up so it resizes the root partition after cryptsetup before mounting the root partition? How do I set that up? Jonas
On Wed, May 22, 2024 at 1:00 PM Jonas Kvinge
Hi,
The RPI4 JeOS image (https://en.opensuse.org/HCL:Raspberry_Pi4) automatically grows the root filesystem partition on boot. I have a custom partition setup based on this image where the root filesystem is encrypted. It has 3 partitions: 1. fat16 UEFI, 2. ext4 /boot partition 3. luks ext4 root partition. I create an image of this setup to use on several machines, and I'd like to automatically grow the luks partition on boot. My understanding is that it's normally done by systemd-repart, but it
No, openSUSE images are normally using kiwi in particular dracut module kiwi-repart.
is possible to set it up so it resizes the root partition after cryptsetup before mounting the root partition? How do I set that up?
It should be possible to use it manually. It gets its config from /config.partids in initrd: andrei@tumbleweed:/tmp/dracut> cat ./config.partids kiwi_BootPart="3" kiwi_EfiPart="1" kiwi_RootPart="3" kiwi_SwapPart="2" andrei@tumbleweed:/tmp/dracut> and tries to resize the ${kiwi_RootPart} partition. I am afraid you will need to look at kiwi source code for documentation.
On Wed, 2024-05-22 at 14:17 +0300, Andrei Borzenkov wrote:
On Wed, May 22, 2024 at 1:00 PM Jonas Kvinge
wrote: Hi,
The RPI4 JeOS image (https://en.opensuse.org/HCL:Raspberry_Pi4) automatically grows the root filesystem partition on boot. I have a custom partition setup based on this image where the root filesystem is encrypted. It has 3 partitions: 1. fat16 UEFI, 2. ext4 /boot partition 3. luks ext4 root partition. I create an image of this setup to use on several machines, and I'd like to automatically grow the luks partition on boot. My understanding is that it's normally done by systemd-repart, but it
No, openSUSE images are normally using kiwi in particular dracut module kiwi-repart.
Thanks, that helped me. Since I've rebuilt the initramdisk with dracut under chroot before booting, the kiwi modules weren't included because "check" in module_setup returns 255. If I run dracut with --force-add "kiwi-repart", it's included, but it stops here: https://github.com/OSInside/kiwi/blob/1e9fdf24a15e3bd591f0ac01684d2546971049... because the "/.profile" doesn't exist in the image, but the /config.partids exists. The .profile file should be the kiwi configuration, any idea where it is, or where the kiwi sources for rpi4 images are? Jonas
On Wed, May 22, 2024 at 11:06 PM Jonas Kvinge
On Wed, 2024-05-22 at 14:17 +0300, Andrei Borzenkov wrote:
On Wed, May 22, 2024 at 1:00 PM Jonas Kvinge
wrote: Hi,
The RPI4 JeOS image (https://en.opensuse.org/HCL:Raspberry_Pi4) automatically grows the root filesystem partition on boot. I have a custom partition setup based on this image where the root filesystem is encrypted. It has 3 partitions: 1. fat16 UEFI, 2. ext4 /boot partition 3. luks ext4 root partition. I create an image of this setup to use on several machines, and I'd like to automatically grow the luks partition on boot. My understanding is that it's normally done by systemd-repart, but it
No, openSUSE images are normally using kiwi in particular dracut module kiwi-repart.
Thanks, that helped me. Since I've rebuilt the initramdisk with dracut under chroot before booting, the kiwi modules weren't included because "check" in module_setup returns 255. If I run dracut with --force-add "kiwi-repart", it's included, but it stops here: https://github.com/OSInside/kiwi/blob/1e9fdf24a15e3bd591f0ac01684d2546971049... because the "/.profile" doesn't exist in the image, but the /config.partids exists. The .profile file should be the kiwi configuration, any idea where it is, or where the kiwi sources for rpi4 images are?
It is generated by kiwi and reflects image settings. Did you consider using kiwi to build your images? You can adapt one of the existing configurations. openSUSE images are built in the project https://build.opensuse.org/package/show/openSUSE:Factory:ARM/JeOS you can filter for raspberry to get the list of kiwi configurations for different images.
participants (2)
-
Andrei Borzenkov
-
Jonas Kvinge