News | About | Get Frugalware | Packages | Documentation | Discussion Forums | Bug Tracker | Wiki | Community | Development

Fstab

From FrugalWiki

Jump to: navigation, search



The /etc/fstab file contains static filesystem information. It defines how storage devices and partitions are to be initialized and integrated into the overall system.

Contents

Example

User terminal 48px.png
$ cat /etc/fstab
none             /proc            proc        defaults         0   0
none             /sys             sysfs       defaults         0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
usbfs            /proc/bus/usb    usbfs       devgid=23,devmode=664 0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
/dev/sda2        swap             swap        defaults         0   0
/dev/sda1        /                ext3        defaults         1   1
/dev/sda3        /home            ext3        defaults         1   1

Field definitions

/etc/fstab contains the following fields separated by a space or tab:

<file system>	<dir>	<type>	<options>	<dump>	<pass>
  • <file systems> - defines the storage device (i.e. /dev/sda1).
  • <dir> - tells the mount command where it should mount the <file system> to.
  • <type> - defines the file system type of the device or partition to be mounted. Many different file systems are supported. Some examples are: ext2, ext3, reiserfs, xfs, jfs, smbfs, iso9660, vfat, ntfs, swap, and auto. The 'auto' type lets the mount command to attempt to guess what type of file system is used, this is useful for removable devices such as cdroms and dvds.
  • <options> - define particular options for filesystems. Some options relate only to the filesystem itself. Some of the more common options are:
  • auto - File system will mount automatically at boot, or when the command 'mount -a' is issued.
  • noauto - The filesystem is mounted only when you tell it to.
  • exec - Allow the execution binaries that are on that partition (default).
  • noexec - Do not allow binaries to be executed on the filesystem.
  • ro - Mount the filesystem read only
  • rw - Mount the filesystem read-write
  • sync - I/O should be done synchronously
  • async - I/O should be done asynchronously
  • flush - specific option for FAT to flush data more often, thus making copy dialogs or progress bars to stays up until things are on the disk
  • user - Permit any user to mount the filesystem (implies noexec,nosuid,nodev unless overridden.)
  • nouser - Only allow root to mount the filesystem. (default)
  • defaults - Default mount settings (equivalent to rw,suid,dev,exec,auto,nouser,async).
  • suid - Allow the operation of suid, and sgid bits. They are mostly used to allow users on a computer system to execute binary executables with temporarily elevated privileges in order to perform a specific task.
  • nosuid - Block the operation of suid, and sgid bits.
  • noatime - Do not update inode access times on the filesystem. Can help performance.
  • nodiratime - Do not update directory inode access times on the filesystem. Can help performance.
  • relatime - Update inode access times relative to modify or change time. Access time is only updated if the previous access time was earlier than the current modify or change time. (Similar to noatime, but doesn't break mutt or other applications that need to know if a file has been read since the last time it was modified.) Can help performance.
  • <dump> - Is used by the dump utility to decide when to make a backup. When installed (not installed by a standard installation of Arch Linux), dump checks the entry and uses the number to decide if a file system should be backed up. Possible entries are 0 and 1. If 0, dump will ignore the file system, if 1, dump will make a backup. Most users will not have dump installed, so they should put 0 for the <dump> entry.
  • <pass> fsck reads the <pass> number and determines in which order the file systems should be checked. Possible entries are 0, 1, and 2. The root file system should have the highest priority, 1, all other file systems you want to have checked should get a 2. File systems with a <pass> value 0 will not be checked by the fsck utility.


Mount an external hard driver or usb key

Root terminal 48px.png
# mkdir /media/mykey
Root terminal 48px.png
# mount /dev/sda1 /media/mykey


Monter une partition windows en NTFS

  • Mount a windows partition in /media in temporary way

You must have ntfs-3g package installed.

Root terminal 48px.png
# mkdir /media/windows
Root terminal 48px.png
# mmount -t ntfs-3g -o force /dev/sda5 /media/windows


  • Mount a windows partition in /media in permanent way
Root terminal 48px.png
# mkdir /media/windows
Root terminal 48px.png
# nano /etc/fstab


Then add:

# Partitions Windows - NTFS
périphérique    point de montage    ntfs-3g     rw,user,auto,gid=100,uid=1000,nls=utf8,umask=002    0    0
Personal tools
Namespaces
Variants
Actions