FreeKB - Create a file system on Linux
Create a file system on Linux

Home > Search

The mkfs command can be used to create a filesystem. In this example, either of these commands will configure the /dev/sda2 partition to use the ext4 file system.

[root@server1 ~]# mkfs.ext4 /dev/sda2
[root@server1 ~]# mkfs -t ext4 /dev/sda2


The mkfs is very simple, and only has a few options. the mke2fs command is more advanced, and includes many possible options.

Following are some of the more popular filesystem types used by Linux.

  • ext2 (second extended file system)
  • ext3 (third extended file system)
  • ext4 (fourth extended file system)
  • xfs (extended file system)
  • lvm (logical volume)
  • raid


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 80c49 in the box below so that we can be sure you are a human.