Commit | Line | Data |
---|---|---|
40eeacc1 KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
6de79cf3 | 5 | .\" @(#)fstab.5 6.1 (Berkeley) %G% |
40eeacc1 | 6 | .\" |
6de79cf3 | 7 | .TH FSTAB 5 "" |
40eeacc1 KM |
8 | .UC 4 |
9 | .SH NAME | |
10 | fstab \- static information about the filesystems | |
11 | .SH SYNOPSIS | |
12 | .B #include <fstab.h> | |
13 | .SH DESCRIPTION | |
14 | The file | |
15 | .I /etc/fstab | |
16 | contains descriptive information about the various file | |
17 | systems. | |
18 | .I /etc/fstab | |
19 | is only | |
20 | .I read | |
21 | by programs, and not written; | |
22 | it is the duty of the system administrator to properly create | |
23 | and maintain this file. | |
40eeacc1 KM |
24 | The order of records in |
25 | .I /etc/fstab | |
baae7f16 | 26 | is important because |
40eeacc1 KM |
27 | .I fsck, |
28 | .I mount, | |
29 | and | |
30 | .I umount | |
31 | sequentially iterate through | |
32 | .I /etc/fstab | |
33 | doing their thing. | |
34 | .PP | |
35 | The special file name is the | |
36 | .B block | |
37 | special file name, | |
38 | and not the character special file name. | |
39 | If a program needs the character special file name, | |
40 | the program must create it by appending a ``r'' after the | |
41 | last ``/'' in the special file name. | |
42 | .PP | |
43 | If | |
44 | .I fs_type | |
45 | is ``rw'' or ``ro'' then the file system whose name is given in the | |
46 | .I fs_file | |
baae7f16 KM |
47 | field is normally mounted read-write or read-only on the |
48 | specified special file. If | |
49 | .I fs_type | |
50 | is ``rq'', then the file system is normally mounted read-write | |
51 | with disk quotas enabled. | |
40eeacc1 KM |
52 | The |
53 | .I fs_freq | |
54 | field is used for these file systems by the | |
55 | .IR dump (8) | |
56 | command to determine which file systems need to be dumped. | |
57 | The | |
58 | .I fs_passno | |
59 | field is used by the | |
60 | .IR fsck (8) | |
61 | program to determine the order in which file system checks are done | |
62 | at reboot time. | |
63 | The root file system should be specified with a | |
64 | .I fs_passno | |
65 | of 1, and other file systems should have larger numbers. File systems | |
66 | within a drive should have distinct numbers, but file systems on different | |
67 | drives can be checked on the same pass to utilize parallelism available in | |
68 | the hardware. | |
69 | .PP | |
70 | If | |
71 | .I fs_type | |
baae7f16 | 72 | is ``sw'' then the special file is made available as a piece of swap |
40eeacc1 KM |
73 | space by the |
74 | .IR swapon (8) | |
75 | command at the end of the system reboot procedure. | |
76 | The fields other than | |
77 | .I fs_spec | |
78 | and | |
79 | .I fs_type | |
80 | are not used in this case. | |
81 | .PP | |
baae7f16 KM |
82 | If |
83 | .I fs_type | |
84 | is ``rq'' then at boot time the file system is automatically | |
85 | processed by the | |
86 | .IR quotacheck (8) | |
87 | command and disk quotas are then enabled with | |
88 | .IR quotaon (8). | |
89 | File system quotas are maintained in a file ``quotas'', which is | |
90 | located at the root of the associated file system. | |
91 | .PP | |
92 | If | |
93 | .I fs_type | |
94 | is specified as ``xx'' the entry is ignored. | |
95 | This is useful to show disk partitions which are currently not used. | |
40eeacc1 KM |
96 | .sp 1 |
97 | .nf | |
baae7f16 KM |
98 | .DT |
99 | #define FSTAB_RW "rw" /* read-write device */ | |
100 | #define FSTAB_RO "ro" /* read-only device */ | |
101 | #define FSTAB_RQ "rq" /* read-write with quotas */ | |
102 | #define FSTAB_SW "sw" /* swap device */ | |
103 | #define FSTAB_XX "xx" /* ignore totally */ | |
104 | .PP | |
105 | .ta \w'#define 'u +\w'char\ \ 'u +\w'fs_passno; 'u | |
40eeacc1 | 106 | struct fstab { |
baae7f16 KM |
107 | char *fs_spec; /* block special device name */ |
108 | char *fs_file; /* file system path prefix */ | |
109 | char *fs_type; /* rw,ro,sw or xx */ | |
40eeacc1 KM |
110 | int fs_freq; /* dump frequency, in days */ |
111 | int fs_passno; /* pass number on parallel dump */ | |
112 | }; | |
113 | .fi | |
40eeacc1 KM |
114 | .PP |
115 | The proper way to read records from | |
116 | .I /etc/fstab | |
baae7f16 KM |
117 | is to use the routines getfsent(), getfsspec(), getfstype(), |
118 | and getfsfile(). | |
40eeacc1 KM |
119 | .SH FILES |
120 | /etc/fstab | |
121 | .SH SEE ALSO | |
baae7f16 | 122 | getfsent(3X) |