LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-18-2011, 12:47 AM   #1
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Rep: Reputation: Disabled
Possible to delay mdadm startup and fstab mounting?


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.

Last edited by 4Paul4; 10-18-2011 at 01:53 AM.
 
Old 10-18-2011, 07:58 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I don't know how AWS works, but in general Centos terms, take the mdadm mnt out of /etc/fstab.
Edit /etc/rc.local (very last file run by init) and append the attach cmds, followed by the mdadm mnt cmd.
Of course you have to ensure your boot doesn't try to run anything on the mdadm mnt.
You can append that cmd also ...
 
1 members found this post helpful.
Old 10-23-2011, 08:08 PM   #3
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Original Poster
Rep: Reputation: Disabled
Perfect chrism01.

General centOS is exactly what I wanted. That did the trick!

Cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
server startup error: "cannot find / in /etc/fstab or /etc/mtab"; /etc/fstab readonly knee-co Linux - Newbie 8 09-12-2010 05:37 PM
[SOLVED] Ubuntu 10.04 delay mounting network shares in fstab until network is up politik Linux - Networking 14 06-24-2010 07:36 PM
Delay fstab mount of smbfs during boot Iron City Linux - General 7 01-21-2009 02:58 PM
Wireless adapter startup delay Efalunt Linux - Wireless Networking 2 08-21-2006 11:21 AM
why does eth01 fail on startup and delay startup? infantpenguin Linux - Newbie 3 01-28-2005 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration