canonical / packer-maas

Packer templates to create MAAS deployable images
Other
288 stars 175 forks source link

Debian 12 Deployment Hangs When Root is Directly Mounted from md0 #229

Closed iofloodbrian closed 4 months ago

iofloodbrian commented 6 months ago

Problem Description: When deploying a machine with the root file system mounted directly from a device (e.g., md0 in my case), Debian 12 hangs indefinitely on the first boot at the end of deployment.

Cause: Upon investigation, this issue appears to be due to /boot/grub/grub.cfg expecting a PARTUUID which makes it incompatible with a regular UUID.

Example Configuration: In a scenario where the root is directly mounted from md0, the relevant kernel configurations in grub.cfg appear as follows:

submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-a800413b-3b5a-4414-8486-02829320bb4b' {
    menuentry 'Debian GNU/Linux, with Linux 6.1.0-21-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-21-amd64-advanced-a800413b-3b5a-4414-8486-02829320bb4b' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod diskfilter
        insmod mdraid1x
        insmod ext2
        set root='mduuid/043374da474f2158428a557ef0c46f68'
        search --no-floppy --fs-uuid --set=root a800413b-3b5a-4414-8486-02829320bb4b
        echo 'Loading Linux 6.1.0-21-amd64 ...'
        linux /boot/vmlinuz-6.1.0-21-amd64 root=PARTUUID= ro console=tty0 console=ttyS0,115200
        echo 'Loading initial ramdisk ...'
        initrd /boot/initrd.img-6.1.0-21-amd64
    }
}

As shown above, root=PARTUUID= is left empty, since md0 lacks partitions and thus has no PARTUUID. Instead, the configuration should refer to a regular UUID in this scenario.

Workaround: Creating a partition on the RAID device (e.g., md0-part1) resolves this issue. With a PARTUUID available for the partition, Debian 12 completes deployment without hanging.

Request: Other images, such as those of AlmaLinux, appear to support both UUID and PARTUUID. It would be helpful if the Debian 12 image could also handle both types to prevent hanging during deployment.

Testing Status: I have not tested other Debian images, so I'm unsure whether the same issue affects them.

github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 4 months ago

This issue was closed because it has been inactive for 30 days since being marked as stale.

acamilleri commented 4 months ago

On my end, this was due to the configuration set by the /etc/default/grub.d/10_cloud.cfg file.

# Use PARTUUID instead of UUID for root=
GRUB_DISABLE_LINUX_UUID=true
GRUB_DISABLE_LINUX_PARTUUID=