How to Format a Hard Drive in Linux
Formatting a hard drive in Linux using GParted is no more difficult than formatting a hard drive in Windows. As an alternative to the command line, GParted is a free graphical user interface utility that ensures you choose the right parameters as you format and partition your external hard drive for use in Linux, Windows or Mac OS X. After your drive is formatted, you can begin using it to store data.
Things You'll Need
- USB hard drive
- PC with Linux operating system installed
Connect your hard drive to the computer using a USB connection.
Install GParted. From the command line, type “sudo apt-get install gparted”.
Launch GParted. From the command line, type “sudo gparted”.
Choose "Devices" from the GParted menu and select the device you connected. You can tell which one is correct by checking the disk size shown in parentheses.
Select the partition, click the "Partition" menu and choose "Unmount." If a partition is mounted, a directory is listed in the Mount Point column.
Choose “Create Partition Table…” from the Device menu. You are warned that this deletes all data on the disk. Click "Apply."
Select the unallocated space and click "New" to open the Create New Partition dialog.
Choose the size of your partition. If you want to create a single partition for the entire disk, which is recommended, enter in the “Maximum Size” value for the “New Size” field.
Choose “Primary Partition” for “Create as.”
Choose an option for “File system.” If you will be using the hard drive exclusively on Linux systems, choose ext2, ext3 or ext4 , since these file systems are only readable by Linux. If you are not sure which to choose, choose ext4. If you want to use the hard drive on Mac OS X or Windows systems as well, choose FAT32.
Type a name for your partition into the Label field.
Click "Add" to return to the main GParted screen. Your disk is not yet formatted -- you still have a chance to make changes, such as splitting your hard drive into multiple partitions or choosing different parameters.
Cclick "Apply" when you are finished. GParted warns you that all data will be lost. Click "Apply" and GParted formats your drive.
Wait until the pending operations are applied. This could take a few minutes or longer, depending on the size of the drive.
Click "Close" when the operation is complete. Your drive is ready to use.
Tips & Warnings
- The ext2, ext3 and ext4 file systems are similar. The main difference is that ext3 and ext4 are journaled file systems, which makes them more resilient in the case of power outages, improper dismounting and other events that may corrupt data. There are slight performance benefits to using ext2, because less processing overhead is required with write operations, but for most users, these benefits do not outweigh those of journaling.
- Practically all Linux distributions support ext4, but if you are using a much older system, choose ext2 for compatibility.
- The FAT32 file system has the widest compatibility, but you cannot create volumes larger than 2TB or files larger than 256GB.
- You can create multiple partitions of different file systems on a single hard drive. For example, you can have a hard drive with a small FAT32 partition so it can be used on a Windows system. The rest of the drive can be formatted as ext4.
- Formatting or creating a new partition table on a hard drive erases all data on the disk. Back up any important data before proceeding.