Linux - How to format a drive
Last updated: Nov 20, 2022
In today's article, we will talk about how you can format a partition on a disk in Linux in a simple way. As we all know that modern Linux offers several options for file systems to choose from. The file system is created by executing the mkfs command with the keys specified, or by executing one of the programs.
It is desirable to perform all actions from under the root account.
List of all file system formats in Linux:
To format a partition on a disk, we first need to find it, for this we can use the fdisk utility.
$. fdisk -l
In my example, I will be formatting the /dev/sdb1 partition which is on the sdb drive.
The formatting itself is very simple, I first specify the name of the file system under which I will make the partition and only then specify the absolute path to the partition itself. In my case, I will be formatting the partition into the mkfs.ext4 file system format.
$. mkfs.ext4 /dev/sdb1
In all results, you should have - done!
Thank you all, I hope my article was of some help to you.