]> git.ipfire.org Git - thirdparty/util-linux.git/blob - disk-utils/mkfs.8
Merge branch 'docs-dir' of https://github.com/kerolasa/lelux-utiliteetit
[thirdparty/util-linux.git] / disk-utils / mkfs.8
1 .\" -*- nroff -*-
2 .TH MKFS 8 "June 2011" "util-linux" "System Administration"
3 .SH NAME
4 mkfs \- build a Linux filesystem
5 .SH SYNOPSIS
6 .SH SYNOPSIS
7 .B mkfs
8 .RI [ options ]
9 .RB [ \-t
10 .IR "type fs-options" ] " device " [ size ]
11 .SH DESCRIPTION
12 .B mkfs
13 is used to build a Linux filesystem on a device, usually
14 a hard disk partition. The
15 .I device
16 argument is either the device name (e.g.
17 .IR /dev/hda1 ,
18 .IR /dev/sdb2 ),
19 or a regular file that shall contain the filesystem. The
20 .I size
21 argument is the number of blocks to be used for the filesystem.
22 .PP
23 The exit code returned by
24 .B mkfs
25 is 0 on success and 1 on failure.
26 .PP
27 In actuality,
28 .B mkfs
29 is simply a front-end for the various filesystem builders
30 (\fBmkfs.\fIfstype\fR)
31 available under Linux.
32 The filesystem-specific builder is searched for in a number
33 of directories, like perhaps
34 .IR /sbin ,
35 .IR /sbin/fs ,
36 .IR /sbin/fs.d ,
37 .IR /etc/fs ,
38 .I /etc
39 (the precise list is defined at compile time but at least
40 contains
41 .I /sbin
42 and
43 .IR /sbin/fs ),
44 and finally in the directories
45 listed in the PATH environment variable.
46 Please see the filesystem-specific builder manual pages for
47 further details.
48 .SH OPTIONS
49 .TP
50 .BR \-t , " \-\-type " \fItype\fR
51 Specify the \fItype\fR of filesystem to be built.
52 If not specified, the default filesystem type
53 (currently ext2) is used.
54 .TP
55 .I fs-options
56 Filesystem-specific options to be passed to the real filesystem builder.
57 Although not guaranteed, the following options are supported
58 by most filesystem builders.
59 .TP
60 .BR \-V , " \-\-verbose"
61 Produce verbose output, including all filesystem-specific commands
62 that are executed.
63 Specifying this option more than once inhibits execution of any
64 filesystem-specific commands.
65 This is really only useful for testing.
66 .TP
67 .BR \-V , " \-\-version"
68 Display version information and exit. (Option \fB\-V\fR will display
69 version information only when it is the only parameter, otherwise it
70 will work as \fB\-\-verbose\fR.)
71 .TP
72 .BR \-h , " \-\-help"
73 Display help and exit.
74 .SH BUGS
75 All generic options must precede and not be combined with
76 filesystem-specific options.
77 Some filesystem-specific programs do not support the
78 .B -V
79 (verbose) option, nor return meaningful exit codes.
80 Also, some filesystem-specific programs do not automatically
81 detect the device size and require the
82 .I size
83 parameter to be specified.
84 .SH AUTHORS
85 David Engel (david@ods.com)
86 .br
87 Fred N. van Kempen (waltje@uwalt.nl.mugnet.org)
88 .br
89 Ron Sommeling (sommel@sci.kun.nl)
90 .br
91 The manual page was shamelessly adapted from Remy Card's version
92 for the ext2 filesystem.
93 .SH SEE ALSO
94 .BR fs (5),
95 .BR badblocks (8),
96 .BR fsck (8),
97 .BR mkdosfs (8),
98 .BR mke2fs (8),
99 .BR mkfs.bfs (8),
100 .BR mkfs.ext2 (8),
101 .BR mkfs.ext3 (8),
102 .BR mkfs.ext4 (8),
103 .BR mkfs.minix (8),
104 .BR mkfs.msdos (8),
105 .BR mkfs.vfat (8),
106 .BR mkfs.xfs (8),
107 .BR mkfs.xiafs (8)
108 .SH AVAILABILITY
109 The mkfs command is part of the util-linux package and is available from
110 ftp://ftp.kernel.org/pub/linux/utils/util-linux/.