[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#980021: initramfs-tools: Upgrading a LVM2 system with separate /usr to buster breaks booting



Package: initramfs-tools
Version: 0.139
Severity: important

Dear Maintainer,

I understand that separate /usr is deprecated, but many users do not
have the luxury of wiping and reinstalling their entire system.  Rather,
a simple dist-upgrade procedure is expected to produce a working system,
making a best effort to migrate previously supported configurations.

Given that, upgrading a system to buster will break booting if the
following two conditions are true:
* /usr is a mount for a separate block device
* The block device containing the /usr filesystem is a LVM volume.

The reason is because the script
/usr/share/initramfs-tools/scripts/local-top/lvm2 only attempts to
activate the root and resume devices, and no other devices.
Unfortunately, systemd which has been introduced with buster introduces
a new boot dependency on /usr.

I have created the following workaround:
# DEV=$(lsblk -p -f -l | grep '\/usr' | awk '{print $1}' | sed 's/\//\\\//g'); cat /usr/share/initramfs-tools/scripts/local-top/lvm2 | sed 's/^exit 0$/activate "'${DEV}'"; exit 0/' > /etc/initramfs-tools/scripts/local-top/lvm2

This produces the following diff:
# diff -u /usr/share/initramfs-tools/scripts/local-top/lvm2
/etc/initramfs-tools/scripts/local-top/lvm2
--- /usr/share/initramfs-tools/scripts/local-top/lvm2   2019-06-21
02:59:13.000000000 -0500
+++ /etc/initramfs-tools/scripts/local-top/lvm2 2021-01-12
21:20:36.000000000 -0600
@@ -62,4 +62,4 @@
 activate "$ROOT"
 activate "$resume"

-exit 0
+activate "/dev/mapper/debian--lenny--i386-usr"; exit 0

Another part of the initramfs scripts mounts a separate /usr filesystem
if the block device exists; this workaround is strictly to ensure the
LVM device is activated so that the later code can actually mount it.

-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 26M Jan 12 20:49 /boot/initrd.img-5.4.0-2-686-pae
-rw-r--r-- 1 root root 27M Jan 12 20:49 /boot/initrd.img-5.8.0-0.bpo.2-686-pae
-rw-r--r-- 1 root root 27M Jan 12 20:48 /boot/initrd.img-5.9.0-0.bpo.2-686-pae
-- /proc/cmdline
BOOT_IMAGE=/vmlinuz-5.9.0-0.bpo.2-686-pae root=/dev/mapper/debian--lenny--i386-root ro elevator=noop quiet

-- /proc/filesystems
	ext3
	ext2
	ext4
	fuseblk

-- lsmod
Module                  Size  Used by
openafs              1720320  2
cirrus                 16384  0
sg                     28672  0
drm_kms_helper        151552  3 cirrus
cec                    40960  1 drm_kms_helper
virtio_balloon         24576  0
joydev                 24576  0
evdev                  20480  4
serio_raw              20480  0
pcspkr                 16384  0
button                 20480  0
drm                   372736  3 cirrus,drm_kms_helper
fuse                  102400  1
configfs               32768  1
ip_tables              24576  0
x_tables               28672  1 ip_tables
autofs4                40960  2
ext4                  565248  5
crc16                  16384  1 ext4
mbcache                16384  1 ext4
jbd2                   90112  1 ext4
crc32c_generic         16384  5
dm_mod                106496  26
sd_mod                 49152  3
sr_mod                 24576  0
t10_pi                 16384  1 sd_mod
crc_t10dif             20480  1 t10_pi
crct10dif_generic      16384  1
cdrom                  53248  1 sr_mod
crct10dif_common       16384  2 crct10dif_generic,crc_t10dif
ata_generic            16384  0
virtio_net             45056  0
net_failover           20480  1 virtio_net
failover               16384  1 net_failover
ata_piix               32768  2
uhci_hcd               45056  0
libata                188416  2 ata_piix,ata_generic
ehci_hcd               65536  0
scsi_mod              176128  4 sd_mod,libata,sr_mod,sg
psmouse               131072  0
virtio_pci             24576  0
virtio_ring            28672  3 virtio_net,virtio_balloon,virtio_pci
virtio                 16384  3 virtio_net,virtio_balloon,virtio_pci
i2c_piix4              28672  0
usbcore               196608  2 ehci_hcd,uhci_hcd
usb_common             16384  3 ehci_hcd,uhci_hcd,usbcore
floppy                 57344  0

-- /etc/initramfs-tools/modules

-- /etc/kernel-img.conf
# This is a sample /etc/kernel-img.conf file
# See kernel-img.conf(5) for details

# If you want the symbolic link (or image, if move_image is set) to be
# stored elsewhere than / set this variable to the dir where you
# want the symbolic link.  Please note that this is not a Boolean
# variable.  This may be of help to loadlin users, who may set both
# this and move_image. Defaults to /. This can be used in conjunction
# with all above options except link_in_boot, which would not make
# sense.  (If both image_dest and link_in_boot are set, link_in_boot
# overrides).
image_dest = /

# This option manipulates the build link created by recent kernels. If
# the link is a dangling link, and if a the corresponding kernel
# headers appear to have been installed on the system, a new symlink
# shall be created to point to them.
#relink_build_link = YES

# If set, the preinst shall silently try to move /lib/modules/version
# out of the way if it is the same version as the image being
# installed. Use at your own risk.
#clobber_modules = NO

# If set, does not prompt to continue after a depmod problem in the
# postinstall script.  This facilitates automated installs, though it
# may mask a problem with the kernel image. A diag‐ nostic is still
# issued. This is unset be default.
# ignore_depmod_err = NO

# These setting are for legacy postinst scripts only. newer postinst
# scripts from the kenrel-package do not use them
do_symlinks = yes
do_bootloader = no
do_initrd=yes
link_in_boot=no

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=auto
KEYMAP=n
COMPRESS=lz4
DEVICE=
NFSROOT=auto
RUNSIZE=10%
FSTYPE=auto

-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no

-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:

/usr/share/initramfs-tools/hooks:
dmsetup
fsck
keymap
klibc-utils
kmod
lvm2
reiserfsprogs
resume
thermal
thin-provisioning-tools
udev
zz-busybox


-- System Information:
Debian Release: 10.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 5.9.0-0.bpo.2-686-pae (SMP w/1 CPU core)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages initramfs-tools depends on:
ii  initramfs-tools-core  0.139
ii  linux-base            4.6

initramfs-tools recommends no packages.

Versions of packages initramfs-tools suggests:
ii  bash-completion  1:2.8-6

-- Configuration Files:
/etc/initramfs-tools/modules changed:


-- no debconf information

Reply to: