FS#21255 - [mkinitcpio] md device on usb, timing issue.

Attached to Project: Arch Linux
Opened by Joe Lightning (ZKDLBNHX) - Thursday, 14 October 2010, 19:28 GMT
Last edited by Thomas Bächler (brain0) - Sunday, 27 March 2011, 11:06 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description: I have a usb flash drive raid array for a root partition, and initrd wouldn't mount it simply because it didn't wait long-enough for the usb drives to settle before trying to run mdassemble.

Fixed simply by changing /lib/initcpio/hooks/mdadm to contain:

run_hook ()
{
until [[ -b /dev/disk/by-id/usb-Lexar_USB_Flash_Drive_CSX364JMU89PIS6AERB4-0:0 ]] && [[ -b /dev/disk/by-id/usb-Lexar_USB_Flash_Drive_TG50AKWUNF92TULZRXMG-0:0 ]] && [[ -b /dev/di sleep 1
done
/sbin/mdassemble
}

Obviously this fix is specific to my system but you get the idea.
This task depends upon

Closed by  Thomas Bächler (brain0)
Sunday, 27 March 2011, 11:06 GMT
Reason for closing:  Fixed
Additional comments about closing:  sleep hook, "sleepdevice" kernel parameter.
Comment by Joe Lightning (ZKDLBNHX) - Thursday, 14 October 2010, 19:31 GMT
oops, I pasted the code wrong but there's not edit button, just see here instead: https://bbs.archlinux.org/viewtopic.php?id=105447
Comment by Jan de Groot (JGC) - Thursday, 14 October 2010, 21:22 GMT
Doesn't adding "rootdelay=1" to the kernel boot line fix this for you?
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 14 October 2010, 23:25 GMT
  • Field changed: Summary (mkinitcpio bug → [mkinitcpio] md device on usb, timing issue.)
  • Field changed: Details
  • Field changed: Status (Unconfirmed → Assigned)
  • Task assigned to Thomas Bächler (brain0)
Also there is a "sleep" hook, that may help.
Comment by Thomas Bächler (brain0) - Friday, 15 October 2010, 08:32 GMT
There is no "right way" to fix this, as we do not know explicitly which devices to wait for.

$ mkinitcpio -H sleep
Help for hook 'sleep':
This hook causes the init process to interrupt
for a fixed time interval. The time in seconds
can be specified in the sleeptime= command line
parameter. The default is 5 seconds.
Comment by Dan McGee (toofishes) - Monday, 31 January 2011, 19:11 GMT
How about something like this?
Comment by Thomas Bächler (brain0) - Sunday, 27 February 2011, 11:29 GMT
Just for reference, this (improved) version of the patch is in the git and should allow fixing the issue:
https://projects.archlinux.org/mkinitcpio.git/commit/?id=02e263c5bcec23f9134140dcef5b6f5a4412ed2b

Loading...