Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#902061: dracut: Can't boot from backup disk because of UUID

169 views
Skip to first unread message

Stefan Monnier

unread,
Jun 21, 2018, 11:00:02 PM6/21/18
to
Package: dracut
Version: 044+241-3
Severity: normal

Dear Maintainer,

The HDD on my little BananaPi homeserver is dying (keeps giving errors
causing SATA connnnection reset, etc...), so I took it out and plugged
in another HDD that contained a backup copy of the system (basically
and `rsync` of the boot and root partitions). My U-boot script
specifies the root partition via "root=/dev/mapper/VG-root" so there's
no need for any UUID to find the root partition. And since dracut
is not configured in "hostonly" mode, I did not expect any problem.

Yet, the boot failed telling me that it couldn't find
/dev/disk/by-uuid/blablabla.

It did put me into some emergency shell where I managed to mount the
LVM partition (which the initrd has successfully found and activated),
rerun dracut and finally get my system to boot successfully.
But given the use of LVM and an explicit "root=..." on the kernel
command line, I don't see any justification for the boot failure.

Indeed, given my setup (and arguably any non-hostonly initrd)
I don't see why any UUID would appear in the inird, yet:

# lsinitrd /boot/initrd.img-4.16.0-2-armmp| grep by-uuid
-rw-r--r-- 1 root root 146 Jun 18 15:22 lib/dracut/hooks/emergency/80-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f1d3f740e-7a96-434a-8dfb-4a17e3dc563b.sh
-rw-r--r-- 1 root root 64 Jun 18 15:22 lib/dracut/hooks/initqueue/finished/devexists-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f1d3f740e-7a96-434a-8dfb-4a17e3dc563b.sh
#

How can I configure dracut to "stay away from UUID since I use
LVM names instead"? Shouldn't this be the default anyway when
the root partition is on LVM?


Stefan


-- System Information:
Debian Release: 9.4
APT prefers stable
APT policy: (990, 'stable'), (50, 'testing')
Architecture: armhf (armv7l)

Kernel: Linux 4.15.0-rc2+ (SMP w/2 CPU cores)
Locale: LANG=fr_CH.UTF-8, LC_CTYPE=fr_CH.UTF-8 (charmap=UTF-8), LANGUAGE=fr_CH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dracut depends on:
ii dracut-core 044+241-3

dracut recommends no packages.

Versions of packages dracut suggests:
pn dracut-network <none>

-- Configuration Files:
/etc/bash_completion.d/dracut changed:
__contains_word () {
local word=$1; shift
for w in $*; do [[ $w = $word ]] && return 0; done
return 1
}
_dracut() {
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-f -v -q -l -H -h -M -N
--ro-mnt --force --kernel-only --no-kernel --strip --nostrip
--hardlink --nohardlink --noprefix --mdadmconf --nomdadmconf
--lvmconf --nolvmconf --debug --profile --verbose --quiet
--local --hostonly --no-hostonly --fstab --help --bzip2 --lzma
--xz --no-compress --gzip --list-modules --show-modules --keep
--printsize --regenerate-all --noimageifnotneeded --early-microcode
--no-early-microcode --print-cmdline --prelink --noprelink --reproducible
--uefi
'
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
--omit-drivers --modules --omit --drivers --filesystems --install
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
--kernel-cmdline --sshkey --persistent-policy --install-optional
--loginstall --uefi-stub --kernel-image
'
)
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--kmoddir|-k|--fwdir|--confdir|--tmpdir)
comps=$(compgen -d -- "$cur")
compopt -o filenames
;;
-c|--conf|--sshkey|--add-fstab|--add-device|-I|--install|--install-optional)
comps=$(compgen -f -- "$cur")
compopt -o filenames
;;
-a|-m|-o|--add|--modules|--omit)
comps=$(dracut --list-modules 2>/dev/null)
;;
--persistent-policy)
comps=$(cd /dev/disk/; echo *)
;;
--kver)
comps=$(cd /lib/modules; echo [0-9]*)
;;
*)
return 0
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi
if [[ $cur = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi
}
complete -F _dracut dracut

/etc/dracut.conf changed:

/etc/dracut.conf.d/10-debian.conf changed:
do_prelink=no
hostonly=yes


-- no debconf information

Thomas Lange

unread,
Jul 10, 2018, 10:10:02 AM7/10/18
to
>>>>> On Thu, 21 Jun 2018 22:50:05 -0400, Stefan Monnier <mon...@iro.umontreal.ca> said:

> specifies the root partition via "root=/dev/mapper/VG-root" so there's
> no need for any UUID to find the root partition. And since dracut
> is not configured in "hostonly" mode, I did not expect any problem.
Please try to use root=LABEL=.....
and see if this helps.

--
regards Thomas

Stefan Monnier

unread,
Jul 10, 2018, 12:40:03 PM7/10/18
to
> > specifies the root partition via "root=/dev/mapper/VG-root" so there's
> > no need for any UUID to find the root partition. And since dracut
> > is not configured in "hostonly" mode, I did not expect any problem.
> Please try to use root=LABEL=.....
> and see if this helps.

I don't label my partitions (it would be redundant since I name
the LVM volumes already).


Stefan

Thomas Lange

unread,
Jan 30, 2020, 3:50:03 PM1/30/20
to
I justs tested dracut with this in the kernel cmdline:
root=/dev/mapper/vg1-root

Works without any problems.
--
regards Thomas

Stefan Monnier

unread,
Jan 30, 2020, 3:50:04 PM1/30/20
to
> I justs tested dracut with this in the kernel cmdline:
> root=/dev/mapper/vg1-root
> Works without any problems.

But have you tested it with a disk that has different UUIDs?

I just tried

# lsinitrd /boot/initrd.img-5.3.0-2-armmp| grep by-uuid
-rw-r--r-- 1 root root 146 Dec 12 08:19 lib/dracut/hooks/emergency/80-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f5de7a0ca-5026-4294-ac9a-da24e3bae135.sh
-rw-r--r-- 1 root root 64 Dec 12 08:19 lib/dracut/hooks/initqueue/finished/devexists-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f5de7a0ca-5026-4294-ac9a-da24e3bae135.sh
~-0#

so in Debian's stable version of dracut from December, the UUID still
appears in the initrd. I haven't tried to swap the drive to see if I'd
encounter again the same problem, but it seems likely (the files have
the same name and same size as the ones that seemed to cause trouble).


Stefan

Thomas Lange

unread,
Jan 30, 2020, 4:10:05 PM1/30/20
to
You are right,

it worked for me, because I have a separate /boot partition. After
changing the uuid of /boot, the machine does not boot.

But IMO it's a problem of grub, using this sort of code in grub.cfg:

if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root 31147a1b-b3d3-1234-93ee-93854ac2505d
else
search --no-floppy --fs-uuid --set=root 31147a1b-b3d3-1234-93ee-93854ac2505d
fi

If if would not use uuids here, it may work.
--
regards Thomas

Stefan Monnier

unread,
Jan 30, 2020, 6:00:04 PM1/30/20
to
IIRC, this part was not problematic: Grub came up and it did load the
relevant kernel (and initrd), thanks presumably to "sane fallback
defaults". The problem showed up later when the initrd script somehow
insisted on cheking for the presence of the partition with the
relevant UUID.


Stefan

Thomas Lange

unread,
Nov 16, 2022, 8:50:04 PM11/16/22
to

I found an example how it may be possible to use lvm names:
NEWS.md says:

$ dracut --print-cmdline
rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root


The rd.lvm.lv parameters are only needed if you do not want to
activate all lv's. You may need to add rd.auto for autoassembly of all
lvm devices. See man dracut.cmdline(7) for details..

--
regards Thomas
0 new messages