LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-21-2003, 05:03 AM   #1
caesius_01
LQ Newbie
 
Registered: Oct 2003
Posts: 21

Rep: Reputation: 15
Automatically mounting drives with FSTAB


I'm a wee bitty tired of logging in as root, mounting a CD, logging out, logging back in as a normal user then finally accessing the CD. I have heard there is a line you can add to FSTAB to mount drives on boot.

However, there is already a line down the bottom of FSTAB relating to the CD drive; I goes something like: "/dev/cdrom /mnt/cdrom" so forth and so forth. Shouldn't my CD drive already be mounting on startup?

Another thing is unmounting drives, if I remembered correctly BASH helpfully told me I had to be super-user to unmount drives. Is there anyway to:

a) Simplify the whole mount/unmount experience
b) Let 'normal' users mount and unmount.

P.S. No, I do not have a windowing system installed. I'm running Debian Linux.

Cheers,
Ben
 
Old 10-21-2003, 05:13 AM   #2
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Rep: Reputation: 30
my /etc/fstab
Code:
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/backup           /backup                 ext3   defaults        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/reccal   /reccal ext3     exec,dev,suid,rw,usrquota 1 2
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
/dev/sda6               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0
here,add the cdrom entry to your fstab and then change 0 0 to 1 2(i think so)
 
Old 10-21-2003, 05:43 AM   #3
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
what i have done is allowed users to mount the cdrom and i run gkrellm on my desktop.
gkrellm is a system monitoring app that is handy if you like to see what your system is doing. it also allows you to mount/unmount drives if you want. you can get info here => www.gkrellm.net
if you don't have it on your system now use apt-get install gkrellm.
to allow users to mount/umount, where arunshivanandan has owner in his/her cdrom line, change to users.
 
Old 10-21-2003, 06:17 AM   #4
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
quote 'a) Simplify the whole mount/unmount experience
b) Let 'normal' users mount and unmount.

Put 'user' or users, can't remember, or 'owner', in fstab line and the user can mount and umount with:
mount /cdrom say.
Put a symbolic link to /cdrom in your home directory:
ln -s /cdrom C
and you could u/mount with:
mount C at least on Debian.

Loose 'noauto' from fstab and it'll mount cdrom for you.

However you'll probably have to read the manual for fstab and mount - it tends not to do what you want.
 
Old 10-21-2003, 06:30 AM   #5
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
Question

Will Debian let you use supermount? It works pretty well on mine anyway.

Just curious



Still want to rant about that Mandrake 9.2.
 
Old 10-21-2003, 08:13 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,937

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Adding the option user to a fstab line allows any user to mount / umount the filesystem.

The noauto option in the fstab file tells the OS not to mount at boot. Your mounting a filesystem not the drive so you will get errors at boot if your CDROM drive is empty without the noauto option.

See the man pages for mount and fstab for addition info on options.
 
Old 10-21-2003, 12:10 PM   #7
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
Quote:
quoted by michealk
Adding the option user to a fstab line allows any user to mount / umount the filesystem.
this is why i also included the info on gkrellm it has a tool that allows you to press a button and voiala (sp) the drive is mounted. you can also do this for partitions and samba mounts if you wanted to add this feature. i only use it for cdrom and floppy mounting and to report how much space is on my samba mount.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
adding drives to fstab kurrupt Debian 1 08-09-2004 01:17 AM
How does my fstab file get updated automatically when I plug in my camera vdemuth Mandriva 2 08-01-2004 06:16 AM
/etc/fstab drives gazza Linux - Newbie 5 10-29-2003 07:58 AM
Mounting fat drives in fstab.. subnet Linux - Newbie 3 10-10-2003 04:02 AM
Mounting mounting extended partition and its Logical drives desbyleo Linux - Newbie 10 02-18-2002 04:13 PM


All times are GMT -5. The time now is 02:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration