On Tue, Jul 9, 2024, at 2:27 AM, Junya Noguchi (Fujitsu) wrote:
To whom it may concern
An attempt to build an OpenSUSE image using Diskimage-builder failed. It seems that dracut failed during initial image creation because /dev wasn't mounted.
The log shows /dev is being unmounted which implies that it was mounted when the error occured: 2024-07-05 02:08:12.688 | Unmount /tmp/dib_build.pTiDO08e/mnt/dev
Is there a way to solve this problem?
You may need to insert a "breakpoint" (add bash/sh to the element just prior to the failure to get an interactive shell at that point) just before the grub2-probe execution and inspect the image build to see why /boot/efi and / devices are not found. Are you running disk-image-create within a container? If so the /dev present there may not include sufficient for the image build if the container wasn't created as a privileged container.
[xxxxxxx@xxxxxxxxxxx ~]$ cat /etc/os-release | grep PRETTY_NAME PRETTY_NAME="Rocky Linux 9.3 (Blue Onyx)" [xxxxxxx@xxxxxxxxxxx ~]$ [xxxxxxx@xxxxxxxxxxx ~]$ disk-image-create opensuse baremetal dhcp-all-interfaces -a amd64 grub2 -o opensuse_test 2024-07-05 02:06:02.796 | diskimage-builder version 3.32.0 2024-07-05 02:06:02.797 | Building elements: base opensuse baremetal dhcp-all-interfaces grub2 2024-07-05 02:06:02.948 | Expanded element dependencies to: package-installs base baremetal zypper cache-url install-bin sysprep dib-init-system install-types pkg-map dhcp-all-interfaces grub2 opensuse 2024-07-05 02:06:03.037 | Building in /tmp/dib_build.pTiDO08e 2024-07-05 02:06:03.041 | Searching elements for block-device[-amd64].yaml ... 2024-07-05 02:06:03.047 | ... done
2024-07-05 02:06:19.736 | Running hooks from /tmp/dib_build.pTiDO08e/hooks/extra-data.d
2024-07-05 02:07:17.361 | dracut: Stored kernel commandline: 2024-07-05 02:07:17.362 | dracut: No dracut internal kernel commandline stored in the initramfs 2024-07-05 02:07:17.363 | dracut: *** Creating image file '/boot/initrd-5.3.18-150300.59.106-default' *** 2024-07-05 02:07:24.019 | dracut: *** Creating initramfs image file '/boot/initrd-5.3.18-150300.59.106-default' done *** 2024-07-05 02:07:24.127 | update-bootloader: 2024-07-05 02:07:24 <3> update-bootloader-4241 run_command.294: '/usr/lib/bootloader/grub2-efi/config' failed with exit code 1, output: 2024-07-05 02:07:24.129 | <<<<<<<<<<<<<<<< 2024-07-05 02:07:24.129 | + /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg 2024-07-05 02:07:24.129 | /usr/sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?). 2024-07-05 02:07:24.129 | >>>>>>>>>>>>>>>> 2024-07-05 02:07:24.129 | Updating bootloader failed 2024-07-05 02:07:24.204 | bootloader_entry: 2024-07-05 02:07:24 <3> bootloader_entry-1651 run_command.294: '/usr/lib/bootloader/grub2-efi/config' failed with exit code 1, output: 2024-07-05 02:07:24.218 | <<<<<<<<<<<<<<<< 2024-07-05 02:07:24.218 | + /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg 2024-07-05 02:07:24.218 | /usr/sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?). 2024-07-05 02:07:24.218 | >>>>>>>>>>>>>>>> 2024-07-05 02:07:24.218 | Failed to get root password hash 2024-07-05 02:07:24.218 | Failed to import /etc/uefi/certs/40905999.crt 2024-07-05 02:07:24.220 | warning: %post(kernel-default-5.3.18-150300.59.106.1.x86_64) scriptlet failed, exit status 255 2024-07-05 02:07:24.221 | done]
2024-07-05 02:07:27.003 | Executing %posttrans script 'ca-certificates-mozilla-2.56-150200.24.1.noarch.rpm' [... 2024-07-05 02:07:27.003 | update-bootloader: 2024-07-05 02:07:27 <3> update-bootloader-1757 run_command.294: '/usr/lib/bootloader/grub2-efi/install' failed with exit code 1, output: 2024-07-05 02:07:27.003 | <<<<<<<<<<<<<<<< 2024-07-05 02:07:27.003 | target = x86_64-efi 2024-07-05 02:07:27.003 | + /usr/sbin/shim-install --config-file=/boot/grub2/grub.cfg --no-nvram --removable 2024-07-05 02:07:27.003 | /usr/sbin/grub2-probe: error: cannot find a device for /boot/efi (is /dev mounted?). 2024-07-05 02:07:27.003 | >>>>>>>>>>>>>>>> 2024-07-05 02:07:27.040 | update-bootloader: 2024-07-05 02:07:27 <3> update-bootloader-1757 run_command.294: '/usr/lib/bootloader/grub2-efi/config' failed with exit code 1, output: 2024-07-05 02:07:27.040 | <<<<<<<<<<<<<<<< 2024-07-05 02:07:27.040 | + /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg 2024-07-05 02:07:27.040 | /usr/sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?). 2024-07-05 02:07:27.040 | >>>>>>>>>>>>>>>> 2024-07-05 02:07:27.089 | . 2024-07-05 02:07:27.089 | Creating initrd: /boot/initrd-5.3.18-150300.59.106-default 2024-07-05 02:07:27.304 | dracut: Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force /boot/initrd-5.3.18-150300.59.106-default 5.3.18-150300.59.106-default 2024-07-05 02:07:27.370 | dracut: Turning off host-only mode: '/run' is not mounted!
2024-07-05 02:07:54.459 | dracut: Stored kernel commandline: 2024-07-05 02:07:54.460 | dracut: No dracut internal kernel commandline stored in the initramfs 2024-07-05 02:07:54.461 | dracut: *** Creating image file '/boot/initrd-5.3.18-150300.59.138-default' *** 2024-07-05 02:08:01.205 | dracut: *** Creating initramfs image file '/boot/initrd-5.3.18-150300.59.138-default' done *** 2024-07-05 02:08:01.308 | update-bootloader: 2024-07-05 02:08:01 <3> update-bootloader-8343 run_command.294: '/usr/lib/bootloader/grub2-efi/config' failed with exit code 1, output: 2024-07-05 02:08:01.309 | <<<<<<<<<<<<<<<< 2024-07-05 02:08:01.309 | + /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg 2024-07-05 02:08:01.309 | /usr/sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?). 2024-07-05 02:08:01.309 | >>>>>>>>>>>>>>>> 2024-07-05 02:08:01.310 | Updating bootloader failed 2024-07-05 02:08:01.311 | warning: %posttrans(device-mapper-2.03.05_1.02.163-150200.8.49.1.x86_64.rpm) scriptlet failed, exit status 1 2024-07-05 02:08:11.000 | .....done] 2024-07-05 02:08:12.494 | There are running programs which still use files and libraries deleted or updated by recent upgrades. They should be restarted to benefit from the latest updates. Run 'zypper ps -s' to list these programs. 2024-07-05 02:08:12.494 | 2024-07-05 02:08:12.494 | Since the last system boot core libraries or services have been updated. 2024-07-05 02:08:12.494 | Reboot is suggested to ensure that your system benefits from these updates. 2024-07-05 02:08:12.541 | Unmount /tmp/dib_build.pTiDO08e/mnt/var/cache/zypp 2024-07-05 02:08:12.582 | Unmount /tmp/dib_build.pTiDO08e/mnt/tmp/in_target.d 2024-07-05 02:08:12.603 | Unmount /tmp/dib_build.pTiDO08e/mnt/sys 2024-07-05 02:08:12.623 | Unmount /tmp/dib_build.pTiDO08e/mnt/proc 2024-07-05 02:08:12.667 | Unmount /tmp/dib_build.pTiDO08e/mnt/dev/pts 2024-07-05 02:08:12.688 | Unmount /tmp/dib_build.pTiDO08e/mnt/dev 2024-07-05 02:08:12.882 | INFO diskimage_builder.block_device.blockdevice [-] State already cleaned - no way to do anything here [xxxxxxx@xxxxxxxxxxx ~]$