FSTAB-Tuning
Not a must but you get a good intro if you read the manpages:
> man fstab
> man mount
Also, there is a very good site that covers the complete NTFS-problem and
- in addition - it explains thoroughly a lot of things about mounting and
the fstab FAQ. Most of the information here I took from there! The complete
link is given in the NTFS-Access part! For a start you may want to take a
look at http://linux-ntfs.sourceforge.net/info/ntfs.html#4.9
Things to know for now:
- You can always mount a disk or floppydrive or any other blockdevice
even if it's not mentioned in the /etc/fstab
(=FileSystemTABle).
- A so called mountpoint (i.e. any directory of your choice) has to exist.
When being used this way its content is covered (i.e. you can't see or use
it) until you unmount the device again!
- You access a partition simply by opening that directory in a filebrowser.
- A mountpoint can easily be changed if you don't like its position any
more for any reason. In case you have created symbolic links pointing to
some directory inside, they will be broken, of course. Delete them and create
new ones:
> ln -s /new/location/of/your/disk /your/link/to/it
- Of course you can also do this with a graphical browser of your choice
like nautilus...
In any case you should provide some information about what kind of filesystem
you want to mount (in order to assure that Linux loads the right modules)
and about its properties and Permissions
That means applying UNIX-permissions: tell Linux
- who's the owner of the device
- what the groupID is and
- who is allowed to do what on the filesystem: that is to define filepermissions!
As you might know, the permissions are three binary triples.(each like 22
21 20 , the potencies representing Read, Write and Execute);
The first triple is for Owner, the second for Group and the last for Others.
They can also be displayed in decimals (thus ranging from 0 to 7: 22
+21 +20).
Manual mounting
Enter a line like this:
> mount /dev/hda7 /mnt/data -t vfat users,umask=0007,gid=users 0 0
<p>
<a href="http://validator.w3.org/check/referer"><img border="0"
src="http://www.w3.org/Icons/valid-html401"
alt="Valid HTML 4.01!" height="31" width="88"></a>
</p>
Automated mounting
In order to automate the mounting or simply to type less like just providing
the mountpoint: (like > mount /mnt/data)
you should store information about devices in the file /etc/fstab.
If you have provided mountpoints for your WindowsPartitions during the installation
(which is not possible for NTFS-drives because RedHat does not ship any driver...)
there will already be matching lines.
They have to be edited, because the default settings used by RedHat only
apply to ext2- or ext3-Linux-filesystems and are NOT good for use with FAT32.
Getting to the point
The fstab is interpreted linewise. The entries are separated by spaces or
(to improve readability) tabs.
/dev/hda7 /mnt/data vfat auto,users,umask=0007,gid=users 0 0
This is how I mount my Windows FAT32-partition that I need to have access
to files used both with Linux and Windows.
The first entry is the device-file, the second the all important mountpoint,
the third the filesystem-type, and the forth are the mount options. And that
is where you can do wrong or good...
- I chose auto for automatic
mounting at bootup. Practical if no changes of permissions or stuff during
use are planned. If so be informed that it'll be hard to unmount the disk!
The changes you make to your fstab will only take effect after reboot...
- The users-entry means
that all users are allowed to mount and unmount the drive. Normally that
is not needed because with the auto-option
it is already mounted. I left it mainly because with that option the Gnome-desktop
automatically displays an icon for the device on the desktop! (B.t.w.: The
difference between user and
users is that without the
s only the user who mounted
can unmount again. With users
any user can mount and unmount!)
- The umask is a little
tricky to understand. In a nutshell it's simply the opposite of the system
mentioned above with a leading 0: umask=0000
means everybody can do everything with the files on the disk - this may not
always be desired! umask=0007
then gives the Owner and the Groupmembers (i.e. the first two triples) all
permissions and denies them to everybody else as for example to a nobody-user
who accesses the disk via your SAMBA-server. See the SAMBA-Guide-part for that topic. If you want
to give those guest accounts at least Read-Access, then choose umask=0003, which corresponds to
a 774-file-permission!
- Last not least I specified a GroupID gid=users. This is simply because
the automounting option leads to a root-ownership and to a root-group. Make
sure you give your normal accounts the users-groupID for their primary group.
When created at installation time, RedHat gives no possibility to change
the group and defines a private group for each user... in SystemsSettings -> Users and Groups
you can correct that!
- Don't worry about the two zeros at the end; no idea what they are for...
/dev/hda1 /mnt/system ntfs noauto,ro,umask=0227,gid=users 0 0
This is what I use for my NTFS-Windows-drive. Because of the noauto I have
to mount it when I need it, and because of the missing users-entry I have
to do that as root:
> su -
> mount /mnt/system
You can also view or download my complete fstab - but make sure you only
paste entries (because ownership and permissions may not be secure/correct
due to the webpublishing!) and adapt the device-files to your situation if
necessary (/dev/hdax for IDE-devices
or /dev/sdax for SCSI-devices)!
/etc/fstab
Legal:
Permission to copy, distribute, link, and
reformat is given and desired on condition that authorship is indicated:
Daniel Mader, Freiburg i.Brsg., 2003
Last changed: 16.06.2003