I am wondering if there is a way to delay the assembly attempt of my /dev/md0 array on startup, and if it's possible to delay the mounting of /dev/md0 -> /vol.
I am using aws and doing something a little niche in attaching a 6 drive stripe to my instance on bootup. The problem is that it starts up too quickly!
My script does the following in sequence:
Launch Instance
Assosiate IP
#Wait for instance to become 'running' instead of 'initialising using a while loop
Attach drive 1
Attach drive 2
Attach drive 3
Attach drive 4
Attach drive 5
Attach drive 6
By the time drive6 has attached, it is already too late. mdadm has attempted to build the array just after drive 2 got attached and failed:
Code:
Welcome to CentOS release 5.4 (Final)
Press 'I' to enter interactive startup.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Setting clock : Tue Oct 18 01:29:26 EDT 2011 [ OK ]
Starting udev: [ OK ]
Setting hostname localhost.localdomain: [ OK ]
mdadm: /dev/md0 assembled from 2 drives - not enough to start the array.
And subsequently, mounting /dev/md0 using fstab has failed:
Code:
Mounting local filesystems: mount: wrong fs type, bad option, bad superblock on /dev/md0,
missing codepage or other error
(could this be the IDE device where you in fact use
ide-scsi so that sr0 or sda or so is needed?)
In some cases useful info is found in syslog - try
dmesg | tail or so
If I could access GRUB, I would simply apply a delay to the bootup, but I am unable to access grub in AWS. Is there another way to delay the boot process by about 10 seconds?
Alternatively (but less preferably), is there a way to run these 6
Code:
ec2-attach-volume $i -i $vol
commands in parallel in bash? This might work but it's not ideal.
Currently my work around is to reboot the instance as soon as it comes up which then mounts everything correctly.
EDIT:
I modified my script to use subshells (prevent the wait for each command to finish and the error code to be presesented) which sped it up but not enough.
Code:
Welcome to CentOS release 5.4 (Final)
Press 'I' to enter interactive startup.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Setting clock : Tue Oct 18 02:36:22 EDT 2011 [ OK ]
Starting udev: [ OK ]
Setting hostname localhost.localdomain: [ OK ]
mdadm: /dev/md0 assembled from 3 drives - not enough to start the array.
It seems I need a way to delay this startup. It beats my other option which is to script a reboot after all the devices are attached lol.