Bug#1085123: initramfs: busybox fails mounting /usr with a X-mount.subdir option
Package: initramfs-tools
Version: 0.145
Severity: normal
File: initramfs
Dear Maintainer,
I have reported the Busybox bug as:
https://bugs.busybox.net/show_bug.cgi?id=16207
However, I don't anticipate resolution soon, as a similar bug is 3 years old:
https://bugs.busybox.net/show_bug.cgi?id=14466
Steps to reproduce:
1. create a replacement copy of /usr as a subvolume of a new filesystem.
2. edit fstab to add the new /usr
3. mount this live over the existing /usr as part of /
4. update GRUB, initrd etc.
5. check appropriate helpers are in the initrd image
6. reboot
7. use a live distribution / break=bottom to rescue the system, undoing step 2.
The early initial ramdisk init script fails to mount /usr properly and a kernel
panic ensues.
I debugged this by booting with break=bottom. I verified that the busybox mount
command in the initial ramdisk ends up just mounting the whole new file system
at /usr instead of the subdirectory. I also checked that /root/usr/usr/bin/mount
(i.e., the util-linux mount in /usr) did work within the early init
environment...
I'm not entirely sure how it found its dependencies.
I found the related:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847424#161
It would be good to replace busybox mount if it is not going to be enhanced. I
checked and the klibc-utils mount does not support X-mount.subdir either.
For the record, this is the actual line in my fstab, showing where I have
currently mounted the replacement /usr. I renamed the subdirectory to USR to
make debugging a little less confusing.
UUID=9ec7b727-0da5-483a-83fd-4e3220e3ee9a /usr2 bcachefs
defaults,ro,X-mount.subdir=USR 0 0
Is there an easy way for end users to configure initramfs-tools to copy the
util-linux mount into the initial ramdisk in preference to busybox?
$ ldd /usr/bin/mount
linux-vdso.so.1 (0x00007f94f4c9a000)
libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1
(0x00007f94f4be9000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1
(0x00007f94f4bb9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f94f49c3000)
libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1
(0x00007f94f4964000)
/lib64/ld-linux-x86-64.so.2 (0x00007f94f4c9c000)
libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0
(0x00007f94f48c9000)
$ ldd /usr/bin/busybox
linux-vdso.so.1 (0x00007fe83a1e1000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2
(0x00007fe83a0d9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe839ee3000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe83a1e3000)
At the very least, it would be nice if busybox would spit out warnings about
ignored options.
Finally while I did test with bcachefs, the X-mount.subdir option is filesystem
agnostic and the failure mode is filesystem independent.
Regards.
-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root disk 49M Oct 13 19:08 /boot/initrd.img-6.1.0-25-amd64
-rw-r--r-- 1 root disk 53M Oct 13 19:14 /boot/initrd.img-6.10.11-amd64
-- /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.10.11-amd64 root=/dev/mapper/vg0-root ro
rootdelay=3 ignore_loglevel crashkernel=384M-:128M net.ifnames=0 quiet
crashkernel=384M-:128M
-- resume
RESUME=
-- /proc/filesystems
fuseblk
ext3
ext2
ext4
vfat
bcachefs
-- lsmod
Module Size Used by
rfcomm 102400 2
cmac 12288 2
algif_hash 12288 1
algif_skcipher 12288 1
af_alg 32768 6 algif_hash,algif_skcipher
bnep 36864 2
snd_hrtimer 12288 1
snd_seq_midi 20480 0
snd_seq_midi_event 16384 1 snd_seq_midi
snd_rawmidi 53248 1 snd_seq_midi
snd_seq 110592 3 snd_seq_midi,snd_seq_midi_event
tun 69632 0
snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi
sit 40960 0
tunnel4 12288 1 sit
ip_tunnel 36864 1 sit
binfmt_misc 28672 1
nft_chain_nat 12288 4
nf_nat 65536 1 nft_chain_nat
nf_conntrack 204800 1 nf_nat
nf_defrag_ipv6 24576 1 nf_conntrack
nf_defrag_ipv4 12288 1 nf_conntrack
ipt_REJECT 12288 2
nf_reject_ipv4 16384 1 ipt_REJECT
xt_multiport 16384 1
nft_compat 20480 3
x_tables 53248 3 nft_compat,xt_multiport,ipt_REJECT
rpcsec_gss_krb5 32768 0
nfsd 966656 5
auth_rpcgss 192512 2 nfsd,rpcsec_gss_krb5
nfs_acl 12288 1 nfsd
nfs 602112 0
lockd 155648 2 nfsd,nfs
grace 12288 2 nfsd,lockd
netfs 573440 1 nfs
sunrpc 864256 19
nfsd,auth_rpcgss,lockd,rpcsec_gss_krb5,nfs_acl,nfs
nf_tables 372736 14 nft_compat,nft_chain_nat
nfnetlink 20480 2 nft_compat,nf_tables
bcachefs 2019328 2
lz4hc_compress 20480 1 bcachefs
lz4_compress 24576 1 bcachefs
nls_ascii 12288 1
tcp_diag 12288 0
inet_diag 28672 1 tcp_diag
nls_cp437 16384 1
parport_pc 40960 0
vfat 20480 1
fat 98304 1 vfat
ppdev 24576 0
lp 20480 0
parport 81920 3 parport_pc,lp,ppdev
dm_crypt 61440 0
mt7921e 24576 0
mt7921_common 86016 1 mt7921e
mt792x_lib 65536 2 mt7921e,mt7921_common
btusb 86016 0
btrtl 32768 1 btusb
snd_hda_codec_hdmi 90112 1
btintel 69632 1 btusb
mt76_connac_lib 94208 3 mt792x_lib,mt7921e,mt7921_common
btbcm 24576 1 btusb
snd_hda_codec_realtek 208896 1
snd_hda_codec_generic 114688 1 snd_hda_codec_realtek
snd_hda_scodec_component 20480 1 snd_hda_codec_realtek
snd_hda_intel 61440 4
btmtk 12288 1 btusb
bluetooth 1069056 30 btrtl,btmtk,btintel,btbcm,bnep,btusb,rfcomm
joydev 24576 0
snd_intel_dspcfg 36864 1 snd_hda_intel
mt76 131072 4 mt792x_lib,mt7921e,mt7921_common,mt76_connac_lib
amd_atl 40960 1
snd_intel_sdw_acpi 16384 1 snd_intel_dspcfg
amdgpu 12939264 3
snd_hda_codec 212992 4
snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
mac80211 1396736 4 mt792x_lib,mt76,mt7921_common,mt76_connac_lib
intel_rapl_msr 20480 0
snd_hda_core 143360 5
snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
intel_rapl_common 49152 1 intel_rapl_msr
libarc4 12288 1 mac80211
snd_hwdep 16384 1 snd_hda_codec
cfg80211 1339392 4 mt76,mac80211,mt7921_common,mt76_connac_lib
snd_pcm_oss 69632 0
snd_mixer_oss 28672 2 snd_pcm_oss
snd_pcm 188416 6
snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_pcm_oss,snd_hda_core
rfkill 40960 3 bluetooth,cfg80211
edac_mce_amd 28672 0
kvm_amd 192512 0
sp5100_tco 16384 0
snd_timer 53248 4 snd_seq,snd_hrtimer,snd_pcm
amdxcp 12288 1 amdgpu
snd 147456 18
snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm_oss,snd_pcm,snd_rawmidi,snd_mixer_oss
watchdog 49152 1 sp5100_tco
drm_exec 12288 1 amdgpu
gpu_sched 65536 1 amdgpu
kvm 1343488 1 kvm_amd
ccp 155648 1 kvm_amd
soundcore 16384 2 snd
drm_buddy 20480 1 amdgpu
wmi_bmof 12288 0
k10temp 12288 0
sg 45056 0
efi_pstore 12288 0
rapl 20480 0
evdev 28672 35
pcspkr 12288 0
button 24576 0
ext4 1130496 5
crc16 12288 2 bluetooth,ext4
mbcache 16384 1 ext4
jbd2 196608 1 ext4
efivarfs 28672 1
raid10 73728 0
raid1 61440 0
raid0 24576 0
radeon 1888256 0
drm_ttm_helper 12288 2 amdgpu,radeon
ttm 102400 3 amdgpu,radeon,drm_ttm_helper
i2c_algo_bit 12288 2 amdgpu,radeon
drm_suballoc_helper 12288 2 amdgpu,radeon
drm_display_helper 262144 2 amdgpu,radeon
drm_kms_helper 253952 4 drm_display_helper,amdgpu,radeon
drm 749568 14
gpu_sched,drm_kms_helper,drm_exec,drm_suballoc_helper,drm_display_helper,drm_buddy,amdgpu,radeon,drm_ttm_helper,ttm,amdxcp
cec 69632 1 drm_display_helper
rc_core 73728 1 cec
dm_raid 49152 5
raid456 196608 6 dm_raid
async_raid6_recov 20480 1 raid456
async_memcpy 16384 2 raid456,async_raid6_recov
async_pq 16384 2 raid456,async_raid6_recov
async_xor 16384 3 async_pq,raid456,async_raid6_recov
async_tx 16384 5
async_pq,async_memcpy,async_xor,raid456,async_raid6_recov
md_mod 225280 5 raid1,dm_raid,raid10,raid0,raid456
xor 20480 2 bcachefs,async_xor
raid6_pq 122880 4 async_pq,bcachefs,raid456,async_raid6_recov
libcrc32c 12288 5 nf_conntrack,nf_nat,bcachefs,nf_tables,raid456
crc32c_generic 12288 0
dm_mod 208896 191 dm_raid,dm_crypt
hid_generic 12288 0
usbhid 77824 0
hid 253952 2 usbhid,hid_generic
sd_mod 81920 55
nvme 57344 2
nvme_core 192512 3 nvme
ahci 49152 55
crc32_pclmul 12288 0
xhci_pci 24576 0
libahci 61440 1 ahci
crc32c_intel 16384 7
t10_pi 20480 2 sd_mod,nvme_core
xhci_hcd 356352 1 xhci_pci
crc64_rocksoft_generic 12288 1
libata 454656 2 libahci,ahci
ghash_clmulni_intel 16384 0
r8169 118784 0
crc64_rocksoft 16384 1 t10_pi
sha512_ssse3 53248 0
realtek 45056 1
crc_t10dif 16384 1 t10_pi
usbcore 401408 4 xhci_hcd,usbhid,btusb,xhci_pci
scsi_mod 319488 3 sd_mod,libata,sg
sha256_ssse3 32768 1
mdio_devres 12288 1 r8169
crct10dif_generic 12288 0
sha1_ssse3 32768 0
crct10dif_pclmul 12288 1
i2c_piix4 28672 0
crc64 16384 3 crc64_rocksoft,crc64_rocksoft_generic,bcachefs
crct10dif_common 12288 3 crct10dif_generic,crc_t10dif,crct10dif_pclmul
libphy 225280 3 r8169,mdio_devres,realtek
scsi_common 16384 4 scsi_mod,sd_mod,libata,sg
usb_common 16384 2 xhci_hcd,usbcore
video 77824 2 amdgpu,radeon
wmi 28672 2 video,wmi_bmof
gpio_amdpt 16384 0
gpio_generic 20480 1 gpio_amdpt
aesni_intel 364544 3
crypto_simd 16384 1 aesni_intel
cryptd 28672 3 crypto_simd,ghash_clmulni_intel
-- /etc/initramfs-tools/modules
dm_raid
mousedev
radeon
-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=auto
KEYMAP=n
COMPRESS=zstd
DEVICE=
NFSROOT=auto
RUNSIZE=10%
FSTYPE=auto
-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no
-- /etc/crypttab
# <target name> <source device> <key file> <options>
#not present c-swap /dev/mapper/vg0-swap /dev/urandom
swap,cipher=aes-cbc-essiv:sha256,size=256,hash=sha256
-- /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10]
unused devices: <none>
-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:
/usr/share/initramfs-tools/hooks:
amd64_microcode
bcachefs
cryptgnupg
cryptgnupg-sc
cryptkeyctl
cryptopensc
cryptpassdev
cryptroot
cryptroot-unlock
dmsetup
fsck
fuse
intel_microcode
keymap
klibc-utils
kmod
lvm2
mdadm
ntfs_3g
resume
thermal
thin-provisioning-tools
udev
xfs
zz-busybox
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.10.11-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled
Versions of packages initramfs-tools depends on:
ii initramfs-tools-core 0.145
ii linux-base 4.10.1
initramfs-tools recommends no packages.
Versions of packages initramfs-tools suggests:
ii bash-completion 1:2.14.0-1
-- Configuration Files:
/etc/initramfs-tools/modules changed:
dm_raid
mousedev
radeon
-- no debconf information
Reply to: