Formatting partition in linux

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

Formatting and partitioning disks are crucial parts of Linux administration. Do you own a Linux system? If you are worried about space issues or fixing system errors, you can quickly resolve them by formatting the partition. The question is how to format partition in Linux. Don’t worry! you are at the right place!

How Do I Format a Partition in Linux?

In Linux, there is no such dedicated disk management tool that can help us to format partitions. So, we need to use the mkfs commands’ help to format a Linux partition. But before formatting the Partition in Linux, you need some of the prerequisites:

  • A system running Linux
  • An account with sudo or root privileges
  • Access to a terminal window or command line (Activities > Search > Terminal)

Before formatting the partition in your Linux PC, you need to locate a partition you want to format. You can do it with the help of the lsblk command, which displays bock devices. Normally block devices are those files that represent devices such as USB drives, hard drives, RAM, and CD/ROM drives.

guide on format partitions

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

  • NAME — The device names
  • TYPE — The type of the device
  • SIZE — The size of the device
  • MOUNTPOINT — Device’s mount point
  • RO — Whether the device is read-only or not
  • MAJ: MIN — Minor or major device numbers
  • RM — Whether the device is removable or not (1 if yes, 0 if no)

Here we will use the /dev/sdb1 partition as an example.

The lsblk command without additional options will not display the information about the device’s file systems.

If you want to display a list containing information about the file system, add the -f option, which will be like lsblk -f.

This command will print out the list of all block devices. The partitions that don’t comprise information on the file system are non-formatted. The file system format can be ext4, FAT32, or NTFS.

Read the post further to learn how to format Linux partitions in these three different formats. There is a link to help you if you want to format a USB in 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]

Let’s check out how to format drives into these file systems.

Guide 1. Format Partition in Linux with FAT32 File System

You can easily format partitions in Linux with the FAT32 file system. First, follow the below guide properly.

Step 1. You need to use the command sudo mkfs -t vfat/dev/sdb1 to format the Partition in Linux with FAT32 File System.

Читайте также:  Pscp linux to windows

Step 2. Again, run the lsblk command. Verify the file system format change and locate the desired partition from the list using the command lsblk-f.

format fat32 partition

Guide 2. Format Partition in Linux with Ext4 File System

If you want to format partitions in Linux with the ext4 File system, follow the guide below.

Step 1. You need to use the command sudo mkfs -t ext4/dev/sdb1 to format a disk partition with the ext4 file system.

Step 2. Next, you must verify the file system change using the command: lsblk -f. This command will help the terminal print out a block device list.

Step 3. Now locate the ideal partition and confirm that this partition uses the ext4 file system.

format ext4 partition

By the way, if you want to use any third-party trusted tool, then EaseUS Partition Master Free can help you format partitions to EXT2/3/4, which are compatible with Linux.

Guide 3. Format Partition in Linux with NTFS File System

You can also format partitions in Linux with NTFS File System. To do so, follow the below guide properly.

Step 1. Run the mkfs command, sudo mkfs -t ntfs/dev/sdb1, and specify the NTFS file system to format a disk. This command will help the terminal to print a confirmation message when the formatting process finishes.

Step 2. Next, you must use the command lsblk-f to verify the file system.

Step 3. Now locate the selected Partition and validate that it uses the NFTS file system.

format ntfs partition

Well, besides using commands to format a partition in Linux, you can also format a partition for Linux tests in Windows. Here, you may like to know a professional format tool, EaseUS Partition Master.

EaseUS Partition Master Format Partitions For Linux Tests

As we mentioned above, EaseUS Partition Master is one of the leading and advanced partition managers who can help you to format partitions in Linux-supported systems. It can format partitions to EXT 2/3/4 easily and you can finish this process with simple clicks.

Windows 11/10/8/7 100% Secure

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

Step 1. Launch EaseUS Partition Master, right-click the partition you intend to format and choose «Format».

Step 2. In the new window, enter the Partition label, choose the FAT32/EXT2/EXT3/EXT4 file system, and set the cluster size according to your needs, then click «OK».

Step 3. Then you will see a warning window, click «Yes» in it to continue.

Step 4. Click the «Execute 1 Task(s)» button in the top-left corner to review the changes, then click «Apply» to start formatting the partition to FAT32/EXT2/EXT3/EXT4.

This tool comes with both free as well aspro versions. Let’s discuss more the features of this reliable tool.

Key Features

  • Create/Delete Partition: This tool can save all data on a disk after creating or deleting partitions you don’t need anymore.
  • Merge Partitions: The EaseUS Partition Master tool can merge partitions to combine two partitions as one. In addition, this tool knows how to resolve the C drive entirely and manage a few partitions from disarray.
  • Resize/Move Partition: Without any data loss, this tool can adjust the used partition and extend it.
  • Extend system partition: Extending the system partition or C drive, this tool can easily make full use of the free or unallocated space.
  • Format hard drive/Wipe Partition: It can efficiently format disks or wipe partitions in different file systems.
  • Quick partition New disk: This tool can easily set up a brand-new disk without any partitions.
  • Convert MBR to GPT: You can easily convert MBR to GPT with its help.
  • Convert FAT32 to NTFS: It also allows you to change the file system format of your device and convert FAT32 to NTFS.
Читайте также:  Linux skype не видит камеру

When it comes to EaseUS Partition Master, it is a reliable tool that comes with a user-friendly interface, a preview feature along with many other attractive features. We will recommend you use this tool for partition format. Always download the tool from the official website.

Windows 11/10/8/7 100% Secure

Conclusion

If you are still following the post, you must know the format partition in Linux. We recommend using EaseUS Partition Master to format partitions to EXT2/3/4, which are compatible with Linux. If you have other questions or problems about format partition in Linux, just 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?

Sure, you can do it, but you need to either have a bootable disk that gives you access to disk partitions, or you can connect the Linux disk to another PC or Mac and then format the drive.

2. What are the types of partitions in Linux?

There are two primary partitions on a Linux system: data partition and swap partition. The data partition contains standard Linux system data, and the root partition usually includes all data to start up and run the system. The swap partition has the computer’s physical memory and extra memory on the hard disk.

3. What is a formatting command?

The command usually forms a new root directory and file system for your disk. This command can also check for bad areas on your disk and delete all data on the disk.

Источник

How to Format a Drive in Linux

Formatting a drive is necessary whenever you are trying to erase data on a drive or partition or to create a new partition. Before formatting a partition or drive, it is strongly recommended to make sure that there is nothing important there, as formatting may erase the data for good.

This guide shows you how to format a drive in Linux.

Formatting a Drive in Linux

There are two primary ways of formatting a drive in Linux: using the CLI and using the GUI. For general users, using a GUI tool may be more comfortable, whereas advanced or professional users may find the CLI method better suits them.

Either way, performing a disk format requires root access or sudo privileges. However, in certain situations, a different user can perform drive format if there is write permission for that drive. This article was written with the assumption that you have root access to your system.

The drive formatting process can be a bit tricky. To use the device storage, a drive must have a partition table with or without partitions. The partitions will allow the OS to access the storage. By formatting the drive, we are formatting the partition. If there are multiple partitions, then you have to perform the formatting process for all of them.

Formatting a Partition using the GUI Method

For managing disks and partitions (and related functions), GParted is the best option. GParted is a free and open-source tool used for managing disk partitions. This tool comes with tons of features and support for numerous file systems.

Читайте также:  Настройка сетевых папок линукс

There are two ways to use GParted. You can install GParted on the running system or use the bootable image to perform the disk format. Both methods come with their own pros and cons. The good part is, whichever method you follow, the UI of GParted works the same.

First, we will show you how to install GParted onto your system. Depending on the Linux distro that you are running on your system, use the appropriate one.

For Debian/Ubuntu and derivatives:

For Fedora and derivatives:

For openSUSE and derivatives:

To use GParted from the boot, download the GParted bootable ISO here. You can also make a bootable CD, DVD, or USB flash drive. Check out how to make a bootable USB flash drive on Linux here. Once you have prepared the system, boot into the CD, DVD, or USB flash drive.

From this point on, GParted behaves the same. For convenience, I will be demonstrating using GParted installed on Ubuntu.

Launch GParted, and it will ask for the root password.

From the top-right corner, select the device on which the operation is to be performed.

Next, you must decide the target partition. For an in-depth guide on how to create and manage partitions using GParted, check out how to use GParted here. In this case, the target partition is the /dev/sda5 partition.

As you can see, the partition is currently mounted. Before performing any action, the partition must be unmounted. Right-click and select “Unmount.”

Now, the partition is ready to be formatted. If the device is a USB flash drive, then file systems like FAT32, NTFS, and EXT4 are generally the best option. If the device is an HDD, then it is better to go for EXT4. You can also go for a different format if there is a need for a specific file system. In my case, I will right-click and select “Format to” >> “fat32.”

An interesting feature of GParted is that it does not write the changes to the drive instantly. This way, even if you misconfigure the drive, you can easily discard the changes. To make the changes permanent, click “Apply All Operations.”

GParted will now ask you for confirmation. In this example, after performing the formatting, the partition will lose all its data. Click “Apply” to confirm.

Voila! The partition has been formatted successfully!

Formatting a Partition Using the CLI method

This method is relatively shorter than the previous one. However, this method is only recommended for advanced users, as it comes with a higher chance of damage to the system. This method is less failsafe than GParted, so you must be super careful.

Connect the device to the computer. By default, most Linux distros will mount all the partitions of the device. Assuming it hosts a single partition, it will be mounted automatically. Check out the list of mounted filesystems below.

It is not allowed to format a partition that is currently mounted. To unmount the partition, run the following command.

Now, you can format the partition with your desired filesystem. Run the command that suits your needs.

Источник

Оцените статью
Adblock
detector