Aryan PrajapatKnowledge Contributor
How do you format a disk in Linux?
How do you format a disk in Linux?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
The mkfs or make file system command helps format the disk in the Linux system. All you need to do is use the following method to format the disk:
First, run the lsblk command to list the available partitions and identify which disk you want to format.
If the selected disk is mounted, then unmount it through the following command:
umount
Now, find the file system type of the disk, like EXT4, NTFS, or XFS. Once you are done then, run one of the following commands according to the file system type:
mkfs.ext4
mkfs.xfs
mkfs.ntfs
Finally, mount the disk again through the mount command after the successful format. Moreover, please ensure that you have created a complete disk backup to eliminate the chances of data loss.