How to Format Storage Drives Using the Linux Terminal

A storage gadget is an integral a part of your laptop {hardware} and computing generally. Used for storing processed knowledge, storage units are available in many various types. Some of the commonest ones embody exterior or inside laborious drives, flash disks, CDs, and so forth.

This information will present you ways to format a storage gadget proper from the Linux terminal.

How to Follow Along

When you format a storage gadget, you might be primarily deleting all knowledge or data saved on that gadget, extra like restoring it again to its default manufacturing unit settings. Some causes you may want to do that embody: to eliminate malicious software program, enhancing efficiency, or eradicating delicate knowledge earlier than handing over the storage gadget to one other individual.

Note: Always train warning when formatting drives to keep away from shedding necessary data.

If you want to observe alongside, the finest manner is to observe utilizing a USB flash drive. Note that the steps are the identical for different storage units as effectively. Just just remember to backup your knowledge earlier than formatting the gadget.
MAKEUSEOF VIDEO OF THE DAY

Plugin your USB flash drive to your PC. Most Linux desktops will routinely mount your storage gadget when you join it to your laptop.

If for some motive, the gadget is just not routinely mounted, right here is how one can mount the drive in Linux.

Your USB flash drive shall be listed underneath the information menu or on the desktop relying in your desktop atmosphere. Most Debian-based distros like Ubuntu will listing the drive on the information menu.

Getting the Properties of Your Storage Device

Before you may proceed to format your storage gadget, it is necessary that you’re ready to listing and get the properties of the related units in your PC so that you just format the right storage gadget.

Open the terminal from the Applications menu or through the shortcut Ctrl + Alt + T. In the terminal, run the following df command:

df -h

The command lists all the storage units out there in your system. The -h possibility lists the storage units in a human-readable format.

Most Linux distros routinely mount exterior storage units similar to USB flash drives underneath the /media/ listing.

Here, the storage gadget that we wish to format is mounted in the listing /media/mwiza/CORSAIR, the place CORSAIR is the label of the storage gadget.

Some different necessary properties embody:

The bodily mount deal with of the storage gadget, /dev/sda1 on this case.

The measurement of the drive together with the free area out there and the quantity used each as a share and in gigabytes.

Last however not least, the listing by which the USB flash drive is mounted; /media/mwiza on this case.

Formatting Your Storage Device

When your storage gadget is mounted in your system, Linux assumes the drive to be of a set measurement and particular format. For optimum effectivity when formatting, it is necessary you unmount your storage gadget first.

To unmount the storage gadget, you should utilize the umount command as under.

sudo umount /dev/sda1

Note: In this case, /dev/sda1 is the bodily deal with on which the storage gadget that we wish to format is mounted. Make certain to get the right mount level of your gadget in your system.

To format your storage gadget, use the mkfs (Make filesystem) command. The mkfs command builds a file system on a storage gadget in accordance to the choices specified.

sudo mkfs.vfat -n ‘MUO’ -I /dev/sda1

The aforementioned command codecs the specified drive utilizing the FAT32 file format. Also, you may specify the new title or label of the USB flash drive. In this case, it is going to be MUO and the bodily deal with mount level /dev/sda1. The FAT32 file system is appropriate with all mainstream working techniques.

Apart from the FAT32 file system, different file system codecs you should utilize for formatting your storage gadget embody ext, Minix, MS-DOS, and so forth.

Once the formatting is full, bodily unplug the storage gadget out of your laptop after which plug it in once more. The system will mount your newly formatted drive with the title you laid out in the command.

You also can test the title of the storage gadget by operating the df -h command.

Formatting an External Drive on Other OSes

This information has checked out how to format an exterior storage gadget on Linux utilizing the mkfs command. As with all issues Linux, there are lots of different command-line instruments for formatting storage units; you may even use the GUI for those who like.

If you might be utilizing one other working similar to Windows, you get the possibility to format your inside or exterior storage units graphically.

How to Format a USB Drive (And Why You Would Need To)
Formatting a USB drive is straightforward. Our information explains the best and quickest methods to format a USB drive on a Windows laptop.

Read Next

About The Author

Mwiza Kumwenda
(37 Articles Published)

Mwiza develops software program by career and writes extensively on Linux and front-end programming. Some of his pursuits embody historical past, economics, politics & enterprise-architecture.

More
From Mwiza Kumwenda

Subscribe to our publication
Join our publication for tech suggestions, evaluations, free ebooks, and unique offers!
Click right here to subscribe

Recommended For You