[CentOS] Mount USB disk at startup?

Eero Volotinen eero.volotinen at iki.fi
Thu Feb 4 13:41:46 UTC 2010


2010/2/4 Mogens Kjaer <mk at 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?

how about mounting that drive on rc.local ?

--
Eero


More information about the CentOS mailing list