Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

mkfs

From Wikipedia, the free encyclopedia
Command used to format with file system
mkfs
Original author(s)Ken Thompson,
Dennis Ritchie
Developer(s)AT&T Bell Laboratories
Initial release1979; 46 years ago (1979)
Operating systemUnix andUnix-like
TypeCommand

In computer operating systems,mkfs is acommand used toformat a block storage device with a specificfile system. The command is part ofUnix andUnix-likeoperating systems. In Unix, ablock storage device must be formatted with a file system before it can bemounted and accessed through the operating system'sfilesystem hierarchy.

History

[edit]

The command was originally implemented in the first version of Unix as a method to initialize either aDECtape (using the "t" argument) or anRK03 disk pack (using the "r" argument).[1] The initialization process would write formatting data to the device so that it contained an empty file system. It created the super-block, i-list, and free list on the storage device and established the root directory with entries for "." and ".." (self and parent, respectively). The RK03 disk packs had 4872 available blocks after initialization, while the tapes had 578 blocks (at 512 bytes/block).[2] The mkfs executable was kept in the /etc directory instead of a binary directory so it would not be inadvertently called and destroy information.

Later implementations of Unix-like operating systems included the mkfs command, includingHP-UX,[3]Minix,[4]SunOS[5] andLinux.[6]

Syntax

[edit]

The basic syntax of the command, which is common to all modern implementations, is:

$mkfs-t<fstype><device>

where 'fs type' is the type of the filesystem and 'device' is the target UNIX device to write the filesystem data to. Usually the "device" is a drive partition. Often the command is simply awrapper for another command that performs the formatting for a specific file system. For example,

$mkfs-text3/dev/sda1

would call the commandmke2fs while passing along the appropriate arguments to format the device/dev/sda1 with the ext3 filesystem. The default options for the command are stored in the filemke2fs.conf, usually in the/etc directory. Depending on the implementation and the specific file system requested, the command may have many options that can be specified such as inode size, block size, volume label, and other features.[7] (Seefile system for details)

The filesystem-specific commands that mkfs calls may be invoked directly by the user from the command line. In Linux, the convention has been to name the filesystem-specific commands as:mkfs.<fs-type>. Where<fs-type> is an abbreviation for the file system, e.g.,mkfs.ext2,mkfs.msdos,mkfs.minix, etc. File systems supported by the command vary by implementation and include: MSDOS, SCO bfs, CPM, ext2, ext3, ext4, minix, fat (vfat), HFS, VXFS, RF disk, RK disk, DECtape, and NTFS.

See also

[edit]
  • dd — convert and copy a file
  • e2fsprogs — a set of utilities for maintaining the ext2, ext3 and ext4 file systems
  • fdisk — examine and write partition table
  • fsck — file system check
  • mkisofs — make an iso file system
  • mount — mount a file system
  • parted — partition manager

References

[edit]
  1. ^"mkfs(1) - Unix First Edition Manual Page". Man.cat-v.org. Retrieved2013-04-30.
  2. ^"file(5) - Unix First Edition Manual Page". Man.cat-v.org. 1971-01-01. Retrieved2013-04-30.
  3. ^HP-UX 11i Version 3. Hewlett-Packard Company. September 2010 (PDF)[permanent dead link]
  4. ^"MKFS 1". Minix3.org. Archived fromthe original on 2013-07-02. Retrieved2013-04-30.
  5. ^"SunOS 5.10. 17 Nov 2000". Archived fromthe original on 26 November 2005. Retrieved2 February 2013.
  6. ^The Linux man-pages Project
  7. ^"E2fsprogs version 1.41.9. August 2009". Archived fromthe original on 2013-02-17. Retrieved2013-02-02.

External links

[edit]
File system
Processes
User environment
Text processing
Shell builtins
Searching
Documentation
Software development
Miscellaneous
Retrieved from "https://en.wikipedia.org/w/index.php?title=Mkfs&oldid=1277344438"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp