~ubuntu-branches/ubuntu/utopic/xfsprogs/utopic-proposed

« back to all changes in this revision

Viewing changes to man/man8/mkfs.xfs.8

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2002-04-13 09:45:06 UTC
  • Revision ID: james.westby@ubuntu.com-20020413094506-t8dhemv41gkeg4kx
Tags: 2.0.3-1
New upstream bugfix release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH mkfs.xfs 8
 
2
.SH NAME
 
3
mkfs.xfs \- construct an XFS filesystem
 
4
.SH SYNOPSIS
 
5
.nf
 
6
\f3mkfs.xfs\f1 [ \f3\-b\f1 subopt=value ] [ \f3\-d\f1 subopt[=value] ]
 
7
        [ \f3\-i\f1 subopt=value ] [ \f3\-l\f1 subopt[=value] ]
 
8
        [ \f3\-n\f1 subopt[=value] ] [ \f3\-p\f1 protofile ] [ \f3\-q\f1 ]
 
9
        [ \f3\-r\f1 subopt[=value] ] [ \f3\-C\f1 ] [ \f3\-L\f1 label ] device
 
10
.fi
 
11
.SH DESCRIPTION
 
12
.I mkfs.xfs
 
13
constructs an XFS filesystem by writing on a special
 
14
file using the values found in the arguments of the command line.
 
15
It is invoked automatically by \f2mkfs\f1(8) when \f2mkfs\f1 is
 
16
given the \f3\-t xfs\f1 option.
 
17
.PP
 
18
In its simplest (and most commonly used form), the size of the
 
19
filesystem is determined from the disk driver.  As an example, to make
 
20
a filesystem with an internal log on the first partition on the first
 
21
SCSI disk, use:
 
22
.PP
 
23
.nf
 
24
        mkfs.xfs /dev/sda1
 
25
.fi
 
26
.PP
 
27
The metadata log can be placed on another device to reduce the number
 
28
of disk seeks.  To create a filesystem on the first partition on the
 
29
first SCSI disk with a 10000 block log located on the first partition
 
30
on the second SCSI disk, use:
 
31
.PP
 
32
.nf
 
33
        mkfs.xfs -l logdev=/dev/sdb1,size=10000b /dev/sda1
 
34
.fi
 
35
.PP
 
36
Each of the
 
37
.I subopt=value
 
38
elements in the argument list above can be given as multiple comma-separated
 
39
.I subopt=value
 
40
suboptions if multiple suboptions apply to the same option.
 
41
Equivalently, each main option can be given multiple times with
 
42
different suboptions.
 
43
For example,
 
44
.B \-l internal,size=10000b
 
45
and
 
46
.B \-l internal \-l size=10000b
 
47
are equivalent.
 
48
.PP
 
49
In the descriptions below, sizes are given in bytes, blocks, kilobytes,
 
50
or megabytes.
 
51
Sizes are treated as hexadecimal if prefixed by 0x or 0X,
 
52
octal if prefixed by 0, or decimal otherwise.
 
53
If suffixed with \f3b\f1 then the size is converted by multiplying it
 
54
by the filesystem's block size.
 
55
If suffixed with \f3k\f1 then the size is converted by multiplying it by 1024.
 
56
If suffixed with \f3m\f1 then the size is converted by multiplying it by
 
57
1048576 (1024 * 1024).
 
58
If suffixed with \f3g\f1 then the size is converted by multiplying it by
 
59
1073741824 (1024 * 1024 * 1024).
 
60
.TP
 
61
.B \-b
 
62
Block size options.
 
63
.IP
 
64
This option specifies the fundamental block size of the filesystem.
 
65
The valid suboptions are:
 
66
.BI log= value
 
67
and
 
68
\f3size=\f1\f2value\f1;
 
69
only one can be supplied.
 
70
The block size is specified either as a base two logarithm value with
 
71
.BR log= ,
 
72
or in bytes with
 
73
.BR size= .
 
74
The default value is 4096 bytes (4 KB) on systems with a 4KB pagesize.
 
75
The minimum value for block size is 512; the maximum is 65536 (64 KB).
 
76
XFS on Linux currently only supports pagesize blocks.
 
77
.TP
 
78
.B \-d
 
79
Data section options.
 
80
.IP
 
81
These options specify the location, size, and other parameters of the
 
82
data section of the filesystem.
 
83
The valid suboptions are:
 
84
\f3agcount=\f1\f2value\f1,
 
85
\f3agsize=\f1\f2value\f1,
 
86
\f3file\f1[\f3=\f1\f2value\f1],
 
87
\f3name=\f1\f2value\f1,
 
88
\f3size=\f1\f2value\f1,
 
89
\f3sunit=\f1\f2value\f1,
 
90
\f3swidth=\f1\f2value\f1,
 
91
\f3su=\f1\f2value\f1,
 
92
\f3sw=\f1\f2value\f1,
 
93
and
 
94
\f3unwritten\f1[\f3=\f1\f2value\f1].
 
95
.IP
 
96
The
 
97
.B agcount
 
98
suboption is used to specify the number of allocation groups.
 
99
The data section of the filesystem is divided into allocation groups
 
100
to improve the performance of XFS.
 
101
More allocation groups imply that more parallelism can be achieved
 
102
when allocating blocks and inodes.
 
103
The minimum allocation group size is 16 MB;
 
104
the maximum size is just under 4 GB.
 
105
The data section of the filesystem is divided into
 
106
.I agcount
 
107
allocation groups (default value 8, unless the filesystem is smaller
 
108
than 128 MB or larger than 8 GB).
 
109
Setting
 
110
.I agcount
 
111
to a very large number should be avoided, since this causes an unreasonable
 
112
amount of CPU time to be used when the filesystem is close to full.
 
113
.IP
 
114
The
 
115
.B agsize
 
116
suboption is an alternative to using
 
117
.B agcount.
 
118
The argument provided to
 
119
.B agsize
 
120
is the desired size of the allocation group expressed in bytes
 
121
(usually using the \f3m\f1 or \f3g\f1 suffixes).
 
122
This value must be a multiple of the filesystem block size, and
 
123
must be at least 16MB, and no more than 4GB, and may
 
124
be automatically adjusted to properly align with the stripe geometry.
 
125
The
 
126
.B agcount
 
127
suboption and the
 
128
.B agsize
 
129
suboption are mutually exclusive.
 
130
.IP
 
131
The
 
132
.B name
 
133
suboption can be used to specify the name of the special file containing
 
134
the filesystem.
 
135
In this case, the log section must be specified as
 
136
.B internal
 
137
(with a size, see the
 
138
.B \-l
 
139
option below) and there can be no real-time section.
 
140
.IP
 
141
The
 
142
.B file
 
143
suboption is used to specify that the file given by the
 
144
.B name
 
145
suboption is a regular file.
 
146
The suboption value is either 0 or 1,
 
147
with 1 signifying that the file is regular.
 
148
This suboption is used only to make a filesystem image.
 
149
If the value is omitted then 1 is assumed.
 
150
.IP
 
151
The
 
152
.B size
 
153
suboption is used to specify the size of the data section.
 
154
This suboption is required if
 
155
.B \-d file[=1]
 
156
is given.
 
157
Otherwise, it is only needed if the filesystem should occupy
 
158
less space than the size of the special file.
 
159
.IP
 
160
The
 
161
.B sunit
 
162
suboption is used to specify the stripe unit for a RAID device or a
 
163
logical volume.
 
164
The suboption value has to be specified in 512-byte block units.
 
165
Use the
 
166
.B su
 
167
suboption to specify the stripe unit size in bytes.
 
168
This suboption ensures that data allocations will be stripe unit aligned
 
169
when the current end of file is being extended and the file size is larger
 
170
than 512KB.
 
171
Also inode allocations and the internal log will be stripe unit aligned.
 
172
.IP
 
173
The
 
174
.B su
 
175
suboption is an alternative to using
 
176
.B sunit.
 
177
The
 
178
.B su
 
179
suboption is used to specify the stripe unit for a RAID device or a
 
180
striped logical volume.
 
181
The suboption value has to be specified in bytes,
 
182
(usually using the \f3m\f1 or \f3g\f1 suffixes).
 
183
This value must be a multiple of the filesystem block size.
 
184
.IP
 
185
The
 
186
.B swidth
 
187
suboption is used to specify the stripe width for a RAID device or a
 
188
striped logical volume.
 
189
The suboption value has to be specified in 512-byte block units.
 
190
Use the
 
191
.B sw
 
192
suboption to specify the stripe width size in bytes.
 
193
This suboption is required if
 
194
.B \-d sunit
 
195
has been specified and it has to be a multiple of the 
 
196
.B \-d sunit 
 
197
suboption.
 
198
The stripe width will be the preferred iosize returned in the 
 
199
.IR stat (2)
 
200
system call.
 
201
.IP
 
202
The
 
203
.B sw
 
204
suboption is an alternative to using
 
205
.B swidth.
 
206
The
 
207
.B sw
 
208
suboption is used to specify the stripe width for a RAID device or
 
209
striped logical volume.
 
210
The suboption value is expressed as a multiplier of the stripe unit,
 
211
usually the same as the number of stripe members in the logical
 
212
volume configuration, or data disks in a RAID device.
 
213
.IP
 
214
When a filesystem is created on a logical volume device,
 
215
.I mkfs.xfs
 
216
will automatically query the logical volume for appropriate 
 
217
.B sunit
 
218
and
 
219
.B swidth
 
220
values.
 
221
.IP
 
222
The
 
223
.B unwritten
 
224
suboption is used to specify whether unwritten extents are flagged as such,
 
225
or not.
 
226
The suboption value is either 0 or 1, with 1 signifying that unwritten
 
227
extent flagging should occur.
 
228
If the suboption is omitted, unwritten extent flagging is enabled.
 
229
If unwritten extents are flagged, filesystem write performance
 
230
will be negatively affected for preallocated file extents, since
 
231
extra filesystem transactions are required to convert extent flags 
 
232
for the range of the file written.
 
233
This suboption should be disabled if the filesystem
 
234
needs to be used on operating system versions which do not support the
 
235
flagging capability.
 
236
.TP
 
237
.B \-i
 
238
Inode options.
 
239
.IP
 
240
This option specifies the inode size of the filesystem, and other
 
241
inode allocation parameters.
 
242
The XFS inode contains a fixed-size part and a variable-size part.
 
243
The variable-size part, whose size is affected by this option, can contain:
 
244
directory data, for small directories;
 
245
attribute data, for small attribute sets;
 
246
symbolic link data, for small symbolic links;
 
247
the extent list for the file, for files with a small number of extents;
 
248
and the root of a tree describing the location of extents for the file,
 
249
for files with a large number of extents.
 
250
.IP
 
251
The valid suboptions for specifying inode size are:
 
252
\f3log=\f1\f2value\f1,
 
253
\f3perblock=\f1\f2value\f1,
 
254
and
 
255
\f3size=\f1\f2value\f1;
 
256
only one can be supplied.
 
257
The inode size is specified either as a base two logarithm value with
 
258
.BR log= ,
 
259
in bytes with
 
260
.BR size= ,
 
261
or as the number fitting in a filesystem block with
 
262
.BR perblock= .
 
263
The mininum (and default) value is 256 bytes.
 
264
The maximum value is 2048 (2 KB) subject to the restriction that
 
265
the inode size cannot exceed one half of the filesystem block size.
 
266
.IP
 
267
XFS uses 64-bit inode numbers internally; however, the number of
 
268
significant bits in an inode number
 
269
is affected by filesystem geometry.  In
 
270
practice, filesystem size and inode size are the predominant factors.
 
271
The Linux kernel and most applications cannot currently handle
 
272
inode numbers greater than 32 significant bits, so if no
 
273
inode size is given on the command line, 
 
274
.I mkfs.xfs
 
275
will attempt to choose a size
 
276
such that inode numbers will be < 32 bits.  If an inode size
 
277
is specified, or if a filesystem is sufficently large,
 
278
.I mkfs.xfs
 
279
will warn if this will create inode numbers > 32 significant
 
280
bits.
 
281
.IP
 
282
The option \f3maxpct=\f1\f2value\f1 specifies the maximum percentage
 
283
of space in the filesystem that can be allocated to inodes.
 
284
The default value is 25%.
 
285
Setting the value to 0 means that
 
286
essentially all of the filesystem can become inode blocks.
 
287
.IP
 
288
The option
 
289
.BI align[= value ]
 
290
is used to specify that inode allocation is or is not aligned.
 
291
The value is either 0 or 1,
 
292
with 1 signifying that inodes are allocated aligned.
 
293
If the value is omitted, 1 is assumed.
 
294
The default is that inodes are aligned.
 
295
Aligned inode access is normally more efficient than unaligned access;
 
296
alignment must be established at the time the filesystem is created,
 
297
since inodes are allocated at that time.
 
298
This option can be used to turn off inode alignment when the
 
299
filesystem needs to be mountable by a version of IRIX
 
300
that does not have the inode alignment feature
 
301
(any release of IRIX before 6.2, and IRIX 6.2 without XFS patches).
 
302
.TP
 
303
.B \-l
 
304
Log section options.
 
305
.IP
 
306
These options specify the location, size, and other parameters of the
 
307
log section of the filesystem.
 
308
The valid suboptions are:
 
309
.BI internal[= value ]
 
310
and
 
311
\f3size=\f1\f2value\f1.
 
312
.IP
 
313
The
 
314
.B internal
 
315
suboption is used to specify that the log section is a piece of
 
316
the data section instead of being another device or logical volume.
 
317
The suboption value is either 0 or 1,
 
318
with 1 signifying that the log is internal.
 
319
If the value is omitted, 1 is assumed.
 
320
.IP
 
321
The
 
322
.B size
 
323
suboption is used to specify the size of the log section.
 
324
.IP
 
325
If the log is contained within the data section and 
 
326
.B size
 
327
isn't specified,
 
328
.I mkfs.xfs
 
329
will try to select a suitable log size depending
 
330
on the size of the filesystem.  The actual logsize depends on the
 
331
filesystem block size and the directory block size.
 
332
.IP
 
333
Otherwise, the
 
334
.B size
 
335
option is only needed if the log section of the filesystem
 
336
should occupy less space than the size of the special file.
 
337
The size is specified in bytes or blocks, with a \f3b\f1 suffix 
 
338
meaning multiplication by the filesystem block size, as described above.
 
339
The overriding minimum value for size is 512 blocks.
 
340
With some combinations of filesystem block size, inode size,
 
341
and directory block size, the minimum log size is larger than 512 blocks.
 
342
.TP
 
343
.B \-n
 
344
Naming options.
 
345
.IP
 
346
These options specify the version and size parameters for the naming
 
347
(directory) area of the filesystem.
 
348
The valid suboptions are:
 
349
\f3log=\f1\f2value\f1,
 
350
\f3size=\f1\f2value\f1,
 
351
and
 
352
\f3version=\f1\f2value\f1.
 
353
The naming (directory) version is 1 or 2,
 
354
defaulting to 2 if unspecified.
 
355
With version 2 directories,
 
356
the directory block size can be any power of 2 size
 
357
from the filesystem block size up to 65536.
 
358
The block size is specified either as a base two logarithm value with
 
359
.BR log= ,
 
360
or in bytes with
 
361
.BR size= .
 
362
The default size value for version 2 directories is 4096 bytes (4 KB), 
 
363
unless the filesystem block size is larger than 4096,
 
364
in which case the default value is the filesystem block size.
 
365
For version 1 directories the block size is the same as the 
 
366
filesystem block size.
 
367
.TP
 
368
\f3\-p\f1 \f2protofile\f1
 
369
If the optional
 
370
.B \-p
 
371
.I protofile
 
372
argument is given,
 
373
.I mkfs.xfs
 
374
uses
 
375
.I protofile
 
376
as a prototype file
 
377
and takes its directions from that file.
 
378
The blocks and inodes
 
379
specifiers in the
 
380
.I protofile
 
381
are provided for backwards compatibility, but are otherwise unused.
 
382
The prototype file
 
383
contains tokens separated by spaces or
 
384
newlines.
 
385
A sample prototype specification follows (line numbers have been added to
 
386
aid in the explanation):
 
387
.nf
 
388
.sp .8v
 
389
.in +5
 
390
\f71       /stand/\f1\f2diskboot\f1\f7
 
391
2       4872 110
 
392
3       d--777 3 1
 
393
4       usr     d--777 3 1
 
394
5       sh      ---755 3 1 /bin/sh
 
395
6       ken     d--755 6 1
 
396
7               $
 
397
8       b0      b--644 3 1 0 0
 
398
9       c0      c--644 3 1 0 0
 
399
10      fifo    p--644 3 1
 
400
11      slink   l--644 3 1 /a/symbolic/link
 
401
12      :  This is a comment line
 
402
13      $
 
403
14      $\f1
 
404
.in -5
 
405
.fi
 
406
.IP
 
407
Line 1 is a dummy string.
 
408
(It was formerly the bootfilename.)
 
409
It is present for backward
 
410
compatibility; boot blocks are not used on SGI systems.
 
411
.IP
 
412
Note that some string of characters must be present as the first line of
 
413
the proto file to cause it to be parsed correctly; the value
 
414
of this string is immaterial since it is ignored.
 
415
.IP
 
416
Line 2 contains two numeric values (formerly the numbers of blocks and inodes).
 
417
These are also merely for backward compatibility: two numeric values must
 
418
appear at this point for the proto file to be correctly parsed,
 
419
but their values are immaterial since they are ignored.
 
420
.IP
 
421
Lines 3-11 tell
 
422
.I mkfs.xfs
 
423
about files and directories to
 
424
be included in this filesystem.
 
425
Line 3 specifies the root directory.
 
426
Lines 4-6 and 8-10 specifies other directories and files.
 
427
Note the special symbolic link syntax on line 11.
 
428
.IP
 
429
The
 
430
.B $
 
431
on line 7 tells
 
432
.I mkfs.xfs
 
433
to end the branch of the filesystem it is on, and continue
 
434
from the next higher directory.
 
435
It must be the last character
 
436
on a line.
 
437
The colon
 
438
on line 12 introduces a comment; all characters up until the
 
439
following newline are ignored.
 
440
Note that this means you cannot
 
441
have a file in a prototype file whose name contains a colon.
 
442
The
 
443
.B $
 
444
on lines 13 and 14 end the process, since no additional
 
445
specifications follow.
 
446
.IP
 
447
File specifications give the mode,
 
448
the user ID,
 
449
the group ID,
 
450
and the initial contents of the file.
 
451
Valid syntax for the contents field
 
452
depends on the first character of the mode.
 
453
.IP
 
454
The mode for a file is specified by a 6-character string.
 
455
The first character
 
456
specifies the type of the file.
 
457
The character range is
 
458
.B \-bcdpl
 
459
to specify regular, block special,
 
460
character special, directory files, named pipes (fifos), and symbolic
 
461
links, respectively.
 
462
The second character of the mode
 
463
is either
 
464
.B u
 
465
or
 
466
.B \-
 
467
to specify setuserID mode or not.
 
468
The third is
 
469
.B g
 
470
or
 
471
.B \-
 
472
for the setgroupID mode.
 
473
The rest of the mode
 
474
is a three digit octal number giving the
 
475
owner, group, and other read, write, execute
 
476
permissions (see
 
477
.IR chmod (1)).
 
478
.IP
 
479
Two decimal number
 
480
tokens come after the mode; they specify the
 
481
user and group IDs of the owner of the file.
 
482
.IP
 
483
If the file is a regular file,
 
484
the next token of the specification can be a pathname
 
485
from which the contents and size are copied.
 
486
If the file is a block or character special file,
 
487
two decimal numbers
 
488
follow that give the major and minor device numbers.
 
489
If the file is a symbolic link, the next token of the specification
 
490
is used as the contents of the link.
 
491
If the file is a directory,
 
492
.I mkfs.xfs
 
493
makes the entries
 
494
.BR . ""
 
495
and
 
496
.B  ..
 
497
and then
 
498
reads a list of names and
 
499
(recursively)
 
500
file specifications for the entries
 
501
in the directory.
 
502
As noted above, the scan is terminated with the
 
503
token
 
504
.BR $ .
 
505
.TP
 
506
.B \-q
 
507
Quiet option.
 
508
.IP
 
509
Normally
 
510
.I mkfs.xfs
 
511
prints the parameters of the filesystem
 
512
to be constructed;
 
513
the
 
514
.B \-q
 
515
flag suppresses this.
 
516
.TP
 
517
.B \-r
 
518
Real-time section options.
 
519
.IP
 
520
These options specify the location, size, and other parameters of the
 
521
real-time section of the filesystem.
 
522
The valid suboptions are:
 
523
.BI extsize= value
 
524
and
 
525
\f3size=\f1\f2value\f1.
 
526
.IP
 
527
The
 
528
.B extsize
 
529
suboption is used to specify the size of the blocks in the real-time
 
530
section of the filesystem.
 
531
This size must be a multiple of the filesystem block size.
 
532
The minimum allowed value is the filesystem block size
 
533
or 4 KB (whichever is larger);
 
534
the default value is the stripe width for striped volumes or 64 KB for
 
535
non-striped volumes;
 
536
the maximum allowed value is 1 GB.
 
537
The real-time extent size should be carefully chosen to match the
 
538
parameters of the physical media used.
 
539
.IP
 
540
The
 
541
.B size
 
542
suboption is used to specify the size of the real-time section.
 
543
This suboption is only needed if the real-time section of the
 
544
filesystem should occupy
 
545
less space than the size of the partition or logical volume containing the section.
 
546
.TP
 
547
.B \-C
 
548
Disable overlapping partition/volume checks.
 
549
.IP
 
550
By default \f2mkfs.xfs\f1 checks to see if the destination partition or logical
 
551
volume overlaps any mounted or reserved partitions in the system.  If an
 
552
overlap or mount conflict is found, the user will be notified and prevented
 
553
from potentially corrupting the existing data.  For systems with
 
554
a large number of disks, this additional checking may add noticable overhead
 
555
to the command's execution time.  For situations where command performance is
 
556
necessary, this switch may be used to disable the safeguards.  Due to the
 
557
potential for user-error causing corrupted filesystems or other on-disk
 
558
data corruption, we strongly discourage use of this switch in normal operation.
 
559
.TP
 
560
\f3\-L\f1 \f2label\f1
 
561
Set the filesystem label.
 
562
XFS filesystem labels can be at most 12 characters long; if
 
563
.I label
 
564
is longer than 12 characters,
 
565
.I mkfs.xfs
 
566
will not proceed with creating the filesystem.  Refer to the
 
567
.IR mount (8)
 
568
and
 
569
.IR xfs_admin (8)
 
570
manual entries for additional information.
 
571
.SH SEE ALSO
 
572
mkfs(8),
 
573
mount(8),
 
574
xfs_admin(8).
 
575
.SH BUGS
 
576
With a prototype file, it is not possible to specify hard links.