HostOnNet Blog

Format partition with mkfs

Looking for Linux Server Admin or WordPress Expert? We can help.

mkfs command is used to format disk partition in linux.

To format a partition to ext4 format, run

mkfs.ext4 /dev/DEVICE-NAME-HERE

For example (be careful, you lose all data on /dev/sdb1).

root@hoston:~# mkfs.ext4 /dev/sdb1
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done                            
Creating filesystem with 52428288 4k blocks and 13107200 inodes
Filesystem UUID: 23f6c04a-0568-45c5-b17a-7bd81feb9b59
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done     

root@hoston:~#

Posted in Linux

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.