Waiting for root device /dev/sda2

After installing my Mender converted img, my PC gets stuck on the following screen

I need some help to resolve this problem. I’ve been stuck for a while. Below is my full story which may or may not be useful.

Previously I was using mkosi v5 to create a minimal Ubuntu Focal img before putting it through Mender Convert and then installing the resulting img with the dd command onto another PC, and it was working fine. I could get my Mender converted minimal Ubuntu focal OS running.

Now I need a minimal Ubuntu Noble img so in an attempt to create it, I simply just changed some names in the configurations that I already had but when I run mkosi, I would get an error in the middle of the process. After trying many things, I was able to get mkosi to succeed by using v24.3 (Installed from repo) running on Ubuntu 24.04.1. I thought everything else would be fine from here but that wasn’t the case. Just to confirm the minimal Ubuntu Noble img works, I tried to boot it from a USB. The results were some weird screens and never the login screen. After fixing the configurations, I finally got a minimal Ubuntu Noble img that works. The following shows the configurations.

$ tree
.
├── mkosi.conf
├── mkosi.postinst.chroot
├── mkosi.repart
│   ├── boot.conf
│   └── main.conf
└── README.md
$ cat mkosi.conf
[Distribution]
Distribution=ubuntu
Release=noble

[Output]
Format=disk
OutputDirectory=out/

[Content]
Bootable=yes
Bootloader=systemd-boot
Hostname=robot
KernelCommandLine="console=ttyS0"
Packages=
    linux-image-generic
    systemd
    sudo
    apt-utils
    ubuntu-desktop-minimal
    gdm3
    netbase
    network-manager
    iproute2

WithNetwork=yes

[Host]
ToolsTree=default
ToolsTreeDistribution=ubuntu
ToolsTreeRelease=noble
$ cat mkosi.repart/boot.conf 
[Partition]
Type=esp
Format=vfat
SizeMinBytes=512M
SizeMaxBytes=512M
CopyFiles=/efi:/
CopyFiles=/boot/EFI:/EFI
$ cat mkosi.repart/main.conf
[Partition]
Type=root
SizeMinBytes=6G
SizeMaxBytes=6G
Format=ext4
CopyFiles=/
CopyFiles=/boot/:/boot
$ cat mkosi.postinst.chroot 
#!/usr/bin/env bash

export DEBIAN_FRONTEND=noninteractive

useradd ubuntu -s /bin/bash -m

echo "ubuntu:ubuntu" | chpasswd
usermod -aG sudo,systemd-journal ubuntu

After putting the img through the same version of Mender Convert as before and installing the resulting img, I got the screen as previously shown above. I’ve spent a lot of time trying to figure out what’s the cause of the problem but still haven’t got anything. I’ve tried many things like using latest versions of Mender Convert and setting grub as the bootloader in the mkosi configurations but so far nothing helped.

I also tried the golden device method where I install Ubuntu 24.04.1 by following the instructions in https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview, getting a copy of the img, putting it through Mender Convert and installing the resulting img onto a PC. Ubuntu booted up fine. This probably means something is either wrong or missing or both in my minimal Ubuntu Noble img.
(Please note that this golden device method doesn’t meet my needs so I cannot use it as a solution for my work)

Hi @schen,

Thanks for reaching out. Unfortunately, mkosi has been known for some time now to be problematic, see also Help Automating OS Image Creation with Mkosi for Mender-Compatible Deployment? - #6 by bssi. Maybe debos as mentioned might be a viable solution for you?

Greetz,
Josef