PDA

View Full Version : Auto mount of hard disk drive



Mycroft1855
02-27-2003, 03:36 PM
What is the best way to automount any and all hdd? Would it work to just run a script at start up that calls mount several times?

For Example calling this several times:
"mount /dev/hdaX /mnt/hdaX"
with X being the number for the disk.

I want it to work with up to about 10 HDD.

Is there a better way of doing this?

Thanks.

David Douthitt
02-27-2003, 05:23 PM
What is the best way to automount any and all hdd? Would it work to just run a script at start up that calls mount several times?

For Example calling this several times:
"mount /dev/hdaX /mnt/hdaX"
with X being the number for the disk.

I want it to work with up to about 10 HDD.

How about some variant of the following? I believe this is fairly typical:


DRIVES="/dev/hd[a-z][0-9]"

for drv in $DRIVES ; do
if mount $drv /mnt/tmp ; then
umount /mnt/tmp
# mark $drv as successful... do... something...
else
;
# mark $drv as UNsuccessful... oh well..
fi
done