initramfs-tools reports "can't identify type of root filesystem" when label is missing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
When I attempt to regenerate an initramfs for a new root filsystem, update-initramfs is unable to identify the filesystem type of this initramfs.
```
# update-initramfs -u
update-initramfs: Generating /boot/initrd.
W: Couldn't identify type of root file system for fsck hook
W: mkconf: MD subsystem is not loaded, thus I cannot scan for arrays.
W: mdadm: failed to auto-generate temporary mdadm.conf file.
```
the mounted filesystem:
```
# cat /proc/mounts | grep xfs
/dev/sda1 / xfs rw,relatime,
```
fstab:
```
# cat /etc/fstab | grep xfs
LABEL=cloudimg-
```
cmdline:
```
BOOT_IMAGE=
```
The failure is in hooks/fsck when it calls resolve_device(). The function returns 1 and echos nothing because it has a LABEL, not a UUID or PARTUUID.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: initramfs-tools 0.140ubuntu13.4
ProcVersionSign
Uname: Linux 5.15.0-1059-kvm x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
Date: Wed Jun 5 01:25:29 2024
PackageArchitec
ProcEnviron:
TERM=vt220
PATH=(custom, no user)
XDG_RUNTIME_
LANG=C.UTF-8
SHELL=/bin/bash
SourcePackage: initramfs-tools
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in initramfs-tools (Ubuntu): | |
importance: | Undecided → Low |
status: | New → Fix Committed |
Thank you for taking the time to report this bug and helping to make Ubuntu better. I failed to reproduce the issue. I took a jammy VM and added a label to the boot device:
```
sudo tune2fs -L somelabel /dev/vda3
```
Configured fstab to look for the label:
```
$ grep -w / /etc/fstab | grep -v ^#
LABEL=somelabel / ext4 errors=remount-ro 0 1
```
and successfully updated the initrd:
``` img-6.5. 0-35-generic
$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.
```
I checked the call from `resolve_device`:
```
$ blkid -l -t LABEL=somelabel -o device
/dev/vda3
```
Can you let mkinitramfs run with `set -x` to get some log messages?