2022 Guide on Format Partition in Linux [Step-by-Step Tutorial] - Qiling  

Guide on Format Partition in Linux [Effective & Easy Solutions]


PAGE CONTENT:
How Do I Format a Partition in Linux?
Format Partition in Linux with mkfs
Qiling Partition Master For Linux Tests

Formatting and partitioning disks are essential tasks in Linux administration, allowing you to manage space issues and fix system errors by formatting partitions. If you're a Linux system owner, you can quickly resolve these problems, and to do so, you'll need to know how to format a partition in Linux, which is exactly what you'll learn here.

How Do I Format a Partition in Linux?

In Linux, there is no dedicated disk management tool to format partitions, so we use the `mkfs` command to format a Linux partition. Before formatting, we need to ensure some prerequisites are met.

To format a partition in your Linux PC, start by locating the partition you want to format. You can use the `lsblk` command to display block devices, which are files representing devices like USB drives, hard drives, RAM, and CD/ROM drives, and identify the partition you want to format.

guide on format partitions

The terminal prints out a complete list of all the block devices along with information about them like:

To use the /dev/sdb1 partition as an example, you can simply replace it with the actual partition you want to work with in the command. For instance, if you want to use the /dev/sda1 partition instead, you would replace /dev/sdb1 with /dev/sda1.

The lsblk command without additional options will not display the information about the device's file systems. This is because the default output of lsblk only shows information about block devices, such as disk partitions and devices, but does not include file system details.

To display a list containing information about the file system, you can add the -f option to the command, which would look like lsblk -f.

The command will output a list of all block devices, including non-formatted partitions that do not contain file system information, which can be formatted in ext4, FAT32, or NTFS.

To format Linux partitions in three different formats, follow these steps. You can format a USB in Linux by following the link provided. The three formats are: ext2, ext3, and ext4.

Format USB Linux

Format Partition in Linux with mkfs

There are three basic ways to format the disk partitions using the mkfs command:

The typical syntax for formatting disk partitions in Linux is as follows:

mkfs[options] [-t type fs-options] device [size]

Formatting a drive into a specific file system involves preparing the drive for use with a particular operating system. The most common file systems are FAT (File Allocation Table), NTFS (New Technology File System), and HFS (Hierarchical File System).

Guide 1. Format Partition in Linux with FAT32 File System

You can easily format partitions in Linux with the FAT32 file system. To do this, first, open the terminal and type "fdisk /dev/sdX" (replace X with your device letter) to open the disk management utility. Then, select the partition you want to format and press 'd' to delete it. Next, press 'n' to create a new partition and follow the prompts to set the partition size and file system as FAT32.

Step 1. To format a partition in Linux with the FAT32 file system, you would use the command `sudo mkfs -t vfat /dev/sdb1`.

Step 2. Run the lsblk command to verify the file system format change and locate the desired partition from the list using the lsblk -f command. The -f option is used to display information about the filesystems on the block devices, helping to identify the desired partition.

format fat32 partition

Guide 2. Format Partition in Linux with Ext4 File System

To format partitions in Linux with the ext4 file system, you can use the following command in the terminal: `mkfs.ext4 /dev/sdXn` (replace 'X' with the drive letter and 'n' with the partition number).

Step 1. To format a disk partition with the ext4 file system, use the command `sudo mkfs -t ext4 /dev/sdb1`.

Step 2. Verify the file system change using the command "lsblk -f" to print out a block device list.

Step 3. To confirm the ideal partition and its file system, you can use the `lsblk` command, which provides detailed information about all available storage devices and partitions. The command is as follows: `lsblk -o NAME,FSTYPE,LABEL,UUID`. This will list all partitions on your system along with their file system types, labels, and UUIDs.

format  ext4 partition

If you want to format partitions to EXT2/3/4 for use with Linux, you can use a third-party tool like Qiling Partition Master Free.

Guide 3. Format Partition in Linux with NTFS File System

To format a partition in Linux with the NTFS file system, you can use the mkfs.ntfs command. The basic syntax for this command is: `mkfs.

Step 1. To format a disk, run the command `sudo mkfs -t ntfs /dev/sdb1` in the terminal, specifying the NTFS file system and the disk device (/dev/sdb1) to be formatted. This will initiate the formatting process and print a confirmation message when it's complete.

Step 2. To verify the file system, you can use the command `lsblk -f` to list all block devices and their file systems. This command will display detailed information about each device, including its file system type, size, and mount point.

Step 3. Locate the selected partition and verify that it is using the NTFS file system.

format ntfs partition

Besides using commands to format a partition in Linux, you can also format a partition for Linux tests in Windows using a professional format tool like Qiling Partition Master.

Qiling Partition Master Format Partitions For Linux Tests

Qiling Partition Master is a leading partition manager that can format partitions in Linux-supported systems, making it easy to format partitions to EXT 2/3/4 with simple clicks.

Now, let's see how to use Qiling Partition Master to format a partition to the format you want.

Step 1. Launch Qiling Partition Master, right-click the partition you intend to format and choose "Format".

Step 2. Enter the Partition label, choose the file system (FAT32/EXT2/EXT3/EXT4), and set the cluster size according to your needs in the new window.

Step 3. The user clicks the "Proceed" button to initiate the formatting process for the selected partition, choosing from FAT32, EXT2, EXT3, or EXT4 file system options.

Step 4. Then you will see a warning window, click "Yes" to continue.

This tool offers both free and paid versions, with a focus on reliability.

Key Features

Qiling Partition Master is a reliable tool with a user-friendly interface, offering a preview feature and many other attractive features. We recommend using it for partition format, and to ensure authenticity, always download it from the official website.

Conclusion

If you're still following this post, you're likely familiar with the format partition in Linux. For formatting partitions to EXT2/3/4, which are compatible with Linux, we recommend using Qiling Partition Master. If you have any other questions or issues related to formatting partitions in Linux, feel free to continue reading.

FAQs About Format Partition in Linux

In this paragraph, there are three questions and answers you may be concerned about. Continue to read and learn.

1. Can you format a drive with Linux on it?

You can't format the disk from within the Linux system itself, as it's a bootable disk. You need a bootable disk to access the disk partitions.

2. What are the types of partitions in Linux?

On a Linux system, there are two primary partitions: data and swap. The data partition holds standard Linux system data, while the root partition contains all data needed to start and run the system. In contrast, the swap partition functions as an extension of the computer's physical memory, utilizing extra space on the hard disk to supplement RAM.

3. What is a formatting command?

The command typically creates a new root directory and file system for the disk, and can also check for bad areas on the disk and delete all data on it.

Related Articles


Is this information helpful?     

What can we do to improve this information? (Optional)
Refresh Please enter the verification code!


QilingTech uses cookies to ensure you get the best experience on our website.  Learn more  Got it