1*277fa1cfSgutteridge.\" $NetBSD: fstab.5,v 1.47 2020/04/19 19:20:32 gutteridge Exp $ 2b5930afcSjtc.\" 3b5930afcSjtc.\" Copyright (c) 1980, 1989, 1991, 1993 4b5930afcSjtc.\" The Regents of the University of California. All rights reserved. 561f28255Scgd.\" 661f28255Scgd.\" Redistribution and use in source and binary forms, with or without 761f28255Scgd.\" modification, are permitted provided that the following conditions 861f28255Scgd.\" are met: 961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 1061f28255Scgd.\" notice, this list of conditions and the following disclaimer. 1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1261f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1361f28255Scgd.\" documentation and/or other materials provided with the distribution. 14075022b3Sagc.\" 3. Neither the name of the University nor the names of its contributors 1561f28255Scgd.\" may be used to endorse or promote products derived from this software 1661f28255Scgd.\" without specific prior written permission. 1761f28255Scgd.\" 1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2161f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2861f28255Scgd.\" SUCH DAMAGE. 2961f28255Scgd.\" 30b5930afcSjtc.\" @(#)fstab.5 8.1 (Berkeley) 6/5/93 3161f28255Scgd.\" 32*277fa1cfSgutteridge.Dd April 19, 2020 3361f28255Scgd.Dt FSTAB 5 347a1aea16Sgarbled.Os 3561f28255Scgd.Sh NAME 3661f28255Scgd.Nm fstab 37fa72f5deSfair.Nd file system table for devices, types, and mount points 3861f28255Scgd.Sh SYNOPSIS 39472351e1Swiz.In fstab.h 4061f28255Scgd.Sh DESCRIPTION 4161f28255ScgdThe file 42fa72f5deSfair.Nm 43fa72f5deSfaircontains descriptive information about the various file systems. 44fa72f5deSfair.Nm 4561f28255Scgdis only read by programs, and not written; 4661f28255Scgdit is the duty of the system administrator to properly create 4761f28255Scgdand maintain this file. 4861f28255ScgdEach file system is described on a separate line; 49878e8395Swizfields on each line are separated by tabs or spaces. 50878e8395SwizLines beginning 51bdadd563Smrgwith 52bdadd563Smrg.Dq # 53bdadd563Smrgare comments. 5461f28255ScgdThe order of records in 55fa72f5deSfair.Nm 5661f28255Scgdis important because 5761f28255Scgd.Xr fsck 8 , 5861f28255Scgd.Xr mount 8 , 5961f28255Scgdand 6061f28255Scgd.Xr umount 8 6161f28255Scgdsequentially iterate through 62fa72f5deSfair.Nm 63fa72f5deSfairdoing their respective tasks. 6461f28255Scgd.Pp 65ab0df1fbSlukemEach configuration line/record in 66cce5d917Slukem.Nm 67cce5d917Slukemhas the format: 68f3ae49b5Slukem.Dl fs_spec fs_file fs_vfstype fs_mntops fs_freq fs_passno 69cce5d917Slukem.Pp 7061f28255ScgdThe first field, 7161f28255Scgd.Pq Fa fs_spec , 7261f28255Scgddescribes the block special device or 7361f28255Scgdremote file system to be mounted. 7461f28255ScgdFor file systems of type 75a67e5e52Spk.Em ffs , 7661f28255Scgdthe special file name is the block special file name, 7761f28255Scgdand not the character special file name. 7861f28255ScgdIf a program needs the character special file name, 79bdadd563Smrgthe program must create it by appending a 80bdadd563Smrg.Dq r 81*277fa1cfSgutteridgeafter the last 82bdadd563Smrg.Dq / 83bdadd563Smrgin the special file name. 84*277fa1cfSgutteridge(Note that for some file systems, e.g., 85*277fa1cfSgutteridge.Em kernfs , 86*277fa1cfSgutteridge.Em procfs , 87*277fa1cfSgutteridgeand 88*277fa1cfSgutteridge.Em tmpfs , 89*277fa1cfSgutteridgethis field has no applicable use, and any string may be supplied as a 90*277fa1cfSgutteridgeplaceholder. 91*277fa1cfSgutteridgeIt is present simply for consistency of argument number and order.) 9261f28255Scgd.Pp 93fbae18c4SchristosIf the first field is of the form 94fbae18c4Schristos.Dq NAME=<value> 95fbae18c4Schristosthen all the 96fbae18c4Schristos.Xr dk 4 97fbae18c4Schristoswedge partitions are searched for one that has a wedge name equal to 98fbae18c4Schristos.Ar <value> 99fbae18c4Schristosand the device corresponding to it is selected. 100fbae18c4Schristos.Pp 10151976c5cSjmcneillIf the first field starts with the prefix 10251976c5cSjmcneill.Dq ROOT. 10351976c5cSjmcneillthe prefix is replaced with 10451976c5cSjmcneill.Dq /dev/[root_device] , 10551976c5cSjmcneillwhere 10651976c5cSjmcneill.Bq root_device 10751976c5cSjmcneillis the value of the 10851976c5cSjmcneill.Dq kern.root_device 10951976c5cSjmcneillsysctl. 11051976c5cSjmcneill.Pp 11161f28255ScgdThe second field, 11261f28255Scgd.Pq Fa fs_file , 11361f28255Scgddescribes the mount point for the file system. 114bdadd563SmrgFor swap and dump partitions, this field should be specified as 115bdadd563Smrg.Dq none . 11661f28255Scgd.Pp 11761f28255ScgdThe third field, 11861f28255Scgd.Pq Fa fs_vfstype , 11961f28255Scgddescribes the type of the file system. 1202ddd261dSmrgThe system currently supports these file systems: 1214d3c62baSjmmv.Bl -tag -width filecore -offset indent 122a67e5e52Spk.It Em adosfs 123fa72f5deSfairan 124a67e5e52Spk.Tn AmigaDOS 1254d3c62baSjmmvfile system. 12693c0a2ddSjtc.It Em cd9660 127fa72f5deSfairan 128fa72f5deSfair.Tn ISO 1294d3c62baSjmmv9660 CD-ROM file system. 1302ddd261dSmrg.It Em ext2fs 1312ddd261dSmrgan implementation of the Linux 1322ddd261dSmrg.Dq Second Extended File-system . 133a67e5e52Spk.It Em fdesc 1344d3c62baSjmmvan implementation of 1354d3c62baSjmmv.Pa /dev/fd . 136a67e5e52Spk.It Em ffs 137a67e5e52Spka local 138dc026e05Sfair.Ux 1394d3c62baSjmmvfile system. 140875a9af4Scjones.It Em filecore 141875a9af4Scjonesa file system for 1424d3c62baSjmmv.Tn RISC\ OS . 143d549b3e1Smycroft.It Em kernfs 1444d3c62baSjmmvvarious and sundry kernel statistics. 1452ddd261dSmrg.It Em lfs 1464d3c62baSjmmva log-structured file-system. 14761f28255Scgd.It Em mfs 14861f28255Scgda local memory-based 149dc026e05Sfair.Ux 1504d3c62baSjmmvfile system. 151d549b3e1Smycroft.It Em msdos 152fa72f5deSfairan 153fa72f5deSfair.Tn MS-DOS 1544d3c62baSjmmv.Dq FAT file system . 15561f28255Scgd.It Em nfs 156bdadd563Smrga Sun Microsystems compatible 1574d3c62baSjmmv.Dq Network File System . 158875a9af4Scjones.It Em ntfs 159875a9af4Scjonesa file system used by 160875a9af4Scjones.Tn Windows NT . 161875a9af4ScjonesStill experimental. 1624c33d8acStron.It Em null 1632ddd261dSmrga loop-back file system, allowing parts of the system to be viewed 1642ddd261dSmrgelsewhere. 165875a9af4Scjones.It Em overlay 166875a9af4Scjonesa demonstration of layered file systems. 1672ddd261dSmrg.It Em portal 1682ddd261dSmrga general file system interface, currently supports TCP and FS mounts. 169d549b3e1Smycroft.It Em procfs 1704d3c62baSjmmva local file system of process information. 1711a0ed0c2Sjmmv.It Em ptyfs 1721a0ed0c2Sjmmva pseudo-terminal device file system. 17361f28255Scgd.It Em swap 1744d3c62baSjmmva disk partition to be used for swapping and paging. 1751a0ed0c2Sjmmv.It Em tmpfs 1761a0ed0c2Sjmmvan efficient memory file system. 1774d249503Smsaitoh.It Em umap 1782ddd261dSmrga user and group re-mapping file system. 179a67e5e52Spk.It Em union 1804d3c62baSjmmva translucent file system. 1814b9e0a77Sgutteridge.It Em zfs 1824b9e0a77Sgutteridgea ZFS file system. 18361f28255Scgd.El 18461f28255Scgd.Pp 18561f28255ScgdThe fourth field, 18661f28255Scgd.Pq Fa fs_mntops , 18761f28255Scgddescribes the mount options associated with the file system. 18861f28255ScgdIt is formatted as a comma separated list of options. 18961f28255ScgdIt contains at least the type of mount (see 19061f28255Scgd.Fa fs_type 19161f28255Scgdbelow) plus any additional options 19261f28255Scgdappropriate to the file system type. 19361f28255Scgd.Pp 194bdadd563SmrgThe option 195bdadd563Smrg.Dq auto 196bdadd563Smrgcan be used in the 197bdadd563Smrg.Dq noauto 198bdadd563Smrgform to cause 199bdadd563Smrga file system not to be mounted automatically (with 200bdadd563Smrg.Dq mount -a 201bdadd563Smrg, 202b2be16e4Smrgor system boot time). 203b2be16e4Smrg.Pp 204bdadd563SmrgIf the options 205bdadd563Smrg.Dq userquota 206bdadd563Smrgand/or 207bdadd563Smrg.Dq groupquota 208bdadd563Smrgare specified, 20961f28255Scgdthe file system is automatically processed by the 21061f28255Scgd.Xr quotacheck 8 211063f96f3Sbouyercommand, and legacy user and/or group disk quotas are enabled with 21261f28255Scgd.Xr quotaon 8 . 21361f28255ScgdBy default, 21461f28255Scgdfile system quotas are maintained in files named 21561f28255Scgd.Pa quota.user 21661f28255Scgdand 21761f28255Scgd.Pa quota.group 21861f28255Scgdwhich are located at the root of the associated file system. 21961f28255ScgdThese defaults may be overridden by putting an equal sign 22061f28255Scgdand an alternative absolute pathname following the quota option. 22161f28255ScgdThus, if the user quota file for 22261f28255Scgd.Pa /tmp 22361f28255Scgdis stored in 22461f28255Scgd.Pa /var/quotas/tmp.user , 22561f28255Scgdthis location can be specified as: 22661f28255Scgd.Bd -literal -offset indent 22761f28255Scgduserquota=/var/quotas/tmp.user 22861f28255Scgd.Ed 22961f28255Scgd.Pp 230063f96f3SbouyerIt is recommended to turn on the new, in-file system quota with 231063f96f3Sbouyer.Xr tunefs 8 232063f96f3Sbouyeror at 233063f96f3Sbouyer.Xr newfs 8 234063f96f3Sbouyertime, and to not use the 235063f96f3Sbouyer.Dq userquota 236063f96f3Sbouyeror 237063f96f3Sbouyer.Dq groupquota 238063f96f3Sbouyeroptions. 239063f96f3SbouyerMigration of limits to the new in-file system quota can be handled 2407da608caSdhollandvia 2417da608caSdholland.Xr quotadump 8 242063f96f3Sbouyerand 2437da608caSdholland.Xr quotarestore 8 . 244063f96f3Sbouyer.Pp 245b5d278fbSpookaThe option 246b5d278fbSpooka.Dq rump 247b5d278fbSpookais used to mount the file system using a 248b5d278fbSpooka.Xr rump 3 249b5d278fbSpookauserspace server instead of the kernel server. 250b5d278fbSpooka.Pp 25161f28255ScgdThe type of the mount is extracted from the 25261f28255Scgd.Fa fs_mntops 25361f28255Scgdfield and stored separately in the 25461f28255Scgd.Fa fs_type 25561f28255Scgdfield (it is not deleted from the 25661f28255Scgd.Fa fs_mntops 25761f28255Scgdfield). 25861f28255ScgdIf 25961f28255Scgd.Fa fs_type 260bdadd563Smrgis 261bdadd563Smrg.Dq rw 262bdadd563Smrgor 263bdadd563Smrg.Dq ro 264bdadd563Smrgthen the file system whose name is given in the 26561f28255Scgd.Fa fs_file 26661f28255Scgdfield is normally mounted read-write or read-only on the 26761f28255Scgdspecified special file. 26861f28255ScgdIf 26961f28255Scgd.Fa fs_type 270bdadd563Smrgis 271bdadd563Smrg.Dq sw 272bdadd563Smrgor 273bdadd563Smrg.Dq dp 274bdadd563Smrgthen the special file is made available as a piece of swap 275bdadd563Smrgor dump 27661f28255Scgdspace by the 2773f5be650Smrg.Xr swapctl 8 278fa72f5deSfaircommand towards the beginning of the system reboot procedure. 279fa72f5deSfairSee 2803f5be650Smrg.Xr swapctl 8 281bdadd563Smrgfor more information on configuring swap and dump devices. 28261f28255ScgdThe fields other than 28361f28255Scgd.Fa fs_spec 28461f28255Scgdand 28561f28255Scgd.Fa fs_type 28661f28255Scgdare unused. 28761f28255ScgdIf 28861f28255Scgd.Fa fs_type 289bdadd563Smrgis specified as 290bdadd563Smrg.Dq xx 291bdadd563Smrgthe entry is ignored. 29261f28255ScgdThis is useful to show disk partitions which are currently unused. 29361f28255Scgd.Pp 29461f28255ScgdThe fifth field, 29561f28255Scgd.Pq Fa fs_freq , 29661f28255Scgdis used for these file systems by the 29761f28255Scgd.Xr dump 8 29861f28255Scgdcommand to determine which file systems need to be dumped. 29961f28255ScgdIf the fifth field is not present, a value of zero is returned and 300fa72f5deSfair.Xr dump 8 30161f28255Scgdwill assume that the file system does not need to be dumped. 30261f28255Scgd.Pp 30361f28255ScgdThe sixth field, 30461f28255Scgd.Pq Fa fs_passno , 30561f28255Scgdis used by the 30661f28255Scgd.Xr fsck 8 30761f28255Scgdprogram to determine the order in which file system checks are done 30861f28255Scgdat reboot time. 30961f28255ScgdThe root file system should be specified with a 31061f28255Scgd.Fa fs_passno 31161f28255Scgdof 1, and other file systems should have a 31261f28255Scgd.Fa fs_passno 31361f28255Scgdof 2. 31461f28255ScgdFilesystems within a drive will be checked sequentially, 31561f28255Scgdbut file systems on different drives will be checked at the 31643e0efbdSperrysame time to use parallelism available in the hardware. 31761f28255ScgdIf the sixth field is not present or zero, 31861f28255Scgda value of zero is returned and 319fa72f5deSfair.Xr fsck 8 32061f28255Scgdwill assume that the file system does not need to be checked. 32161f28255Scgd.Bd -literal 32261f28255Scgd#define FSTAB_RW "rw" /* read-write device */ 323872ec7c6Senami#define FSTAB_RQ "rq" /* read/write with quotas */ 32461f28255Scgd#define FSTAB_RO "ro" /* read-only device */ 32561f28255Scgd#define FSTAB_SW "sw" /* swap device */ 326bdadd563Smrg#define FSTAB_DP "dp" /* dump device */ 32761f28255Scgd#define FSTAB_XX "xx" /* ignore totally */ 32861f28255Scgd 32961f28255Scgdstruct fstab { 33061f28255Scgd char *fs_spec; /* block special device name */ 33161f28255Scgd char *fs_file; /* file system path prefix */ 33261f28255Scgd char *fs_vfstype; /* type of file system */ 33361f28255Scgd char *fs_mntops; /* comma separated mount options */ 33461f28255Scgd char *fs_type; /* rw, ro, sw, or xx */ 33561f28255Scgd int fs_freq; /* dump frequency, in days */ 33652f1b2a8Sperry int fs_passno; /* pass number on parallel fsck */ 33761f28255Scgd}; 33861f28255Scgd.Ed 33961f28255Scgd.Pp 34061f28255ScgdThe proper way to read records from 34161f28255Scgd.Pa fstab 34261f28255Scgdis to use the routines 34361f28255Scgd.Xr getfsent 3 , 34461f28255Scgd.Xr getfsspec 3 , 34561f28255Scgdand 34661f28255Scgd.Xr getfsfile 3 . 34761f28255Scgd.Sh FILES 3486662805eSjdolecek.Bl -tag -width /etc/fstab 34961f28255Scgd.It Pa /etc/fstab 3506662805eSjdolecekThe location of 351fa72f5deSfair.Nm 3526662805eSjdolecekconfiguration file. 3536662805eSjdolecek.It Pa /usr/share/examples/fstab/ 3546662805eSjdolecekSome useful configuration examples. 35561f28255Scgd.El 3565f516860Swiz.Sh EXAMPLES 3575f516860SwizTo use 3585f516860Swiz.Dq NAME 3595f516860Swizon a non-GPT disk, use: 3605f516860Swiz.Bd -literal 3615f516860SwizNAME=sb2k5Root/a / ffs rw,log 1 1 3625f516860SwizNAME=sb2k5Root/b none swap sw,dp 0 0 3635f516860Swiz.Ed 364c6462b8dSryoon.Pp 3655f516860SwizFor a 3665f516860Swiz.Xr gpt 8 3675f516860Swizdisk, use: 3685f516860Swiz.Bd -literal 3695f516860SwizNAME=firstpartition / ffs rw,log 1 1 3705f516860SwizNAME=secondpartition none swap sw,dp 0 0 3715f516860Swiz.Ed 37261f28255Scgd.Sh SEE ALSO 3732ddd261dSmrg.Xr getfsent 3 , 37465fcd43bSchristos.Xr getfsspecname 3 , 375875a9af4Scjones.Xr mount 8 , 376f6f00e26Smsaitoh.Xr swapctl 8 37761f28255Scgd.Sh HISTORY 37861f28255ScgdThe 37961f28255Scgd.Nm 38061f28255Scgdfile format appeared in 38161f28255Scgd.Bx 4.0 . 382