Whamcloud - gitweb
fsck.c: If the bone-headed user enters the filename twice, the
[tools/e2fsprogs.git] / misc / tune2fs.8.in
1 .\" Revision 1.0 93/06/3 23:00  chk
2 .\" Initial revision
3 .\"
4 .\"
5 .TH TUNE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 tune2fs \- adjust tunable filesystem parameters on second extended filesystems
8 .SH SYNOPSIS
9 .B tune2fs
10 [
11 .B \-l
12 ]
13 [
14 .B \-c
15 .I max-mount-counts
16 ]
17 [
18 .B \-e
19 .I errors-behavior
20 ]
21 [
22 .B \-f
23 ]
24 [
25 .B \-i
26 .I interval-between-checks
27 ]
28 [
29 .B \-j
30 ]
31 [
32 .B \-J
33 .I journal-options
34 ]
35 [
36 .B \-m
37 .I reserved-blocks-percentage
38 ]
39 [
40 .B \-r
41 .I reserved-blocks-count
42 ]
43 [
44 .B \-s
45 .I sparse-super-flag
46 ]
47 [
48 .B \-u
49 .I user
50 ]
51 [
52 .B \-g
53 .I group
54 ]
55 [
56 .B \-C
57 .I mount-count
58 ]
59 [
60 .B \-L
61 .I volume-name
62 ]
63 [
64 .B \-M
65 .I last-mounted-directory
66 ]
67 [
68 .B \-O 
69 .RI [^] feature [,...]
70 ]
71 [
72 .B \-T
73 .I time-last-checked
74 ]
75 [
76 .B \-U
77 .I UUID
78 ]
79 device
80 .SH DESCRIPTION
81 .BI tune2fs
82 adjusts tunable filesystem parameters on a Linux second extended filesystem.
83 .SH OPTIONS
84 .TP
85 .BI \-c " max-mount-counts"
86 Adjust the maximal mounts count between two filesystem checks.  If 
87 .I max-mount-counts
88 is 0 then the number of times the filesystem is mounted will be disregarded
89 by
90 .BR e2fsck (8)
91 and the kernel.
92 .sp
93 Staggering the mount-counts at which filesystems are forcibly
94 checked will avoid all filesystems being checked at one time
95 when using journaled filesystems.
96 .sp
97 You should strongly consider the consequences of disabling
98 mount-count-dependent checking entirely.  Bad disk drives, cables,
99 memory, and kernel bugs could all corrupt a filesystem without
100 marking the filesystem dirty or in error.  If you are using
101 journaling on your filesystem, your filesystem will
102 .B never
103 be marked dirty, so it will not normally be checked.  A
104 filesystem error detected by the kernel will still force
105 an fsck on the next reboot, but it may already be too late
106 to prevent data loss at that point.
107 .sp
108 See also the
109 .B \-i
110 option for time-dependent checking.
111 .TP
112 .BI \-C " mount-count"
113 Set the number of times the filesystem has been mounted.
114 Can be used in conjunction with -c to force an fsck on
115 the filesystem at the next reboot.
116 .TP
117 .BI \-e " error-behavior"
118 Change the behavior of the kernel code when errors are detected.
119 In all cases, a filesystem error will cause
120 .BR e2fsck (8)
121 to check the filesystem on the next boot.
122 .I error-behavior
123 can be one of the following:
124 .RS 1.2i
125 .TP 1.2i
126 .B continue
127 Continue normal execution.
128 .TP
129 .B remount-ro
130 Remount filesystem read-only.
131 .TP
132 .B panic
133 Cause a kernel panic.
134 .RE
135 .TP
136 .B \-f
137 Force the tune2fs operation to complete even in the face of errors.  This 
138 option is useful when removing the 
139 .B has_journal
140 filesystem feature from a filesystem which has 
141 an external journal (or is corrupted
142 such that it appears to have an external journal), but that 
143 external journal is not available.   
144 .sp
145 .B WARNING:
146 Removing an external journal from a filesystem which was not cleanly unmounted
147 without first replaying the external journal can result in
148 severe data loss and filesystem corruption.
149 .TP
150 .BI \-g " group"
151 Set the group which can use reserved filesystem blocks.
152 The 
153 .I group
154 parameter can be a numerical gid or a group name.  If a group name is given,
155 it is converted to a numerical gid before it is stored in the superblock.
156 .TP
157 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
158 Adjust the maximal time between two filesystem checks. 
159 No postfix or
160 .B d
161 result in days,
162 .B m
163 in months, and
164 .B w
165 in weeks.  A value of zero will disable the time-dependent checking.
166 .sp
167 It is strongly recommended that either
168 .B \-c
169 (mount-count-dependent) or
170 .B \-i
171 (time-dependent) checking be enabled to force periodic full
172 .BR e2fsck (8)
173 checking of the filesystem.  Failure to do so may lead to filesystem
174 corruption due to bad disks, cables, memory, or kernel bugs to go
175 unnoticed until they cause data loss or corruption.
176 .TP
177 .B \-j
178 Add an ext3 journal to the filesystem.  If the 
179 .B \-J
180 option is not specified, the default journal parameters will be used to create
181 an appropriately sized journal (given the size of the filesystem) 
182 stored within the filesystem.  Note that you must be using a kernel
183 which has ext3 support in order to actually make use of the journal.
184 .TP
185 .BR \-J " journal-options"
186 Override the default ext3 journal parameters. Journal options are comma
187 separated, and may take an argument using the equals ('=')  sign.
188 The following journal options are supported:
189 .RS 1.2i
190 .TP
191 .BI size= journal-size
192 Create a journal stored in the filesystem of size
193 .I journal-size
194 megabytes.   The size of the journal must be at least 1024 filesystem blocks
195 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
196 and may be no more than 102,400 filesystem blocks.
197 There must be enough free space in the filesystem to create a journal of
198 that size.
199 @JDEV@.TP
200 @JDEV@.BI device= external-journal
201 @JDEV@Attach the filesystem to the journal block device located on
202 @JDEV@.IR external-journal .
203 @JDEV@The external 
204 @JDEV@journal must have been already created using the command
205 @JDEV@.IP
206 @JDEV@.B mke2fs -O journal_dev 
207 @JDEV@.I external-journal
208 @JDEV@.IP
209 @JDEV@Note that
210 @JDEV@.I external-journal
211 @JDEV@must be formatted with the same block
212 @JDEV@size as filesystems which will be using it.
213 @JDEV@.IP
214 @JDEV@Instead of specifying a device name directly,
215 @JDEV@.I external-journal
216 @JDEV@can also be specified by either
217 @JDEV@.BI LABEL= label
218 @JDEV@or
219 @JDEV@.BI UUID= UUID
220 @JDEV@to locate the external journal by either the volume label or UUID
221 @JDEV@stored in the ext2 superblock at the start of the journal.  Use
222 @JDEV@.BR dumpe2fs (8)
223 @JDEV@to display a journal device's volume label and UUID.  See also the
224 @JDEV@.B -L
225 @JDEV@option of
226 @JDEV@.BR tune2fs (8).
227 .RE
228 @JDEV@.IP
229 @JDEV@Only one of the
230 @JDEV@.BR size " or " device
231 @JDEV@options can be given for a filesystem.
232 .TP
233 .B \-l
234 List the contents of the filesystem superblock.
235 .TP
236 .BI \-L " volume-label"
237 Set the volume label of the filesystem.  
238 Ext2 filesystem labels can be at most 16 characters long; if
239 .I volume-label 
240 is longer than 16 characters, 
241 .B tune2fs
242 will truncate it and print a warning.  The volume label can be used
243 by
244 .BR mount (8),
245 .BR fsck (8),
246 and
247 .BR /etc/fstab (5)
248 (and possibly others) by specifying
249 .BI LABEL= volume_label
250 instead of a block special device name like
251 .BR /dev/hda5 .
252 .TP
253 .BI \-m " reserved-blocks-percentage"
254 Set the percentage of reserved filesystem blocks.
255 .TP
256 .BI \-M " last-mounted-directory"
257 Set the last-mounted directory for the filesystem.
258 .TP
259 .BR \-O " [^]\fIfeature\fR[,...]"
260 Set or clear the indicated filesystem features (options) in the filesystem.
261 More than one filesystem feature can be cleared or set by separating
262 features with commas.  Filesystem features prefixed with a 
263 caret character ('^') will be cleared in the filesystem's superblock; 
264 filesystem features without a prefix character or prefixed with a plus 
265 character ('+') will be added to the filesystem.
266 .IP
267 The following filesystem features can be set or cleared using
268 .BR tune2fs :
269 .RS 1.2i
270 .TP
271 .B sparse_super
272 Limit the number of backup superblocks to save space on large filesystems.
273 .TP
274 .B filetype
275 Store file type information in directory entries.
276 .TP
277 .B has_journal
278 Create an ext3 journal (as if using the
279 .B \-j
280 option).
281 .RE
282 .IP
283 After setting or clearing 
284 .B sparse_super
285 and 
286 .B filetype 
287 filesystem features,
288 .BR e2fsck (8)
289 must be run on the filesystem to return the filesystem to a consistent state.
290 .B Tune2fs
291 will print a message requesting that the system administrator run
292 .BR e2fsck (8)
293 if necessary.
294 .IP
295 .B Warning:
296 Linux kernels before 2.0.39 and many 2.1 series kernels do not support
297 the filesystems that use any of these features.
298 Enabling certain filesystem features may prevent the filesystem from
299 being mounted by kernels which do not support those features.
300 .TP
301 .BI \-r " reserved-blocks-count"
302 Set the number of reserved filesystem blocks.
303 .TP
304 .BR \-s " [" 0 | 1 ]
305 Turn the sparse super feature off or on.  Turning this feature on
306 saves space on really big filesystems.  This is the same as using the
307 .B "\-O sparse_super"
308 option.
309 .IP
310 .B Warning:
311 Linux kernels before 2.0.39 do not support this feature.  Neither do
312 all Linux 2.1 kernels; please don't use this unless you know what you're
313 doing!  You need to run
314 .BR e2fsck (8)
315 on the filesystem after changing this feature in order to have a valid
316 filesystem.
317 .TP
318 .BI \-T " time-last-checked"
319 Set the time the filesystem was last checked using
320 .BR  e2fsck .
321 This can be useful in scripts which use a Logical Volume Manager to make
322 a consistent snapshot of a filesystem, and then check the filesystem 
323 during off hours to make sure it hasn't been corrupted due to 
324 hardware problems, etc.  If the filesystem was clean, then this option can 
325 be used to set the last checked time on the original filesystem.  The format 
326 of 
327 .I time-last-checked
328 is the international date format, with an optional time specifier, i.e.
329 YYYYMMDD[[HHMM]SS].   The keyword 
330 .B now
331 is also accepted, in which case the last checked time will be set to the 
332 current time.
333 .TP
334 .BI \-u " user"
335 Set the user who can use the reserved filesystem blocks.
336 .I user
337 can be a numerical uid or a user name.  If a user name is given, it 
338 is converted to a numerical uid before it is stored in the superblock.
339 .TP
340 .BI \-U " UUID"
341 Set the universally unique identifier (UUID) of the filesystem to
342 .IR UUID .
343 The format of the UUID is a series of hex digits separated by hyphens, 
344 like this: 
345 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  
346 The 
347 .I UUID
348 parameter may also be one of the following:
349 .RS 1.2i
350 .TP
351 .I clear
352 clear the filesystem UUID
353 .TP
354 .I random
355 generate a new randomly-generated UUID
356 .TP
357 .I time
358 generate a new time-based UUID
359 .RE
360 .IP
361 The UUID may be used by
362 .BR mount (8),
363 .BR fsck (8),
364 and
365 .BR /etc/fstab (5)
366 (and possibly others) by specifying
367 .BI UUID= uuid
368 instead of a block special device name like
369 .BR /dev/hda1 .
370 .IP
371 See
372 .BR uuidgen (8)
373 for more information.
374 If the system does not have a good random number generator such as
375 .I /dev/random
376 or
377 .IR /dev/urandom ,
378 .B tune2fs
379 will automatically use a time-based UUID instead of a randomly-generated UUID.
380 .SH BUGS
381 We haven't found any bugs yet.  That doesn't mean there aren't any...
382 .SH AUTHOR
383 .B tune2fs 
384 was written by Remy Card <Remy.Card@linux.org>.
385 .B tune2fs
386 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
387 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
388 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
389 .SH AVAILABILITY
390 .B tune2fs
391 is part of the e2fsprogs package and is available from 
392 http://e2fsprogs.sourceforge.net.
393 .SH SEE ALSO
394 .BR dumpe2fs (8),
395 .BR e2fsck (8),
396 .BR mke2fs (8)