The fstab file (/etc/fstab
) governs which mount points the system is aware of.
Fields in the File System Table (fstab)
The basic structure of the file is as follows:
$device $mount_point $fs_type $mount_options $dump_options $check_options
For example, the floppy disk (if you still have one) is:
/dev/fd0 /mnt/floppy auto rw,noauto,user,sync 0 0
Baseline fstab
By default there are few entries, the init scripts will mount many of the absolutely necessary things.
/dev/sda1 / ext3 noatime 0 1 /dev/sda2 none swap sw 0 0 shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
CIFS (Samba) Entries in fstab
The most important thing here is the options and credentials, this example shows a simple share on server WinR2D2. Adjust the path to the credentials file as necessary and properly set permissions (0600).
//winr2d2/public /mnt/public cifs dir_mode=0777,file_mode=0666,uid=500,gid=500,credentials=/opt/edoceo/etc/auth.cifs 0 0
Here is a sample credentials file
username=someuser password=somepass
GlusterFS Entries in fstab
Super handy to auto-mount to a Gluster system on boot - for /home maybe or some large shared repository
SSHFS (FUSE) in fstab
Replace the $ prefixed items with proper values for your environment
sshfs#$user@$host:/$path /mnt/$host fuse comment=sshfs,noauto,users,transform_symlinks 0 0