Networking HowTos
Networking HowTos

Format partition with the ext4 file system

June 4, 2017 Linux

The ext4 filesystem is known as the forth extended filesystem, and is the default file system on many Linux distributions.
To Format a partition with the ext4 filesystem run the following command:

$ sudo mkfs.ext4 /dev/sdc1

Replace sdc1 with the relevent disk and partition that you want to format. In this example, the disk is /dev/sdc, and its the first partition on that disk. Make sure you get the drive and partition correct or you may wipe something that you dont want to.
Example:

$ sudo mkfs.ext4 /dev/sdc1
mke2fs 1.43.4 (31-Jan-2017)
Creating filesystem with 261888 4k blocks and 65536 inodes
Filesystem UUID: 15d8146f-bcb3-414c-864f-5100bb4b0bf8
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
$

If the parition already has a filesystem on it, you should get a warning such as this:

$ sudo mkfs.ext4 /dev/sdc1
mke2fs 1.43.4 (31-Jan-2017)
/dev/sdc1 contains a ext4 file system
        created on Sun Jun  4 22:59:38 2017
Proceed anyway? (y,N)

Press “y” and enter to confirm you want to overwrite the file system.

You Might Also Like