mkfs
瑞兹 发表于 2021-02-01 09:10浏览次数:
在类似Unix的操作系统上,mkfs命令创建并构建一个文件系统。
On Unix-like operating systems, the mkfs command creates and builds a file system.
目录:
1 mkfs 运行系统环境
2 mkfs 描述
3 mkfs 语法
4 mkfs 例子
mkfs 运行系统环境
mkfs 描述
mkfs用于在设备(通常是硬盘 分区)上构建Linux文件系统。所述设备 参数是任一的设备名称(例如,/ dev / hda1,/ dev / sdb2),或一个普通的文件将包含文件系统。的尺寸参数是将被用于文件系统的块的数量。
mkfs返回的退出状态成功时为0,失败时为1。
实际上,mkfs是Linux下可用的各种文件系统构建器(mkfs.fstype)的前端。在许多目录中搜索特定于文件系统的构建器,例如/ sbin,/ sbin / fs,/sbin/ fs.d,/ etc / fs,/ etc(精确列表在编译时定义,但至少包含/ sbin和/ sbin / fs),最后包含在PATH环境变量中列出的目录中。请参阅特定于文件系统的构建器手册页以获取更多详细信息。
mkfs is used to build a Linux file system on a device, usually a hard disk partition. The device argument is either the device name (e.g., /dev/hda1, /dev/sdb2), or a regular file that will contain the file system. The size argument is the number of blocks to be used for the file system.
The exit status returned by mkfs is 0 on success and 1 on failure.
In actuality, mkfs is a front-end for the various file system builders (mkfs.fstype) available under Linux. The filesystem-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 environment variable. Please see your filesystem-specific builder manual pages for further details.
mkfs 语法
mkfs [options] [-t type fs-options] device [size]
选件
-t,-- typ type
|
指定要构建的文件系统的类型。如果未指定,则使用默认文件系统类型(当前为ext2)。
|
fs-options
|
特定于文件系统的选项将传递给真实文件系统构建器。尽管不能保证,但是大多数文件系统构建器都支持以下选项。
|
-V,--verbose
|
产生详细的输出,包括所有已执行的文件系统特定命令。多次指定此选项会禁止执行任何特定于文件系统的命令。这实际上仅对测试有用。
|
-V,--version
|
显示版本信息并退出。选项-V仅在它是唯一参数时才显示版本信息,否则它将作为--verbose使用。
|
-h,--help
|
显示帮助并退出。
|
mkfs [options] [-t type fs-options] device [size]
Options
-t, --type type
|
Specify the type of file system to be built. If not specified, the default file system type (currently ext2) is used.
|
fs-options
|
Filesystem-specific options to be passed to the real file system builder. Although not guaranteed, the following options are supported by most file system builders.
|
-V, --verbose
|
Produce verbose output, including all filesystem-specific commands that are executed. Specifying this option more than once inhibits execution of any filesystem-specific commands. This is really only useful for testing.
|
-V, --version
|
Display version information and exit. Option -V displays version information only when it is the only parameter, otherwise it will work as --verbose.
|
-h, --help
|
Display help and exit.
|
mkfs 例子
mkfs -t ext2 /dev/fd0
上面的示例将在第一个软盘驱动器的软盘上创建ext2文件系统。
mkfs -t ext2 /dev/fd0
The above example would create an ext2 file system on a floppy diskette in the first floppy drive.
未知的网友