/etc/fstab
specialFile directory fstype mntops freq passno
Contains descriptive information about file systems.
Read by programs, not written.
The system administrator manually maintains this file.
The order of records in fstab
is important
because diskarbitrationd, fsck, mount, and umount process /etc/fstab
sequentially.
The proc
file system is not associated with a special device.
An arbitrary keyword, such as proc
is used instead of
a device specification. Avoid none
which causes the confusing error message
none busy
from umount -a
.
Example:
/dev/sda2 / ext3 defaults,usrquota 1 1 /dev/sda1 /boot ext3 defaults 1 2 /dev/sda4 /home ext3 defaults 1 2 /dev/sda3 swap swap defaults none /tmp tmpfs nodev,nosuid,noexec none /var/tmp tmpfs nodev,nosuid,noexec SunDBsys:DBFiles /dbdata nfs none /proc proc defaults none /dev/pts devpts gid=5,mode=620
fstab.h
#define FSTAB_RW "rw" /* read-write */ #define FSTAB_RO "ro" /* read-only */ #define FSTAB_SW "sw" /* swap */ #define FSTAB_XX "xx" /* ignore totally */ struct fstab { char *fs_spec; /* block special device name */ char *fs_file; /* filesystem path prefix */ char *fs_vfstype; /* type of filesystem */ char *fs_mntops; /* comma separated mount options */ char *fs_type; /* rw, ro, sw, or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel fsck */ };To read records from fstab use
getfsent(3), getfsspec(3), getfstype(3), and getfsfile(3)
.
diskarbitrationd
supports the identification of a local filesystem uniquely by its
UUID or by its volume name, irrespective of hardware configuration and of
hardware parallelism, using the keywords UUID
and LABEL
.
EXAMPLES
UUID=DF000C7E-AE0C-3B15-B730-DFD2EF15CB91 /export ufs ro UUID=FAB060E9-79F7-33FF-BE85-E1D3ABD3EDEA none hfs rw,noauto LABEL=DBDATA none ntfs rw LABEL=The\040Volume\040Name\040Is\040This none msdos ro /etc/fstabSee : getfsent(3), diskarbitrationd(8), /etc/mtab, /etc/filesystem
From pi93graf 2/16/23 (edited for order and column alignment, notice all are skipped by fsck at boot !)
/dev/root / ext4 rw,noatime 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,relatime 0 0 devtmpfs /dev devtmpfs rw,relatime,size=217208k,nr_inodes=54302,mode=755 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0 tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0 tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct 0 0 tracefs /sys/kernel/tracing tracefs rw,relatime 0 0 mqueue /dev/mqueue mqueue rw,relatime 0 0 sunrpc /run/rpc_pipefs rpc_pipefs rw,relatime 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 configfs /sys/kernel/config configfs rw,relatime 0 0 /dev/mmcblk0p1 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437, iocharset=ascii,shortname=mixed,errors=remount-ro 0 0 /dev/mmcblk0p3 /varnew f2fs rw,lazytime,relatime,background_gc=on,discard,no_heap, user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge, extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,fsync_mode=posix 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0 tmpfs /run/user/501 tmpfs rw,nosuid,nodev,relatime,size=44308k,mode=700,uid=501,gid=50 0 0
BSD File Formats Manual FSTAB(5) March 28, 2002 Darwin