1fsck(1M)                System Administration Commands                fsck(1M)
2
3
4

NAME

6       fsck - check and repair file systems
7

SYNOPSIS

9       fsck [-F FSType] [-m] [-V] [-v] [special]...
10
11
12       fsck [-F FSType] [-n | N | y | Y] [-V] [-v]
13            [-o FSType-specific-options] [special]...
14
15

DESCRIPTION

17       fsck  audits  and interactively repairs inconsistent file system condi‐
18       tions. If the file system is inconsistent the default action  for  each
19       correction  is  to  wait for the user to respond yes or no. If the user
20       does not have write permission fsck defaults to a no action. Some  cor‐
21       rective actions will result in loss of data. The amount and severity of
22       data loss can be determined from the diagnostic output.
23
24
25       FSType-specific-options are  options  specified  in  a  comma-separated
26       (with no intervening spaces) list of options or keyword-attribute pairs
27       for interpretation by the FSType-specific module of the command.
28
29
30       special represents the character special device on which the file  sys‐
31       tem  resides, for example, /dev/rdsk/c1t0d0s7. Note: the character spe‐
32       cial device, not the block special device, should be  used.  fsck  will
33       not work if the block device is mounted.
34
35
36       If  no  special device is specified fsck checks the file systems listed
37       in /etc/vfstab. Those entries in /etc/vfstab  which  have  a  character
38       special  device  entry in the fsckdev field and have a non-zero numeric
39       entry in the fsckpass field will be checked. Specifying -F FSType  lim‐
40       its the file systems to be checked to those of the type indicated.
41
42
43       If  special  is  specified, but -F is not, the file system type will be
44       determined by looking for a matching entry in /etc/vfstab. If no  entry
45       is   found,   the   default   local   file  system  type  specified  in
46       /etc/default/fs will be used.
47
48
49       If a file system type supports parallel  checking,  for  example,  ufs,
50       some  file  systems  eligible  for checking may be checked in parallel.
51       Consult the file system-specific man page (for  example,  fsck_ufs(1M))
52       for more information.
53

OPTIONS

55       The following generic options are supported:
56
57       -F FSType
58
59           Specify the file system type on which to operate.
60
61
62       -m
63
64           Check but do not repair. This option checks that the file system is
65           suitable for mounting, returning the appropriate  exit  status.  If
66           the file system is ready for mounting, fsck displays a message such
67           as:
68
69             ufs fsck: sanity check: /dev/rdsk/c0t3d0s1 okay
70
71
72
73
74       -n | -N
75
76           Assume a no response to all questions asked by fsck;  do  not  open
77           the file system for writing.
78
79
80       -V
81
82           Echo the expanded command line but do not execute the command. This
83           option may be used to verify and to validate the command line.
84
85
86       -v
87
88           Enables verbose output. Might not be supported by  all  filesystem-
89           specific fsck implementations.
90
91
92       -y | Y
93
94           Assume a yes response to all questions asked by fsck.
95
96
97       -o specific-options
98
99           These specific-options can be any combination of the following sep‐
100           arated by commas (with no intervening spaces).
101
102           b=n
103
104               Use block n as the super block for the file system. Block 32 is
105               always  one  of the alternate super blocks. Determine the loca‐
106               tion of other super blocks by running newfs(1M)  with  the  -Nv
107               options specified.
108
109
110           c
111
112               If the file system is in the old (static table) format, convert
113               it to the new (dynamic table) format. If the file system is  in
114               the  new  format, convert it to the old format provided the old
115               format can support the file system configuration.  In  interac‐
116               tive mode, fsck will list the direction the conversion is to be
117               made and ask whether the conversion should be done. If a  nega‐
118               tive  answer  is  given,  no further operations are done on the
119               file system. In preen mode, the direction of the conversion  is
120               listed  and  done if possible without user interaction. Conver‐
121               sion in preen mode is best used when all the file  systems  are
122               being  converted  at  once.  The format of a file system can be
123               determined from the first line of output from fstyp(1M).  Note:
124               the  c  option is seldom used and is included only for compati‐
125               bility with pre-4.1 releases. There is no guarantee  that  this
126               option will be included in future releases.
127
128
129           f
130
131               Force checking of file systems regardless of the state of their
132               super block clean flag.
133
134
135           p
136
137               Check and fix the file system non-interactively ("preen"). Exit
138               immediately  if there is a problem requiring intervention. This
139               option is required to enable parallel file system checking.
140
141
142           w
143
144               Check writable file systems only.
145
146
147

EXIT STATUS

149       0
150
151           file system is unmounted and OK
152
153
154       1
155
156           erroneous parameters are specified
157
158
159       32
160
161           file system is unmounted and needs checking (fsck -m only)
162
163
164       33
165
166           file system is already mounted
167
168
169       34
170
171           cannot stat device
172
173
174       35
175
176           a filesystem that is mounted read/write was modified - reboot
177
178
179       36
180
181           uncorrectable errors detected - terminate normally
182
183
184       37
185
186           a signal was caught during processing
187
188
189       39
190
191           uncorrectable errors detected - terminate immediately
192
193
194       40
195
196           file system is mounted read-only and is OK
197
198

USAGE

200       The fsck command is large file aware for  UFS  file  systems,  per  the
201       largefile(5) man page.
202

FILES

204       /etc/default/fs
205
206           default  local  file system type. Default values can be set for the
207           following flags in /etc/default/fs. For example: LOCAL=ufs.
208
209           LOCAL
210
211               The default partition for a command if no FSType is specified.
212
213
214
215       /etc/vfstab
216
217           list of default parameters for each file system
218
219

ATTRIBUTES

221       See attributes(5) for descriptions of the following attributes:
222
223
224
225
226       ┌─────────────────────────────┬─────────────────────────────┐
227       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
228       ├─────────────────────────────┼─────────────────────────────┤
229       │Availability                 │SUNWcsu                      │
230       ├─────────────────────────────┼─────────────────────────────┤
231       │Interface Stability          │Committed                    │
232       └─────────────────────────────┴─────────────────────────────┘
233

SEE ALSO

235       clri(1M), fsck_cachefs(1M),  fsck_ufs(1M),  fsdb_ufs(1M),  fsirand(1M),
236       fstyp(1M),  mkfs(1M),  mkfs_ufs(1M),  mountall(1M),  newfs(1M), reboot(
237       1M), vfstab(4), attributes(5), largefile(5), ufs(7FS)
238

WARNINGS

240       The operating system buffers  file  system  data.  Running  fsck  on  a
241       mounted  file system can cause the operating system's buffers to become
242       out of date with respect to the disk. For this reason, the file  system
243       should  be  unmounted  when fsck is used. If this is not possible, care
244       should be taken that the system is quiescent and that  it  is  rebooted
245       immediately  after  fsck is run. Quite often, however, this will not be
246       sufficient. A panic will probably occur if running fsck on a file  sys‐
247       tem modifies the file system.
248

NOTES

250       This command may not be supported for all FSTypes.
251
252
253       Starting  with  Solaris  9, fsck manages extended attribute data on the
254       disk. (See fsattr(5) for a description of extended file attributes.)  A
255       file  system  with  extended  attributes  can be mounted on versions of
256       Solaris that are not attribute-aware (versions prior to Solaris 9), but
257       the attributes will not be accessible and fsck will strip them from the
258       files and place them in  lost+found.  Once  the  attributes  have  been
259       stripped,  the  file system is completely stable on versions of Solaris
260       that are not attribute-aware, but  would  be  considered  corrupted  on
261       attribute-aware   versions.   In   the  latter  circumstance,  run  the
262       attribute-aware fsck to stabilize the file system before using it in an
263       attribute-aware environment.
264
265
266
267SunOS 5.11                        7 May 2008                          fsck(1M)
Impressum