I have a CentOS 5 machine with an external 500G USB disk, formatted with JFS. How do I get this to mount automatically at boot time? If I add to /etc/fstab: /dev/sdb1 /var/video jfs defaults 1 2 fsck.jfs complains at boot time: Error: Cannot open device /dev/sdb1 Usage: fsck.jfs ... ... Give root password for maintenance ... If I log in with the root password, /dev/sdb1 is present, and I can run fsck.jfs -f /dev/sdb1 without problems. After ctrl-D it reboots, and gives the above error again. I have to log in as root, remount,rw / and remove the /dev/sdb1 line from /etc/fstab to get it to boot. The problem is not related to JFS; it occurs with an external ext3 file system as well. How do I mount /dev/sdb1 automatically at boot? Mogens -- Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25 Email: mk at crc.dk Homepage: http://www.crc.dk
On 02/04/2010 02:15 PM, Mogens Kjaer wrote: ...> How do I mount /dev/sdb1 automatically at boot?It turns out to be some sort of race condition: If I modify /etc/rc.d/rc.sysinit: ... STRING=$"Checking filesystems" echo $STRING sleep 2 echo ls 1 ls -l /dev/sdb* sleep 1 echo ls 2 ls -l /dev/sdb* sleep 1 echo ls 3 ls -l /dev/sdb* sleep 1 echo ls 4 ls -l /dev/sdb* then I get the following on startup: Checking filesystems ls 1 ls: /dev/sdb*: No such file or directory ls 2 ls: /dev/sdb*: No such file or directory ls 3 brw-r----- 1 root disk 8, 16 Feb 4 14:28 /dev/sdb brw-r----- 1 root disk 8, 17 Feb 4 14:28 /dev/sdb1 ls 4 brw-r----- 1 root disk 8, 16 Feb 4 14:28 /dev/sdb brw-r----- 1 root disk 8, 17 Feb 4 14:28 /dev/sdb1 Then the machine boots normally. I'll add a sleep loop to rc.sysinit that waits until /dev/sdb1 is available, unless someone has a better suggestion? Mogens -- Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25 Email: mk at crc.dk Homepage: http://www.crc.dk
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mogens Kjaer wrote:> > How do I mount /dev/sdb1 automatically at boot? > > Mogens >Try adding 'user' to the 'options' field in /etc/fstab: http://www.tuxfiles.org/linuxhelp/fstab.html - -- - -wittig http://www.robertwittig.com/ http://robertwittig.net/ http://robertwittig.org/ . -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with CentOS - http://enigmail.mozdev.org/ iQEVAwUBS2rZzf9qkhAVPSgqAQIoiwf8Dkmq/PDXToqQJN470lAY/ssky3FukAu5 RTFPfqPolGNXOTorrXIanxWsued7vYT4MexOBeYFPWHl+auaGPawp21OIOWlXVJa NcWjNZIepml+P6WLPeEQMwLQXiv7E03FdImmVyjQm9gUVsrEGXVoBt1GAz9A5L+F W70az7LVA9iO7RTvOua0RdhdKYr1K1lrmefUjQJ6TaN2Ie4Ejf4aV03LTeeUX9Xo u8bYjBBynvM1KK4d2e9O32PU9KW2V85OJF3Jo5nMuHtcBQcJzDE1J7TzNyEIkEne a0+08JhND73yjFqzHjkasiuIYKlDcHbLb7hUtloCXFP0hqz9Qd/TXg==0p4M -----END PGP SIGNATURE-----
There is a kernel option you can give to solve this problem, in /boot/grub/grub.con add to the end of the kernel line: rootdelay Xs where x is the amounty of time to wait before /root is mounted, however this is valid for everything else as well. play with X until you get it right. Jobst On Thu, Feb 04, 2010 at 02:15:25PM +0100, Mogens Kjaer (mk at crc.dk) wrote:> I have a CentOS 5 machine with an external 500G USB disk, > formatted with JFS. > > How do I get this to mount automatically at boot time? > > If I add to /etc/fstab: > > /dev/sdb1 /var/video jfs defaults 1 2 > > fsck.jfs complains at boot time: > > Error: Cannot open device /dev/sdb1 > > Usage: fsck.jfs ... > > ... > > Give root password for maintenance > ... > > If I log in with the root password, /dev/sdb1 > is present, and I can run > > fsck.jfs -f /dev/sdb1 > > without problems. After ctrl-D it reboots, and gives > the above error again. > > I have to log in as root, remount,rw / and remove > the /dev/sdb1 line from /etc/fstab to get it to boot. > > The problem is not related to JFS; it occurs with > an external ext3 file system as well. > > How do I mount /dev/sdb1 automatically at boot? > > Mogens > > -- > Mogens Kjaer, Carlsberg A/S, Computer Department > Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark > Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25 > Email: mk at crc.dk Homepage: http://www.crc.dk > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos-- Diplomacy: The art of saying, "Nice Doggy," until you can find a stick. | |0| | Jobst Schmalenbach, jobst at barrett.com.au, General Manager | | |0| Barrett Consulting Group P/L & The Meditation Room P/L |0|0|0| +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia