LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 11-29-2003, 12:07 AM   #1
black
Member
 
Registered: Jul 2002
Location: nowhere
Distribution: GNU
Posts: 118

Rep: Reputation: 15
auto mount on rebooting


Hi all~

i had 2 OSs, one is RedHat and the other is Win2k. i decide to mount win2k files to Linux so i can go on with my work on Linux, the command i typed is just like this:
Code:
mount auto -t /dev/hda5 /mnt/win2k
it works fine. but i need more, ie i need Linux mount this part automaticaly everytime it starts, my book didnt tell me much on this topic, so i hope some guys could inspire me a bit, any suggestions ?

thanx in advance~
 
Old 11-29-2003, 12:33 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
take a look at /etc/fstab
 
Old 11-29-2003, 01:17 AM   #3
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Put this in /etc/fstab
/dev/hda5 /mnt/win2k auto auto,defaults 0 0

If you want to give all users access put users, before the last auto or you can use uid/gid to control access.
 
Old 11-29-2003, 09:07 PM   #4
black
Member
 
Registered: Jul 2002
Location: nowhere
Distribution: GNU
Posts: 118

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by /bin/bash
Put this in /etc/fstab
/dev/hda5 /mnt/win2k auto auto,defaults 0 0

If you want to give all users access put users, before the last auto or you can use uid/gid to control access.
thanx bin/bash, can you explain a bit more of this line ?

/dev/hda5 /mnt/win2k auto auto,defaults 0 0
 
Old 11-29-2003, 09:27 PM   #5
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
Quote:
/dev/hda5 /mnt/win2k auto auto,defaults 0 0
/dev/hda5 is your Win partition. In fstab, the device usaully goes first. '/mnt/win2k' is the mount point, a folder where the stuff will be mounted. 'auto' is the filesytem type. The FS-type is automatically detected f this is used. It can also be 'vfat' (for FAT32) or 'ntfs'. NTFS should also be set as read-only, because ntfs write isn't supported well. The second 'auto' is the first of a list of options. 'auto' mounts automatically on startup. 'defaults' is the default options. You can add 'ro' here to make the device read-only. Do not leave spaces between options, only commas. The last two 0's are for whether the FS will be checked or not (pass), and whether the FS will be backed up (dump). Put this line at the top of your fstab for reference:
#<-Note the hash, this renders the line ignored
#device mnt-point fs-type options dump pass
 
Old 11-29-2003, 09:33 PM   #6
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
What /bin/bash meant by using uid/gid is that these are options. Windows does not support some Linux attributes. They must be set in the fstab instead of the normal way. The 'umask=[number]' option sets permissions. 'umask=0' will set rwxrwxrwx permissions on all the stuff in your Win drive. 'uid=' and 'gid=' set ownership. Putting 'uid=black' will set all files as being owned by black. 'gid=users' will set the files' group to 'users'. Remember that options are seperated by commas, not spaces.
 
Old 11-29-2003, 11:34 PM   #7
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Thats an excellent explanation by aaa. I just wanted to add an example or two.

You can get as complicated as you want with fstab entries. Or you can keep them simple.

/dev/hda1 /win/c vfat auto,umask=027,uid=501,gid=100 1 0
The above will automatically mount /dev/hda1 at /win/c using vfat filesystem. The files will owned by the user with uid=501 and will be in the group with gid=100. The mask 027 makes the files writable only by owner (drwxr-x---) but group can browse the directories and read the files.


/dev/hda1 /win/c vfat user,auto 1 0
This will automatically mount /dev/hda1 at /win/c using vfat filesystem. It doesn't matter who owns the files because they will be writable by anyone.

Last edited by /bin/bash; 11-29-2003 at 11:36 PM.
 
  


Reply



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
No auto CD mount? jurgen_hadley Mandriva 3 06-26-2005 11:12 AM
Auto mount. non root mount canyon289 Linux - Hardware 1 02-21-2005 10:05 PM
mount permmissions and auto mount mokojin Slackware 3 02-28-2004 10:47 AM
autofs enabled in kernel but auto.mount and auto.master are NOT in /etc! Alybyzrp Linux - General 0 11-11-2003 12:26 PM
SCRIPT: check if auto-mount mount-points are still mounted markus1982 Linux - Software 0 05-25-2003 05:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:02 AM.

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
Open Source Consulting | Domain Registration