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