Linux - How to format a drive

Linux - How to format a drive

Hello colleagues.

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:

  • mkfs.bfs
  • mkfs.btrfs
  • mkfs.cramfs
  • mkfs.ext2
  • mkfs.ext3
  • mkfs.ext4
  • mkfs.ext4dev
  • mkfs.fat
  • mkfs.minix
  • mkfs.msdos
  • mkfs.ntfs
  • mkfs.vfat
  • mkfs.xfs

 

To format a partition on a disk, we first need to find it, for this we can use the fdisk utility.

$. fdisk -l

linux disk formatting

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

linux disk formatting

In all results, you should have - done!


 

Thank you all, I hope my article was of some help to you.

SIMILAR ARTICLES

How to see Ubuntu version in Linux terminal
How to see Ubuntu version in Linux terminal
LINUX
Linux - How to mount and unmount a drive
Linux - How to mount and unmount a drive
LINUX
How to add a disk and create a partition in Linux
How to add a disk and create a partition in Linux
LINUX