Forrest logo
back to the mkfs tool

mkfs:tldr:6934d

mkfs: Build a Linux ext2 filesystem on a partition.
$ mkfs ${path-to-partition}
try on your machine

The command "mkfs ${path-to-partition}" is used to create a file system on a specific partition.

Here's the breakdown of the command:

  • "mkfs" stands for "make file system," which is a command-line utility used to create a new file system on a storage device or partition.

  • "${path-to-partition}" represents the path or location of the partition on which you want to create the file system. It is usually specified using an absolute or relative path.

For example, if you want to create a file system on the partition "/dev/sdb1", the command would be: "mkfs /dev/sdb1".

Depending on the file system type, you may need to provide additional options or specify the file system type explicitly. For instance, if you want to create an ext4 file system on "/dev/sdb1", you can use the command: "mkfs -t ext4 /dev/sdb1".

It's important to note that using this command will permanently delete all data on the specified partition, so exercise caution before running this command and ensure that you have a proper backup of your important data.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mkfs tool