The mkfs
command builds a filesystem on the device (similar to formatting a drive). It determines the filesystem type and calls the appropriate mkfs.<type>
program. For example, if you were to run mkfs -t ext4 /dev/sdb5
, it would actually run the mkfs.ext4
program. The mkfs
options are as follows:
-t
: It specifies the type of filesystem desired-V
: It produces verbose output-V
: It displays version information if used as the only parameter-h
: It displays a help screen
Note that no other parameters are passed to the filesystem’s specific program. Also note that in some cases, a size value needs to be provided.
The mkfs
program will destroy any data currently residing in the partition. So, make sure you have taken the desired backups before proceeding with this command. Once this action has been taken, it cannot be reversed. If you would like to follow these steps, you should first practice on a USB stick or some other device you don’t care about...