FS#42350 - [mkinitcpio] Wrong order of hooks in default mkinitcpio.conf configuration

Attached to Project: Arch Linux
Opened by Ignacio (ignaci0) - Monday, 13 October 2014, 03:12 GMT
Last edited by Toolybird (Toolybird) - Saturday, 05 August 2023, 21:53 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Hi,

Today, after installing an Arch on a USB key got an error trying to boot it. The error description told something like "root device <UUID> not found". There's nothing wrong with the error though made not sense.

I've double checked the hook /block/ were in the mkinitcpio.conf and the configuration looked fine.

After seeking for solution, I've found that the order of the hooks is quite important. The block hook must be _before_ the autodetect for making the root fs to work (at least from a usb key).

Therefore, the error report would be the order of the default configuration of the HOOKS provided by the packages is incorrect.

Best regards,
Ignacio


Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 05 August 2023, 21:53 GMT
Reason for closing:  Fixed
Additional comments about closing:  @nl6720 "Old bug that is likely not relevant anymore. If the bug still exists, a new issue should be created in gitlab.archlinux.org."
Comment by Dave Reisner (falconindy) - Monday, 13 October 2014, 12:50 GMT
No, the order is fine. What you describe sounds like a failure in the block or autodetect hook.

What module(s) does your USB drive require?
Comment by Dave Reisner (falconindy) - Friday, 24 October 2014, 13:17 GMT
Ping?
Comment by Ignacio (ignaci0) - Friday, 24 October 2014, 14:17 GMT
Hi, Sorry I haven't updated. I've been just busy and couldn't work in this computer.

I'll try to update it during weekend.

The device is a quite generic sandisk pendrive btw.

Regards,
Comment by Ignacio (ignaci0) - Saturday, 25 October 2014, 14:55 GMT
Hi, find attached mods and usb connected.

Hope it helps. Let me know whether further information is required.

And sorry for the late response.

Regards,
ignacio
   lsmod (3.2 KiB)
   lsusb (15 KiB)
Comment by Dave Reisner (falconindy) - Saturday, 25 October 2014, 15:34 GMT
This seems like a dupe of  FS#41273 . What's the output of 'mkinitcpio -M'? It would also be useful to have the output of 'lsinitcpio -a' on the image created with the default hook ordering.
Comment by Ignacio (ignaci0) - Sunday, 26 October 2014, 14:39 GMT
Hi,

I don't know what difference does it make. This output is with the /correct/ order of the hooks, with the same machine already booted.

The problem ocurrs when the ram image is being loaded.

# mkinitcpio -M
==> Modules autodetected
ac
acpi_cpufreq
ahci
ath5k
atkbd
battery
button
coretemp
ehci_pci
evdev
ext4
gpio_ich
i2c_i801
i8042
i915
intel_agp
intel_powerclamp
intel_rng
iTCO_wdt
leds_ss4200
lpc_ich
mac_hid
microcode
mousedev
msi_wmi
pcspkr
processor
psmouse
r8169
sd_mod
serio_raw
shpchp
snd_hda_intel
thermal
uas
uhci_hcd
ums_realtek
usbcore
usb_storage
video
wmi

Best regards,
Ignacio
Comment by Ignacio (ignaci0) - Sunday, 26 October 2014, 14:46 GMT
I've recreated the default image. This is the output of the lsinitcpio:

[root@messiah boot]# lsinitcpio -a initramfs-linux.img
==> Image: initramfs-linux.img
==> Created with mkinitcpio 18
==> Kernel: 3.16.4-1-ARCH
==> Size: 7.97 MiB
==> Compressed with: gzip
-> Uncompressed size: 19.73 MiB (.404 ratio)
-> Estimated extraction time: 0.558s

==> Included modules:
9p crc-t10dif jfs nilfs2 scsi_mod
9pnet crct10dif_common kafs nls_cp437 sctp
affs cuse libahci nls_iso8859-1 sd_mod
af-rxrpc dlm libata ntfs serio
ahci dns_resolver libceph objlayoutdriver squashfs
async_pq ecryptfs libcrc32c ocfs2 sr_mod
async_tx ehci-hcd libore ocfs2_dlm sunrpc
async_xor ehci-pci libosd ocfs2_dlmfs tpm
atkbd encrypted-keys libps2 ocfs2_nodemanager trusted
auth_rpcgss exofs lockd ocfs2_stackglue uas
befs ext4 logfs ocfs2_stack_o2cb ubi
blocklayoutdriver f2fs mbcache ocfs2_stack_user ubifs
btrfs fat minix oid_registry udf
cachefiles fscache msdos omfs ufs
cdrom fuse mtd osd uhci-hcd
ceph gfs2 ncpfs quota_tree ums-realtek
cifs hfs nfs quota_v1 usb-common
coda hfsplus nfs_acl quota_v2 usbcore
cramfs hid nfsd raid6_pq usbhid
crc16 i8042 nfs_layout_nfsv41_files ramoops usb-storage
crc32c_generic isofs nfsv2 reed_solomon vfat
crc32c-intel jbd2 nfsv3 reiserfs xfs
crc-itu-t jffs2 nfsv4 romfs xor

==> Included binaries:
blkid fsck kmod switch_root udevadm
busybox fsck.ext4 mount systemd-tmpfiles

==> Early hook run order:
udev

==> Hook run order:
udev

==> Cleanup hook run order:
udev

Rolling back to my working image, what I get is:

[root@messiah boot]# lsinitcpio -a initramfs-linux.img
==> Image: initramfs-linux.img
==> Created with mkinitcpio 18
==> Kernel: 3.16.4-1-ARCH
==> Size: 15.13 MiB
==> Compressed with: gzip
-> Uncompressed size: 36.56 MiB (.413 ratio)
-> Estimated extraction time: 1.038s

==> Included modules:
3w-9xxx fat mptsas pata_rdc smsmdtv
3w-sas fcoe mptscsih pata_rz1000 smssdio
3w-xxxx fdomain mptspi pata_sc1200 squashfs
9p fdomain_cs msdos pata_sch sr_mod
9pnet firewire-core mtd pata_serverworks st
9pnet_virtio firewire-net mtip32xx pata_sil680 stex
a100u2w firewire-ohci mvsas pata_sis sunrpc
aacraid firewire-sbp2 mvumi pata_sl82c105 sx8
advansys floppy nbd pata_triflex sym53c416
affs fnic ncpfs pata_via sym53c500_cs
af-rxrpc fscache NCR53c406a pcmcia sym53c8xx
aha152x ftdi-elan nfs pcmcia_core t128
aha152x_cs fusbh200-hcd nfs_acl pdc_adma target_core_mod
aha1542 fuse nfsd pktcdvd tcm_qla2xxx
ahci gdth nfs_layout_nfsv41_files pm80xx tifm_7xx1
ahci_platform gfs2 nfsv2 pmcraid tifm_core
aic79xx g_NCR5380 nfsv3 ppa tifm_ms
aic7xxx g_NCR5380_mmio nfsv4 qla1280 tifm_sd
aic94xx hfs nilfs2 qla2xxx tmscsim
aoe hfsplus nls_cp437 qla4xxx tpm
arcmsr hid nls_iso8859-1 qlogic_cs trusted
async_pq hpsa nosy qlogicfas u132-hcd
async_tx hptiop nsp32 qlogicfas408 u14-34f
async_xor hv_storvsc nsp_cs quota_tree uas
ata_generic hv_vmbus ntfs quota_v1 ubi
ata_piix hwa-hc nvme quota_v2 ubifs
atkbd i8042 objlayoutdriver r8a66597-hcd udf
atp870u imm ocfs2 raid6_pq ufs
auth_rpcgss in2000 ocfs2_dlm raid_class ufshcd
be2iscsi initio ocfs2_dlmfs ramoops ufshcd-pci
befs ipr ocfs2_nodemanager rbd ufshcd-pltfrm
bfa ips ocfs2_stackglue rc-core uhci-hcd
blocklayoutdriver isci ocfs2_stack_o2cb reed_solomon uio
bnx2fc iscsi_boot_sysfs ocfs2_stack_user reiserfs ultrastor
bnx2i iscsi_tcp ohci-hcd rng-core umc
brd isofs ohci-pci romfs ums-alauda
btrfs isp116x-hcd oid_registry rsxx ums-cypress
BusLogic isp1362-hcd omfs rtsx_pci ums-datafab
cachefiles isp1760 osd rtsx_pci_sdmmc ums-eneub6250
caif_virtio jbd2 osdblk rtsx_usb ums-freecom
cb710 jffs2 osst rtsx_usb_sdmmc ums-isd200
cb710-mmc jfs oxu210hp-hcd sata_inic162x ums-jumpshot
cciss kafs parport sata_mv ums-karma
cdrom led-class pas16 sata_nv ums-onetouch
ceph libahci pata_acpi sata_promise ums-realtek
ch libahci_platform pata_ali sata_qstor ums-sddr09
cifs libata pata_amd sata_sil ums-sddr55
cnic libceph pata_artop sata_sil24 ums-usbat
coda libcrc32c pata_atiixp sata_sis usb-common
cramfs libcxgbi pata_atp867x sata_svw usbcore
crc16 libfc pata_cmd640 sata_sx4 usbhid
crc32c_generic libfcoe pata_cmd64x sata_uli usb-storage
crc32c-intel libiscsi pata_cs5520 sata_via usdhi6rol0
crc-itu-t libiscsi_tcp pata_cs5530 sata_vsc ushc
crc-t10dif libore pata_cs5535 scsi_dh uwb
crct10dif_common libosd pata_cs5536 scsi_dh_alua vfat
cryptoloop libps2 pata_cypress scsi_dh_emc via-sdmmc
csiostor libsas pata_efar scsi_dh_hp_sw virtio
cuse libsrp pata_hpt366 scsi_dh_rdac virtio_balloon
cxgb3 lockd pata_hpt37x scsi_mod virtio_blk
cxgb3i logfs pata_hpt3x2n scsi_tgt virtio_console
cxgb4 loop pata_hpt3x3 scsi_transport_fc virtio_mmio
cxgb4i lpfc pata_isapnp scsi_transport_iscsi virtio_net
DAC960 lru_cache pata_it8213 scsi_transport_sas virtio_pci
dc395x lz4_compress pata_it821x scsi_transport_spi virtio_ring
dlm max3421-hcd pata_jmicron scsi_transport_srp virtio-rng
dmx3191d mbcache pata_legacy sctp virtio_scsi
dns_resolver mdio pata_marvell sdhci vmw_pvscsi
dpt_i2o megaraid pata_mpiix sdhci-acpi vringh
drbd megaraid_mbox pata_netcell sdhci-of-arasan vub300
dtc megaraid_mm pata_ninja32 sdhci-pci wbsd
eata megaraid_sas pata_ns87410 sdhci-pltfm wd7000
ecryptfs memstick pata_ns87415 sdhci-pxav2 whci
ehci-hcd minix pata_oldpiix sdhci-pxav3 whci-hcd
ehci-pci mmc_block pata_opti sdio_uart wusbcore
enclosure mmc_core pata_optidma sd_mod wusb-wa
encrypted-keys mpt2sas pata_pcmcia sdricoh_cs xfs
esas2r mpt3sas pata_pdc2027x serio xhci-hcd
exofs mptbase pata_pdc202xx_old ses xor
ext4 mptctl pata_piccolo sg zram
f2fs mptfc pata_radisys sl811-hcd

==> Included binaries:
blkid fsck kmod switch_root udevadm
busybox fsck.ext4 mount systemd-tmpfiles

==> Early hook run order:
udev

==> Hook run order:
udev

==> Cleanup hook run order:
udev


Clearly, there's a difference between both of them. The working image is twice the size of the not working one.

Best regards,
Ignacio
Comment by Dave Reisner (falconindy) - Sunday, 26 October 2014, 15:08 GMT
> Clearly, there's a difference between both of them. The working image is twice the size of the not working one.
No shit. autodetect isn't applying to the block hook in your working image meaning that all block modules are added, rather than according to a whitelist. The whole goal of this exercise is to figure out what module isn't being included by the autodetect hook. You don't need the entirety of the block hook to boot.

Since you can't seem to figure out what module this uses, what else can you tell me about this USB device? make, model. 'udevadm info /dev/...'
Comment by Ignacio (ignaci0) - Sunday, 26 October 2014, 15:11 GMT
Anything you need:

# udevadm info /dev/sda
P: /devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2:1.0/host4/target4:0:0/4:0:0:0/block/sda
N: sda
S: disk/by-id/usb-SanDisk_Cruzer_Pop_4C532000051104108573-0:0
S: disk/by-path/pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0
E: DEVLINKS=/dev/disk/by-id/usb-SanDisk_Cruzer_Pop_4C532000051104108573-0:0 /dev/disk/by-path/pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0
E: DEVNAME=/dev/sda
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2:1.0/host4/target4:0:0/4:0:0:0/block/sda
E: DEVTYPE=disk
E: ID_BUS=usb
E: ID_INSTANCE=0:0
E: ID_MODEL=Cruzer_Pop
E: ID_MODEL_ENC=Cruzer\x20Pop\x20\x20\x20\x20\x20\x20
E: ID_MODEL_ID=5577
E: ID_PART_TABLE_TYPE=dos
E: ID_PATH=pci-0000:00:1d.7-usb-0:2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_00_1d_7-usb-0_2_1_0-scsi-0_0_0_0
E: ID_REVISION=1.26
E: ID_SERIAL=SanDisk_Cruzer_Pop_4C532000051104108573-0:0
E: ID_SERIAL_SHORT=4C532000051104108573
E: ID_TYPE=disk
E: ID_USB_DRIVER=usb-storage
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=SanDisk
E: ID_VENDOR_ENC=SanDisk\x20
E: ID_VENDOR_ID=0781
E: MAJOR=8
E: MINOR=0
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=45026


Regards,
Ignacio
Comment by Ignacio (ignaci0) - Saturday, 01 November 2014, 13:14 GMT
(dup by misstake)
   lsmod (3.2 KiB)
   lsusb (15 KiB)
Comment by Javier Viñal (fjvinal) - Tuesday, 11 August 2015, 13:37 GMT
I have the same problem when booting from a USB 3.0 device attached to a USB 3.0 port. No problem with the same USB stick attached to a USB 2.0 port.

udevadm info /dev/sdb
P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/host6/target6:0:0/6:0:0:0/block/sdb
N: sdb
S: disk/by-id/usb-Kingston_DataTraveler_3.0_60A44C3FAD9EFE51198E0051-0:0
S: disk/by-path/pci-0000:00:1a.0-usb-0:1.4:1.0-scsi-0:0:0:0
E: DEVLINKS=/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_60A44C3FAD9EFE51198E0051-0:0 /dev/disk/by-path/pci-0000:00:1a.0-usb-0:1.4:1.0-scsi-0:0:0:0
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/host6/target6:0:0/6:0:0:0/block/sdb
E: DEVTYPE=disk
E: ID_BUS=usb
E: ID_DRIVE_THUMB=1
E: ID_INSTANCE=0:0
E: ID_MODEL=DataTraveler_3.0
E: ID_MODEL_ENC=DataTraveler\x203.0
E: ID_MODEL_ID=1666
E: ID_PART_TABLE_TYPE=gpt
E: ID_PART_TABLE_UUID=11313cfa-4cdc-4c71-808f-a721adb73236
E: ID_PATH=pci-0000:00:1a.0-usb-0:1.4:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1_4_1_0-scsi-0_0_0_0
E: ID_REVISION=1.00
E: ID_SERIAL=Kingston_DataTraveler_3.0_60A44C3FAD9EFE51198E0051-0:0
E: ID_SERIAL_SHORT=60A44C3FAD9EFE51198E0051
E: ID_TYPE=disk
E: ID_USB_DRIVER=usb-storage
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Kingston
E: ID_VENDOR_ENC=Kingston
E: ID_VENDOR_ID=0951
E: MAJOR=8
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=12831127
Comment by Javier Viñal (fjvinal) - Tuesday, 11 August 2015, 13:48 GMT
This issue went worse since last kernel update (4.1.4-1-ARCH). Before, it could be overraided adding xhci_pci and xhci_hcd to the MODULES list of mkinitcpio.conf
Comment by Dave Reisner (falconindy) - Tuesday, 11 August 2015, 13:55 GMT
> Before, it could be overraided adding xhci_pci and xhci_hcd to the MODULES list of mkinitcpio.conf
And now? I'm not sure what you're suggesting has changed. If xhci_hcd/xhci_pci aren't in your initramfs, you shouldn't expect working USB 3.0 ports in your initramfs. If you use autodetect and these xhci modules aren't loaded at the time of initramfs generation, then they will not be added. This is working as intended.
Comment by Javier Viñal (fjvinal) - Tuesday, 11 August 2015, 15:03 GMT
It is not problem of autodetect. The situation is exactly the same with the fallback syslinux entry (I forgot to explain that). The system does not boot with my USB 3.0 stick attached to a USB 3.0 port anymore. The usb root partition (btrfs) is not detected at boot.
Comment by Dave Reisner (falconindy) - Tuesday, 11 August 2015, 15:10 GMT
Then your problem is unrelated to this bug...

Loading...