Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Mount all partions in fstab< Next Oldest | Next Newest >
henk1955 Offline





Group: Members
Posts: 249
Joined: June 2004
Posted: Jan. 11 2005,08:50 QUOTE

It is easy to mount all partions at startup.
just add
Code Sample
echo "Fix-fstab ..."
/opt/fix-fstab.sh

echo "Mount all ..."
mount -a
to /opt/bootlocal.sh
there is one little problem, if you use a frugal or poormans install you should NOT mount the device mounted on /cdrom often this is /dev/sda1. ( it interferes with backup/restore). Therefor i made a script /opt/fix-fstab.sh that removes the dangerous line from fstab
Code Sample
#!/bin/bash


FSTAB=/etc/fstab
TMPDIR=/home/dsl

# change noauto, to auto, mount for use of mount -a

sed 's/ noauto,/ auto,/g' $FSTAB >$TMPDIR/fstab.1


# double mount of /cdrom will make filetool.sh backup fail
# to prevent the double mount of the /cdrom
# find the device for mointpoint /cdrom

MOUNTPOINT="$(grep -i /cdrom\   /etc/mtab|awk '{print $1}')"

#this is the line we will remove

REMLINE="$(grep -i $MOUNTPOINT $TMPDIR/fstab.1)"

# copy all lines we want to keep

grep -v $MOUNTPOINT $TMPDIR/fstab.1 >$TMPDIR/fstab.2

# tell wich line we removed
echo "#Removed by /opt/fix-fstab" >>$TMPDIR/fstab.2
echo "#$REMLINE" >>$TMPDIR/fstab.2

cp -f $TMPDIR/fstab.2 $FSTAB


dont forget to add it to filetool.lst


--------------
You have a Q or just want to chat?
Come to #damnsmalllinux on irc.freenode.net!
Open 24/7

dell latitude c640 p4@1.6Ghz 256Mb DSL0.9.1-remaster
asus p4p800-vm p4@2.8Ghz HT / celeron@2.4Ghz 512Mb DSL0.9.1-remaster (alsadebs.dsl)
ABit BE6 celeron@466 256Mb DSL0.9.1-remaster (xawtv)
Back to top
Profile PM WEB MSN 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Jan. 11 2005,14:48 QUOTE

Good idea.  I wonder about other disks, though, such as floppys and other removable media....wouldn't you get errors with these?

How about a single line....
for i in /dev/hda{3,4} /dev/sda1; do mount $i; done

Of course, you'd have to edit it to use your own devices.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
henk1955 Offline





Group: Members
Posts: 249
Joined: June 2004
Posted: Jan. 11 2005,15:02 QUOTE

the script skips the cdrom and floppy.
the script is generic and can be used withouth change on computers with other disk configuraties


--------------
You have a Q or just want to chat?
Come to #damnsmalllinux on irc.freenode.net!
Open 24/7

dell latitude c640 p4@1.6Ghz 256Mb DSL0.9.1-remaster
asus p4p800-vm p4@2.8Ghz HT / celeron@2.4Ghz 512Mb DSL0.9.1-remaster (alsadebs.dsl)
ABit BE6 celeron@466 256Mb DSL0.9.1-remaster (xawtv)
Back to top
Profile PM WEB MSN 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Jan. 11 2005,19:10 QUOTE

oh....
I guess I'm just not seeing it.  I only see reference to 'cdrom'.  Anyway, the worst that could happen is a warning message :)


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
3 replies since Jan. 11 2005,08:50 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: Mount all partions in fstab

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code