Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a220dd82e9b0cb43

Jump to content

mkfs

From Wikipedia, the free encyclopedia
mkfs
Original authorsKen Thompson,
Dennis Ritchie
DeveloperAT&T Bell Laboratories
Release1979; 47 years ago (1979)
Operating systemUnix and Unix-like
TypeCommand

In Unix and Unix-like operating systems, mkfs and newfs are commands used to format a block storage device with a specific file system. In those systems, a block storage device must be formatted with a file system before it can be mounted and accessed through the operating system's filesystem hierarchy.

History

[edit]

The mkfs command was originally implemented in the first version of Unix as a method to initialize either a DECtape (using the "t" argument) or an RK03 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.

In Version 6 Unix, mkfs took, as its second argument, the name of a file containing parameters to be used when creating the file system; if the file cannot be opened, it is treated as the number of blocks in the partition in which the file system is being created.[3] The mkfs in Version 7 Unix was the same.[4] Unix System III added some optional arguments.[5]

4.2BSD added newfs as a front end for mkfs;[6] in 4.3-Tahoe,newfs replaced mkfs.[7]

As Unix-like systems adopted virtual file system mechanisms, they used this to support multiple local file systems, such as supporting FAT/VFAT file systems in addition to the native file system, or supporting new native file systems, such as ZFS on Oracle Solaris, the Apple File System on macOS, and several native file systems on Linux. Those systems added file-system-specific versions of mkfs or newfs. In Linux, the convention has been to name the file-system-specific commands as: mkfs.fs-type, where fs-type is an abbreviation for the file system, e.g., mkfs.ext2 for ext2 file systems, mkfs.msdos for FAT/VFAT file systems, mkfs.minix for the Minix file system, etc. FreeBSD, NetBSD, OpenBSD, DragonFly BSD, and macOS use a similar convention, but using an underscore rather than a period; in those systems, newfs, if present, creates UFS file systems, with the other file-system-specific commands supporting other file systems supported by the operating system.

Some Unix-like operating systems still have a command named mkfs or newfs:

  • in HP-UX,[8], Solaris,[9] and Linux,[10] mkfs is a program that takes a flag argument indicating which type of file system to create and runs the file-system-specific command to create a file system of that type - the command is deprecated in Linux;[10]
  • in HP-UX,[11] newfs is a program that takes a flag argument indicating which type of file system to create and runs the file-system-specific mkfs command to create a file system of that type;
  • in Minix,[12] mkfs creates a Minix file system;
  • in FreeBSD,[13] NetBSD,[14] OpenBSD,[15] DragonFly BSD,[16] and Solaris,[17]newfs creates a UFS file system.

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
  • format create a file system on DOS or Windows
  • 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. Retrieved 2013-04-30.
  2. "file(5) - Unix First Edition Manual Page". man.cat-v.org. 1971-01-01. Retrieved 2013-04-30.
  3. mkfs(8)  Version 6 Unix Programmer's Manual
  4. mkfs(1)  Version 7 Unix Programmer's Manual
  5. Unix User's Manual (PDF). Bell Telephone Laboratories. 1980. MKFS(1M).
  6. "4.2BSD newfs(8) man page source". 20 February 1983.
  7. "4.3-Tahoe newfs(8) man page source". October 1, 1987.
  8. Section 1M: System Administration Commands (A-M) HP-UX 11i Version 3. HP-UX Reference. Hewlett Packard Enterprise. 2007. mkfs(1M).
  9. mkfs(8)  Solaris 11.4 System Administration Commands Reference Manual
  10. 1 2 mkfs(8)  Linux Programmer's Manual – Administration and Privileged Commands from Manned.org
  11. Section 1M: System Administration Commands (N-Z) HP-UX 11i Version 3. HP-UX Reference. Hewlett Packard Enterprise. 2007. newfs(1M).
  12. "mkfs". Minix3.org. Retrieved 2026-06-10.
  13. newfs(8)  FreeBSD System Manager's Manual
  14. newfs(8)  NetBSD System Manager's Manual
  15. newfs(8)  OpenBSD System Manager's Manual
  16. newfs(8)  DragonFly BSD System Maintenance and Operation Commands Manual
  17. newfs(8)  Solaris 11.4 System Administration Commands Reference Manual
[edit]