FSTAB and all That?!
The purpose of this documentation is just to provide a little insight into manually editing /etc/fstab. It is not a comprehensive document and it is intend to address the issue with the help of screenshots/pictures. Fstab requires you have root privileges to edit it. CAUTION – NOT TO BE UNDERTAKEN LIGHTLY. ** Editing is possible by opening a terminal and doing:
In KDE: kdesu kwrite /etc/fstab
In Gnome: gnomesu gedit /etc/fstab**
You can also use super user file managers as available with kde. And the yast partitioner also can be used.
/etc/fstab is the location of a config file which controls mount information for drives/partitions and is used as your system boots. Your Linux file system (swap, / and /home) will automatically be added in here during installation and it’s unlikely you will need to alter the defaults used there. However, it’s possible you may need to edit this file to either add partitions not already included from the initial installation OR to edit the detail of a particular entry. In this document we will look at.
- An existing entry for a Vista partition.
- The Mount Point
- Commenting Out
- Manually adding an entry
1. Here is an example of a typical fstab file:
ImageBam - Fast, Free Image Hosting and Photo Sharing
It shows a highlighted entry of a Vista partition added during installation but it has been modified for read/write access. Originally it would have looked a little like the entry above it but now it is simplified with “defaults 0 0”. We’ll cover that later.
Notice the mount point ( /Vista ).
The line above shows ( /STORE ). ImageBam - Fast, Free Image Hosting and Photo Sharing Both these entries were created during installation by setting the mount points of the partitions in the Custom Partitioner.
2. A mount Point as mentioned in point 1 is a folder in the Linux Installation file system tree. Here is a screen of a typical tree. I have highlighted the two points we have refered to already /Vista and /STORE
http://thumbnails8.imagebam.com/3389/b1bc3d33885464.gif](http://www.imagebam.com/image/b1bc3d33885464/)
Therefore, if you fail to add/mount a partition, such as a windows installation, during the initial installation of Linux, you will need to manually add an entry to fstab – But you must provide a mount point. If I hadn’t added Vista during installation, no folder of that name would exist and if I wanted to mount the Vista partition to that location, I would have to create the folder /Vista first.
3. A mention of ‘Commenting Out’. The process of placing a # at the start of a configuration line. Is considered a better practice than say deleting the entire line, as commenting out preserves the text for future reference but disables the configuration line. Here is an example:
ImageBam - Fast, Free Image Hosting and Photo Sharing
After reboot, with these lines commented out, the partitions Vista and STORE would no longer be available.
4. Manually adding an entry to fstab. Let’s say we fail to set this up during installation, how can we do it later? Well first you need the ‘Mount Point’. You can create this. In my examples the folders Vista and STORE are directly on /
( A note However, even if you fail to set up mount points for partitions, usually the installer will automatically pick up other partitions such as XP or Vista and add an entry in fstab but use a mount point like: /media/windows_c – In this case, all that would be required is to edit the entry in fstab to give ‘read’ or ‘read/write’ permissions)
If nothing exists just create a folder with the name you require in whatever location you desire. You may need to do this with root permissions.
Let’s assume though that nothing exists. How do you know what to add? Well let’s find the Vista partition in my installation. We need to open a terminal, type su and then the root password to have root privileges. And then type: fdisk -l
http://thumbnails13.imagebam.com/3389/7a3be833886521.gif](http://www.imagebam.com/image/7a3be833886521/)
Here you see the output. I highlighted the first line sda1 which is the Vista installation. Now to add that to fstab.
http://thumbnails19.imagebam.com/3389/fde7ab33886684.gif](http://www.imagebam.com/image/fde7ab33886684/)
This assumes we had no entry for Vista and are adding it from the fdisk output. Notice the method of using /dev/sda1
You can find more information here: HowTo Mount NTFS Filesystem Partition Read Write Access in openSUSE 10, 11
@swerdna provides a valuable source of information not just on this subject but whole range of topics. You can go to his homepage from the link above.
- You should exercise extreme caution when giving access to NTFS partitions of windows installations. The best policy is to only provide ‘read’ access and NOT ‘write’. My example using ‘defaults 0 0’ gives read/write access.
Lastly – You must leave an empty line at the end of fstab:
ImageBam - Fast, Free Image Hosting and Photo Sharing
Other sources of information:
NTFS - openSUSE