ArticleslgStudy

computer science

Mkfs

Mkfs is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Mkfs rather than just read about it. In short: 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.

Key takeaways

  • Mkfs belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Mkfs to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Mkfs from memory before moving on to harder problems.

Reference excerpt

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 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). 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). 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. The mkfs in Version 7 Unix was the same. Unix System III added some optional arguments. 4.2BSD added newfs as a front end for mkfs; in 4.3-Tahoe,newfs replaced mkfs. 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,, Solaris, and Linux, 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; in HP-UX, 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, mkfs creates a Minix file system; in FreeBSD, NetBSD, OpenBSD, DragonFly BSD, and Solaris,newfs creates a UFS file system.

See also 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

External links mkfs manual

Worked examples

Example 1 — a first encounter with Mkfs

Start with the simplest possible case. Write down what Mkfs claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Mkfs before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Mkfs ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Mkfs

In research
Mkfs appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Mkfs in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Mkfs is common in secondary-school and first-year university syllabi. It links to neighbouring topics Unix file system-related software, so understanding it makes those chapters shorter.
In everyday life
Look for Mkfs outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Mkfs” →

How to study Mkfs in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Mkfs means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Mkfs out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Mkfs in simple terms?

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 hiera…

Why does Mkfs matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Mkfs?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Mkfs.

Tags

  • Unix file system-related software

Keep exploring