Full Guide on How to Format Drive in Linux
Do you want to know which file system is the best for your Linux OS? Follow this guide and learn more including how to format hard disk Linux and the best data recovery.
Hard Drive Recovery
- How to Clone Hard Drive
- How to Format Hard Drive from Bios
- Format Hard Drive for Xbox One
- How to Format C Drive in Windows 10/7/XP
- How to Perform PS4 External Hard Drive Format
- How to Format Hard Drive from Bios
- Format Hard Drive for Xbox One
- How to Format C Drive in Windows 10/7/XP
- How to Perform PS4 External Hard Drive Format
- How to Format Drive in Linux
- How to Format Hard Drive to NTFS
- How to Format WD My Passport
- How to Format Your Drive to FAT32 System
- Format HDD Low Level
- Format a BitLocker Encrypted Drive
- How to Unformat Hard Disk
- How to Format a RAW Drive
- Fix Your Hard Drive’s Formatting Issues
- How to Format SSD
- How to Format your Hard Drive to exFAT File System
- How to Format a Hard Drive to FAT32
- Top 10 Hard Drive Recovery Tools
- How to Recover Lost Data from Maxtor External Hard Drive
- How to Recover Data from Hitachi External Hard Drive
- How to Recover Data from Dead Hard Drive
- How to Recover Data from SimpleTech External Hard Drive
- How to Recover A Formatted Hard Drive in 3 Simple Clicks
- How to Recover Lost Data from Iomega External Hard Drive
- How to Recover Data from Toshiba External Hard Drive
- How to Recover Data from Transcend External Hard Drive
- Lacie External Hard Drive Data Recovery and Repair
- Best Way to Recover Data from a Floppy Disk
- How to Recover Data from HP External Hard Drive
- Best Method to Recover Data from Crashed Hard Drive
- How to Repair Toshiba Hard Disk
- Recover Files from WD My Book External Hard Drive
- Ways to Repair Seagate Hard Disk
- How to Fix the Hard Disk 3F0 Error
- How To Get Your Hard Drive Live Longer
- Perform HDD Bad Sector Repair on Any Hard Drive
- Recover Formatted Partition
- How to Recover Files from Corrupted Hard Disk
- How to Fix Hard Disk not Initialized Error
- Fix Fatal Hard Disk Not Detected Error
- How to Clone a Hard Drive
- How to Rescue Data from Hard Drive
- How to Fix HDD Write Protected Error
- How to Completely Wipe a Hard Drive
- Recover Lost Data from Seagate External Hard Drive on Mac
- How to Recover Data from Formatted Hard Disk Drive on Mac
- How to Recover Data from Seagate Backup
- How to Recover Lost Data from Western Digital External Hard Drive
- Top 5 Tools for Mac Disk Recovery on Mac
- How to Format Toshiba Hard Drive for Mac
- Format a Hard Drive for Mac: Ultimate Guide 2021
Elva
• Filed to: Hard Drive Recovery • Proven solutions
“I need to format drive Linux terminal and I don’t know the procedure. Any help out there?”
It is undeniable that fdisk is the most common command-line based disk manipulation utility for a Linux system. The utility can view, create, resize, delete, change, copy and format drives in Linux.
And it comes handy when a drive isn’t set to fit Linux use, and you want to make it usable. It might require you to give it a file system compatible with Linux.
So, which is the best file system for a Linux system?
Part 1: Which File System is Best for Linux
When formatting partitions on a Linux PC, you’ll see a plethora of offline system options. They don’t have to overwhelm you. And if you aren’t sure of the system file appropriate for Linux, the best option would be Ext4.
Ext4 is the default file system on most Linux distributions because it is the advanced version of the Ext3 file system. It isn’t the most advanced file system, but it works great—it is rock-solid and stable.
Soon, Linux distributors will gradually shift towards BtrFS, which is a new technology undergoing tons of development. Avoid it for now because the risk of data corruption or other problems isn’t worth the potential improvement in speed.
It is important to note that the Ext4 file system is exclusively for Linux systems. If you’re formatting an external drive you want to share with other operating systems like macOS and Windows, you shouldn’t use the Ext4 file system as the device won’t read it. You might want to consider the exFAT or FAT32 format, which is accessible to any device.
Part 2: How to Format a Drive in Linux
There are plenty of graphical tools available for disk partitioning and formatting on desktop Linux systems. The most commonly used are the QTParted and the Gparted.
However, many a time you’ll need to format hard drive from the command line, especially when you’re running a server. When done, you’ll have a partitioned hard drive with a Linux file system ready for use.
It is important to note that formatting or reformatting a hard drive on Linux erases all data on the storage media. It is important you back up all your files before proceeding to format.
Step 1 The first step is to set up a new partition.
- Open a terminal window and log in as root. To execute this, press Ctrl + Alt + T to open a terminal window. Start your commands with su to become a Root.
- To identify your drive, execute the following from the command prompt as root:
# fdisk -l | grep ‘^Disk’
The output should look like this:
Disk /dev/sda: 251.0 GB, 251000193024 bytes
Disk /dev/sdb: 251.0 GB, 251000193024 bytes
The device name describes the entire hard disk.
Step 2 The second step is formatting the new disk using mkfs.ext4 command
To format Linux partition using ex2fs on the new disk, run the following command:
Step 3 Then mount the new disk using the mount command
First, create a mount point/disk1. Then use the mount command to mount/dev/sdb1. To execute this, enter the following command:
# mkdir /disk1
# mount /dev/sdb1 /disk1
# df -H
Step 4 Update /etc/fstab file
First, open /etc/fstab. To do that, run the following command:
In the end, it will append as follows:
/dev/sdb1 /disk1 ext3 defaults 1 2
Step 5 Next, label the partition
You can label the partition using the e2label command. For instance, if you want to label the partition “Programs,” run the following command:
Next time you want to mount the partition, you can use the label name instead of the partition name. And that´s all with formatting a hard drive from the Linux command line.
Part 3: Data Recovery from Formatted Linux Disk
In a perfect world, every byte of your data would be backed up to an external drive or a cloud storage service. And we don’t live in a perfect world.
Maybe, during the formatting session, you might have forgotten to back up your files. And after formatting your Linux disk, you might need to get your data back.
To facilitate the re-getting process of the file, you’ll need a file recovery tool for Linux. And data recovery in Linux shouldn’t cost you a fortune. There are tons of free data recovery tools out there. But not all works accordingly.
However, we’ll focus on one that reliable, 100% free, and is specifically build for Linux -Ddrescue Data Recovery Tool.
Ddrescue is an expert freeware for Linux data recovery tool that retrieves data even in the most extreme extent. The tool is powerful beyond formatted-data recovery—it recovers data despite all sorts of disk errors and bad sectors.
Simple Guide to Use Ddrescue
- Connect a storage media that is at least 1.5 times larger than the Linux disk you’ve formatted
- Identify the names of the drives—the one you want to rescue and the one you want to recover the data to by executing the lsblk command. Let’s say that GNU ddrescure is on /dev/sda1, the drive you want to rescue is/dev/sdb1, and you are copying it to/dev/sdc1, here is the command to run:
$ sudo ddrescue -f —no-split /dev/sdb1 /dev/sdc1 logfile
$ sudo ddrescue -f -r3 /dev/sdb1 /dev/sdc1 logfile
It is important to note that the destination will be overwritten. It is important to ensure the destination is free of important data.
Part 4: Data Recovery from Formatted Windows 10 Hard Drive – Recoverit (IS)
Recoverit (IS)
Best Windows 10 Hard Drive Data Recovery Software:
- An All-in-one Data Recovery Tool:Recoverit (IS)y software combines powerful features to rescue your data from any loss beyond just formatting. The software stretches a notch higher to retrieve data from accidental deletes, virus infection, and nearly all scenarios of data loss.
- Super intuitive User Interface: Readily recover your hard drive in mere three clicks. No code required. No user manual. Just a 3-click procedure—Select, Scan, and Recover and you retrieve the data you desire.
- Recover over 1000 Data Types: This tool can also recover any data type such as documents, videos, graphics, emails, and other files.
- Recover Data from Any Storage Device: These include recovery of storage devices with the file system FAT32, NTFS, FAT16, among other file systems. Furthermore, it can retrieve data from external devices like USB drive, Cameras, Micro SD Card, Hard Drives, among other devices.
- It is compatible with both Windows and Mac OS system.
3,165,867 people have downloaded it
Conclusion
Managing storage devices is always a tricky task and HDD Linux format is no different. Any slight mistake and all your data may be lost or wrongly formatted. Thanks to the available online recovery tools. Ddrescue can come to your rescue at such times. It’s a freeware tool for Linux data recovery. It’s powerful and can recover any data type that is lost in any loss scenario. And if you need to recover formatted Windows or Mac hard drive, then Recoverit (IS) would be a perfect choice.