Bug#1060411: initramfs: can't boot bcachefs storage with multi devices
Package: initramfs-tools
Version: 0.142
Severity: minor
X-Debbugs-Cc: antdev66@gmail.com
Dear Maintainer,
I report a problem encountered with initramfs, relating to the new bcachefs
file system.
To test it, I installed a debian/bookwork server, with kernel 6.7 vannilla
recompiled locally and prepared a storage with bcachefs (1 ssd cache + 2 hdd
for replicas):
disk1/ssd: /dev/sda -> /dev/sda1 for esp (LABEL=NEWEFI)
/dev/sda2 for cache bcachefs
(PARTUUID=ea702a10-728b-41d3-a80f-71cbf705dc28)
disk2/hdd: /dev/sdb -> /dev/sdb1 for storage bcachefs
(PARTUUID=679d2cdd-4dca-4707-83a8-0a86c095b345)
disk2/hdd: /dev/sdc -> /dev/sdc1 for storage bcachefs
(PARTUUID=09d070a2-449d-4c31-b214-cb225a0cbbaa)
I formatted it with command:
bcachefs format -LVMTEST --label=ssd.ssd1 /dev/sdb2 --label=hdd.hdd1 /dev/sdc1
--label=hdd.hdd2 /dev/sdd1 --replicas=2 --foreground_target=ssd
--promote_target=ssd --background_target=hdd
and mounted the root in the "/etc/fstab" file by adding the entries (indicating
"partuuid" of each device):
/dev/disk/by-partuuid/ea702a10-728b-41d3-a80f-71cbf705dc28:/dev/disk/by-
partuuid/679d2cdd-4dca-4707-83a8-0a86c095b345:/dev/disk/by-
partuuid/09d070a2-449d-4c31-b214-cb225a0cbbaa / bcachefs defaults,noatime 0
0
LABEL=NEWEFI /boot/efi vfat defaults,noatime 0
0
using systemd loader with this entry:
title NEWTEST
linux /EFI/Linux/vmlinuz
options root=/dev/disk/by-
partuuid/ea702a10-728b-41d3-a80f-71cbf705dc28:/dev/disk/by-
partuuid/679d2cdd-4dca-4707-83a8-0a86c095b345:/dev/disk/by-
partuuid/09d070a2-449d-4c31-b214-cb225a0cbbaa rootfstype=bcachefs quiet
nosplash vga=791 noresume
initrd /EFI/Linux/initrd.img
This didn't work.
The problem is in the file "/usr/share/initramfs-tools/scripts/functions" and
depends on the "get_fstype" and "resolve_device" functions that cannot locate
or determine the file system (since bcachefs uses the form
device:device:device).
I managed to get it working by modifying these functions (see below)
Of course this is only a test, I just wanted to let you know about the issues
I've encountered.
Thanks,
Antonio
---- SIMPLE PATCH:
--- /usr/share/initramfs-tools/scripts/functions 2023-10-04
07:43:51.432542921 +0200
+++ /desktop/functions 2024-01-10 20:52:19.103154941 +0100
@@ -198,6 +198,12 @@
# Return value: indicates if an fs could be recognized
get_fstype ()
{
+ if [ "$ROOTFSTYPE" == "bcachefs" ]; then
+ FSTYPE="$ROOTFSTYPE"
+ echo "$ROOTFSTYPE"
+ return 0
+ fi
+
local FS FSTYPE
FS="${1}"
@@ -429,12 +435,16 @@
resolve_device() {
DEV="$1"
- case "$DEV" in
- LABEL=* | UUID=* | PARTLABEL=* | PARTUUID=*)
- DEV="$(blkid -l -t "$DEV" -o device)" || return 1
- ;;
- esac
- [ -e "$DEV" ] && echo "$DEV"
+ if [ "$ROOTFSTYPE" != "bcachefs" ]; then
+ case "$DEV" in
+ LABEL=* | UUID=* | PARTLABEL=* | PARTUUID=*)
+ DEV="$(blkid -l -t "$DEV" -o device)" || return 1
+ ;;
+ esac
+ [ -e "$DEV" ] && echo "$DEV"
+ else
+ echo "$DEV"
+ fi
}
# Check a file system.
-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 63M Jan 8 19:04 /boot/initrd.img-6.6.10-3-liquorix-amd64
-- /proc/cmdline
audit=0 intel_pstate=disable rcupdate.rcu_expedited=1 initrd=\EFI\Linux\initrd.img root=LABEL=DEBIAN quiet nosplash vga=791 resume=LABEL=SWAP postazione=sat selinux=0
-- /proc/filesystems
cramfs
ext3
ext2
ext4
xfs
btrfs
nilfs2
jfs
f2fs
fuseblk
vfat
-- lsmod
Module Size Used by
snd_seq_dummy 12288 0
snd_hrtimer 12288 1
rfcomm 69632 18
cmac 12288 3
algif_hash 12288 1
algif_skcipher 12288 1
af_alg 32768 6 algif_hash,algif_skcipher
qrtr 53248 4
bnep 20480 2
sunrpc 835584 1
nls_utf8 12288 1
nls_cp437 16384 1
vfat 20480 1
fat 98304 1 vfat
snd_hda_codec_hdmi 86016 1
snd_hda_codec_realtek 200704 1
snd_hda_codec_generic 114688 1 snd_hda_codec_realtek
rc_total_media_in_hand_02 12288 0
si2157 16384 1
si2168 16384 1
snd_sof_pci_intel_tgl 12288 0
snd_sof_intel_hda_common 192512 1 snd_sof_pci_intel_tgl
snd_soc_hdac_hda 20480 1 snd_sof_intel_hda_common
soundwire_intel 57344 1 snd_sof_intel_hda_common
snd_sof_intel_hda_mlink 32768 2 soundwire_intel,snd_sof_intel_hda_common
soundwire_cadence 40960 1 soundwire_intel
snd_sof_intel_hda 16384 1 snd_sof_intel_hda_common
snd_sof_pci 20480 2 snd_sof_intel_hda_common,snd_sof_pci_intel_tgl
snd_sof_xtensa_dsp 12288 1 snd_sof_intel_hda_common
intel_rapl_msr 12288 0
snd_sof 315392 3 snd_sof_pci,snd_sof_intel_hda_common,snd_sof_intel_hda
intel_rapl_common 28672 1 intel_rapl_msr
intel_uncore_frequency 12288 0
intel_uncore_frequency_common 16384 1 intel_uncore_frequency
snd_sof_utils 12288 1 snd_sof
snd_hda_ext_core 32768 4 snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda_mlink,snd_sof_intel_hda
intel_tcc_cooling 12288 0
snd_soc_acpi_intel_match 94208 2 snd_sof_intel_hda_common,snd_sof_pci_intel_tgl
iwlmvm 569344 0
x86_pkg_temp_thermal 12288 0
snd_soc_acpi 12288 2 snd_soc_acpi_intel_match,snd_sof_intel_hda_common
intel_powerclamp 16384 0
soundwire_generic_allocation 12288 1 soundwire_intel
i915 4206592 42
snd_soc_core 417792 4 soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hda
dvb_usb_dvbsky 24576 0
snd_compress 20480 1 snd_soc_core
mac80211 1400832 1 iwlmvm
ac97_bus 12288 1 snd_soc_core
dvb_usb_v2 28672 1 dvb_usb_dvbsky
snd_pcm_dmaengine 16384 1 snd_soc_core
m88ds3103 32768 1 dvb_usb_dvbsky
kvm_intel 421888 0
uniwill_wmi 12288 0
dvb_core 172032 2 dvb_usb_v2,dvb_usb_dvbsky
drm_buddy 20480 1 i915
snd_hda_intel 53248 1
tuxedo_keyboard 65536 1 uniwill_wmi
i2c_algo_bit 16384 1 i915
btusb 73728 0
libarc4 12288 1 mac80211
ttm 106496 1 i915
led_class_multicolor 16384 1 tuxedo_keyboard
snd_intel_dspcfg 32768 3 snd_hda_intel,snd_sof,snd_sof_intel_hda_common
videobuf2_vmalloc 12288 1 dvb_core
btrtl 28672 1 btusb
eeepc_wmi 12288 0
snd_intel_sdw_acpi 12288 2 snd_sof_intel_hda_common,snd_intel_dspcfg
kvm 1421312 1 kvm_intel
videobuf2_memops 12288 1 videobuf2_vmalloc
drm_display_helper 237568 1 i915
snd_usb_audio 417792 1
iwlwifi 425984 1 iwlmvm
btintel 53248 1 btusb
asus_wmi 98304 1 eeepc_wmi
snd_hda_codec 212992 6 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda,snd_sof_intel_hda
videobuf2_common 77824 3 videobuf2_vmalloc,dvb_core,videobuf2_memops
btbcm 24576 1 btusb
spi_nor 135168 0
cec 102400 2 drm_display_helper,i915
btmtk 12288 1 btusb
pmt_telemetry 12288 0
ledtrig_audio 12288 2 snd_hda_codec_generic,asus_wmi
snd_usbmidi_lib 45056 1 snd_usb_audio
i2c_mux 12288 2 m88ds3103,si2168
pmt_class 12288 1 pmt_telemetry
sparse_keymap 12288 2 asus_wmi,tuxedo_keyboard
snd_hda_core 143360 9 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
snd_ump 28672 1 snd_usb_audio
rc_core 61440 5 dvb_usb_v2,rc_total_media_in_hand_02,cec,dvb_usb_dvbsky
platform_profile 12288 1 asus_wmi
irqbypass 12288 1 kvm
acpi_cpufreq 20480 0
mtd 98304 2 spi_nor
wmi_bmof 12288 0
bluetooth 868352 44 btrtl,btmtk,btintel,btbcm,bnep,btusb,rfcomm
drm_kms_helper 258048 2 drm_display_helper,i915
snd_hwdep 16384 2 snd_usb_audio,snd_hda_codec
cfg80211 1314816 3 iwlmvm,iwlwifi,mac80211
snd_rawmidi 49152 2 snd_usbmidi_lib,snd_ump
intel_gtt 24576 1 i915
mei_hdcp 16384 0
ecdh_generic 16384 2 bluetooth
mei_pxp 12288 0
mc 73728 5 si2157,snd_usb_audio,dvb_usb_v2,dvb_core,videobuf2_common
agpgart 49152 2 intel_gtt,ttm
intel_vsec 12288 0
tpm_crb 16384 0
mousedev 24576 0
tpm_tis 12288 0
tpm_tis_core 32768 1 tpm_tis
acpi_tad 20480 0
acpi_pad 20480 0
sg 49152 0
nct6775 36864 0
nct6775_core 81920 1 nct6775
hwmon_vid 12288 1 nct6775
coretemp 20480 0
sky2 94208 0
skge 65536 0
snd_seq 118784 7 snd_seq_dummy
snd_seq_device 16384 3 snd_seq,snd_ump,snd_rawmidi
tun 69632 0
hso 57344 0
rfkill 40960 12 iwlmvm,asus_wmi,bluetooth,hso,cfg80211
option 57344 0
usb_wwan 20480 1 option
usbserial 57344 2 usb_wwan,option
af_packet 61440 6
joydev 20480 0
yenta_socket 36864 0
pcmcia_rsrc 28672 1 yenta_socket
pcmcia_core 36864 2 pcmcia_rsrc,yenta_socket
snd_aloop 40960 1
snd_pcm 204800 13 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_compress,snd_soc_core,snd_sof_utils,snd_aloop,snd_hda_core,snd_pcm_dmaengine
snd_timer 45056 4 snd_seq,snd_hrtimer,snd_aloop,snd_pcm
snd 143360 26 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_hda_codec_realtek,snd_sof,snd_timer,snd_compress,snd_soc_core,snd_aloop,snd_ump,snd_pcm,snd_rawmidi
soundcore 16384 1 snd
sbs 16384 0
sbshc 16384 1 sbs
serio_raw 12288 0
psmouse 204800 0
ata_piix 45056 0
ata_generic 12288 0
e1000e 311296 0
e1000 155648 0
mptspi 28672 0
scsi_transport_spi 45056 1 mptspi
mptscsih 45056 1 mptspi
mptbase 106496 2 mptspi,mptscsih
msr 12288 0
ecryptfs 135168 0
parport_pc 53248 0
ppdev 16384 0
lp 24576 0
parport 61440 3 parport_pc,lp,ppdev
dm_crypt 61440 0
encrypted_keys 24576 2 ecryptfs,dm_crypt
trusted 36864 2 encrypted_keys,dm_crypt
asn1_encoder 12288 1 trusted
tee 49152 1 trusted
drm 823296 24 drm_kms_helper,drm_display_helper,drm_buddy,i915,ttm
nvme_fabrics 24576 0
fuse 192512 3
efi_pstore 12288 0
nfnetlink 20480 1
zram 45056 2
tpm 102400 4 tpm_tis,trusted,tpm_crb,tpm_tis_core
dmi_sysfs 16384 0
ip_tables 32768 0
x_tables 57344 1 ip_tables
sr_mod 28672 0
cdrom 49152 1 sr_mod
hid_logitech_hidpp 49152 0
hid_logitech_dj 32768 0
uas 28672 0
usbhid 61440 2 hid_logitech_dj,hid_logitech_hidpp
raid10 73728 0
raid0 20480 0
multipath 12288 0
linear 16384 0
usb_storage 81920 1 uas
f2fs 999424 0
crc32_generic 12288 0
jfs 245760 0
nls_ucs2_utils 8192 1 jfs
nilfs2 348160 0
btrfs 2134016 0
blake2b_generic 20480 0
nbd 61440 0
xfs 3088384 0
ext4 1146880 10
crc16 12288 2 bluetooth,ext4
mbcache 16384 1 ext4
jbd2 196608 1 ext4
loop 32768 0
raid1 57344 1
dm_raid 49152 1
raid456 176128 1 dm_raid
async_raid6_recov 16384 1 raid456
async_memcpy 12288 2 raid456,async_raid6_recov
async_pq 12288 2 raid456,async_raid6_recov
async_xor 16384 3 async_pq,raid456,async_raid6_recov
async_tx 12288 5 async_pq,async_memcpy,async_xor,raid456,async_raid6_recov
md_mod 221184 7 raid1,dm_raid,raid10,raid0,linear,raid456,multipath
xor 20480 2 async_xor,btrfs
raid6_pq 122880 4 async_pq,btrfs,raid456,async_raid6_recov
libcrc32c 12288 3 btrfs,xfs,raid456
crc32c_generic 12288 0
dm_mod 200704 58 dm_raid,dm_crypt
i2c_designware_platform 16384 0
ccp 131072 1 i2c_designware_platform
rng_core 20480 2 ccp,tpm
i2c_designware_core 32768 1 i2c_designware_platform
crct10dif_pclmul 12288 1
crc32_pclmul 12288 0
crc32c_intel 16384 21
polyval_clmulni 12288 0
polyval_generic 12288 1 polyval_clmulni
ghash_clmulni_intel 16384 0
sha512_ssse3 53248 0
sha256_ssse3 36864 1
sha1_ssse3 32768 0
aesni_intel 360448 4
crypto_simd 16384 1 aesni_intel
cryptd 32768 3 crypto_simd,ghash_clmulni_intel
spi_intel_pci 12288 0
igc 192512 0
spi_intel 20480 1 spi_intel_pci
intel_lpss_pci 24576 0
intel_lpss 12288 1 intel_lpss_pci
xhci_pci 20480 0
idma64 16384 0
xhci_pci_renesas 12288 1 xhci_pci
vmd 20480 0
video 69632 2 asus_wmi,i915
wmi 32768 4 video,uniwill_wmi,asus_wmi,wmi_bmof
pinctrl_alderlake 32768 0
-- /etc/initramfs-tools/modules
loop
ext4
xfs
nbd
btrfs
nilfs2
jfs
f2fs
bcachefs
usb_storage
-- /etc/kernel-img.conf
# Kernel Image management overrides
# See kernel-img.conf(5) for details
do_symlinks = No
do_bootloader = No
do_initrd = Yes
link_in_boot = No
-- /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>
#secret-prova /dev/system/prova /home/root/.hwkey keyfile-timeout=10s,cipher=aes-cbc-essiv:sha256
-- /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid1] [linear] [multipath] [raid0] [raid10]
unused devices: <none>
-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:
/usr/share/initramfs-tools/hooks:
amd64_microcode
bcache
bcachefs
btrfs
cryptgnupg
cryptgnupg-sc
cryptkeyctl
cryptopensc
cryptpassdev
cryptroot
cryptroot-unlock
dmsetup
file-complementari
fsck
fuse
intel_microcode
keymap
klibc-utils
kmod
lvm2
lvm2-patch
mdadm
nbd
nbd-client
ntfs_3g
reiserfsprogs
resume
thermal
thin-provisioning-tools
udev
xfs
yubikey-luks
zz-busybox
-- System Information:
Debian Release: trixie/sid
APT prefers unstable
APT policy: (700, 'unstable'), (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable'), (100, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.6.10-3-liquorix-amd64 (SMP w/24 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE=it
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages initramfs-tools depends on:
ii initramfs-tools-core 0.142
ii linux-base 4.9
initramfs-tools recommends no packages.
Versions of packages initramfs-tools suggests:
pn bash-completion <none>
-- no debconf information
Reply to: