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 thanx in advance~ |
take a look at /etc/fstab
|
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. |
Quote:
/dev/hda5 /mnt/win2k auto auto,defaults 0 0 |
Quote:
#<-Note the hash, this renders the line ignored #device mnt-point fs-type options dump pass |
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.
|
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. |
All times are GMT -5. The time now is 10:54 AM. |