NAME
mkfs - 创建一个 Linux 文件系统
总览
mkfs [ -V ] [ -t 文件系统类型 ] [ fs-选项 ] 文件系统 [ 块 ]
描述
mkfs mkfs 用来在指定设备创建一个 Linux 文件系统,通常是在硬盘上。 文件系统 既可以是设备名,(如: /dev/hda1, /dev/sdb2) 也可以是文件系统的挂载点,(如: /, /usr, /home)。 块 是指该文件系统用的块数。
如果 mkfs 成功执行时返回值为 0,反之,则是 1。
事实上, mkfs 是在 Linux 下各文件系统专用程序(mkfs.fstype)的前端程序。各文件系统专用程序可以在 /sbin, /sbin/fs, /sbin/fs.d, /etc/fs, /etc 等目录中找到,(精确定义一般都在编译内核时定义,但通常包含有 /sbin 和 /sbin/fs), 并最终在环境变量 PATH 列出的目录中.如要获取更多关于相应文件系统的创建工具的信息,可参考相应帮助手册。
选项
- -V
- 输出冗长的帮助信息,其中包括执行的各种系统相关的命令.一行命令中出现多个此参数可禁止所有系统相关命令的执行。这个做法实际上之是在测试时有用。
- -t 文件系统类型
- 指定所要创建的文件系统类型。如没有任何指定,则使用缺省的文件系统类型(目前是 ext2)。
- fs-选项
- 要传递给实际的文件系统制作工具的文件系统相关的选项。虽然我们不能保证,但是绝大部分文件系统制作工具支持下面的选项。
- -c
- 在创建文件系统之前进行设备坏块检查。
- -l filename
- 从指定文件 filename 中读取坏块信息。
- -v
- 产生冗长输出信息。
臭虫
所有通用选项须首先定义并且不能与文件系统相关的选项合并。一些指定文件系统创建工具不支持 -v 选项,也不会返回有意义的返回值。某些指定文件系统创建工具不会自动侦测磁盘设备的大小,因此需要声明 blocks 。
开发人员
David Engel (david@ods.com)
Fred N. van Kempen (waltje@uwalt.nl.mugnet.org)
Ron Sommeling (sommel@sci.kun.nl)
这个手册页是无耻地从 Remy Card 为 ext2 文件系统写的版本搞过来的。
又见
fs(5), badblocks(8), fsck(8), mkdosfs(8), mke2fs(8), mkfs.ext2(8), mkfs.minix(8), mkfs.msdos(8), mkfs.xiafs(8)
#p#
NAME
mkfs - build a Linux file system
SYNOPSIS
mkfs [ -V ] [ -t fstype ] [ fs-options ] filesys [ blocks ]
DESCRIPTION
mkfs is used to build a Linux file system on a device, usually a hard disk partition. filesys is either the device name (e.g. /dev/hda1, /dev/sdb2) or the mount point (e.g. /, /usr, /home) for the file system. blocks is the number of blocks to be used for the file system.
The exit code returned by mkfs is 0 on success and 1 on failure.
In actuality, mkfs is simply a front-end for the various file system builders (mkfs.fstype) available under Linux. The file system-specific builder is searched for in a number of directories like perhaps /sbin, /sbin/fs, /sbin/fs.d, /etc/fs, /etc (the precise list is defined at compile time but at least contains /sbin and /sbin/fs), and finally in the directories listed in the PATH enviroment variable. Please see the file system-specific builder manual pages for further details.
OPTIONS
- -V
- Produce verbose output, including all file system-specific commands that are executed. Specifying this option more than once inhibits execution of any file system-specific commands. This is really only useful for testing.
- -t fstype
- Specifies the type of file system to be built. If not specified, the default file system type (currently ext2) is used.
- fs-options
- File system-specific options to be passed to the real file system builder. Although not guaranteed, the following options are supported by most file system builders.
- -c
- Check the device for bad blocks before building the file system.
- -l filename
- Read the bad blocks list from filename
- -v
- Produce verbose output.
BUGS
All generic options must precede and not be combined with file system-specific options. Some file system-specific programs do not support the -v (verbose) option, nor return meaningful exit codes. Also, some file system-specific programs do not automatically detect the device size and require the blocks parameter to be specified.
AUTHORS
David Engel (david@ods.com)
Fred N. van Kempen (waltje@uwalt.nl.mugnet.org)
Ron Sommeling (sommel@sci.kun.nl)
The manual page was shamelessly adapted from Remy Card's version for the ext2 file system.
SEE ALSO
fs(5), badblocks(8), fsck(8), mkdosfs(8), mke2fs(8), mkfs.bfs(8), mkfs.ext2(8), mkfs.ext3(8), mkfs.minix(8), mkfs.msdos(8), mkfs.vfat(8), mkfs.xfs(8), mkfs.xiafs(8)