I've been trying to convert an lxc container to a virtual machine, but I've encountered a problem when trying to boot. I end up with the (initramfs) command line and I've got the following errors:
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /run on /root/run failed: No such file or directory
run-init: opening console: No such file or directory
Target filesystem
doesn't have requested /sbin/init.
run-init: opening console: No such
file or directory (repeated a few times)
No init found. Try passing init= bootarg
BusyBox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built-in shell (ash) Enter
'help' for a list of built-in commands.
(initramfs)
From the live cd ubuntu 16.04:
blkid
/dev/sda1: UUID="3e671c97-7695-49e7-8c83-4527c94d8f14" TYPE="ext4" PARTUUID="406cef0c-01"
/dev/sda2: UUID="c555438a-fd29-4cad-a8cf-fe92c3b78e0b" TYPE="ext4" PARTUUID="406cef0c-02"
/dev/sr0: UUID="2018-07-31-01-12-13-00" LABEL="Ubuntu 16.04.5 LTS amd64" TYPE="iso9660" PTUUID="6be2cd0d" PTTYPE="dos
cat /etc/fstab:
UUID="3e671c97-7695-49e7-8c83-4527c94d8f14" /boot ext4 defaults,noatime0 0 UUID="c555438a-fd29-4cad-a8cf-fe92c3b78e0b" / ext4 defaults,noatime0 1
UUID="688b6a9b-0f30-450c-b8d6-1316c0d17798" none swap defaults 00
Relevant parts of /boot/grub/grub.cfg:
set root='hd0,msdos2' if [ x$feature_platform_search_hint = xy ];
then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2
--hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 c555438a-fd29-4cad-a8cf-fe92c3b78e0belse search --no-floppy
--fs-uuid --set=root c555438a-fd29-4cad-a8cf-fe92c3b78e0b fi
and:
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu
--class os $menuentry_id_option 'gnulinux-simple-c555438a-fd29-4cad-a8cf-fe92c3b78e0b' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3e671c97-7695-49e7-8c83-4527c94d8f14
else
search --no-floppy --fs-uuid --set=root 3e671c97-7695-49e7-8c83-4527c94d8f14
fi
linux /vmlinuz-4.15.0-30-generic root=UUID=3e671c97-7695-49e7-8c83-4527c94d8f14 ro quiet splash
$vt_handoff initrd /initrd.img-4.15.0-30-generic }
I changed the uuid for the linux /vmlinuz-4.15.0-30-generic so that it matches /dev/sda1 and not /dev/sda2. The grub-installer placed the UUID of /dev/sda2, where the root partition is, and I'm not sure why.
Any ideas as to how to solve this problem?
Best Answer
I finally realised what the actual problem was after solving the grub issue. The blank screen was related to how the consoles (tty) were identified. Each time the blank screen appeared after the grub menu, the operating system would actually boot fine, but it didn't show anything. But whenever I pressed ctrl+alt F1 or F2, the prompt would show up and everything was actually fine. To solve this issue, I replaced this line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" with GRUB_CMDLINE_LINUX_DEFAULT="text" Works just fine now and the boot process is also displayed on the screen.