fstab
Updated: September 28, 2024
File systems table is used for configuring mounts within a Debian system.
Table of Contents
Terminology
Term | Meaning |
---|---|
defaults | rw, suid, dev, exec, auto, nouser, and async |
async | I/O to fs done outside of main program flow |
atime | turns off noatime |
noatime | do not update inode access times |
auto | can be mounted with -a |
noauto | can only be mounted expicitly ( -a will not cuase the fs to be mounted) |
dev | interpret character or block special devices on fs |
nodev | do not interpret character or block special devices on fs |
diratime | update directory inode access times (default) |
dirsync | All dir updates done sync. Affects system calls: create, link, unlink, symlink, mkdir, rmdir, mknod and rename. |
exec | permit execution of binaries |
noexec | bianaries not allowed to execute |
group | Allow non-root users to mount fs if user is apart of group of device |
encryption | Used with loop option: specify an algorithm |
keybits | specify keysize to use with encrytion algorithm |
iversion | everytime the inode is modified, i_version will be incremented |
noiversion | do not increment i_version |
mand | allow mandatory locks on fs |
nomand | do not allow mandatory locks on fs |
_netdev | fs resides on a device that requires network access |
nofail | do not report errors for the device if it does not exist |
relatime | update inode access times relative to mtime or ctime |
suid | allow set-user-identifier or set-group-identifier bits to take effect (rather unsafe) |
nosuid | do not allow suid |
silent | turn on silent flag |
loud | turn off silent flag |
owner | allow non-root user to mount fs if the own the device |
remount | attempt to mount an already mounted fs ( usually used to make a readonly fs writable |
ro | read only |
rw | read write |
sync | can cause life cycle shortening eg flash drives |
user | allow ordinary user to mount fs |
nouser | forbid non-root users to mount or unmount fs |
users | Allow every user to mount and unmount the filesystem implies: noexec, nosuid nodev |
ARGUMENTS
mount
-V, --version
-h, --help
-v, --verbose
-a, --all # mount all fs in fstab
-F, --fork
-f, --fake # dry run
-i, --internal-only # do not use /sbin/mount.filesystem helper
-I # add labels to mount output
-n, --no-mtab # mount w/o writing to /etc/mtab (needed if /etc is on ro fs)
-p, --pass-fd # in case of loop mount with encryption, rad the pw from file desciptor num in stead of from the terminal.
-s # sloppy mount, tolerate failed options
-r, --read-only
-w, --rw
-L _label_ # mount parition with specified label
-U _uuid_ # mount parition that has a specified uuid (require /proc/partitions)
-t, --types
-O, --test-opts
-o, --options
-B, --bind # remount a subtree somewhere else so that its contents are available in both places
-R, --rbind # remount a subtree and all possible submounts somewhere else so that all its contents are available in both places
-M, --move # move a subree to some other place
/etc/fstab
<device name> <mount point> <fs type> <mount options> <dump> <fsck>
fs type: has option for auto to detect file system type
mount options: see term below: mainly auto/noauto exec/noexec user/nouser etc
dump: 0 = excluded from taking backup <0 = device will be backed up
fsck: 0 = excluded from fsck <1 = device will be fsck after root (1)
/dev/sdb1 /storage/disk2p1 ext4 defaults 0 0
or for uuid
UUID=7df7df7-dfdf7d-dfdfdfy-7686 /var/www ext4 defaults 0 0