It’s very easy to format pendrive or any other external hard drives in Linux.
The formatting of the drive will erase all the files and directories in
your drive which cannot be recovered. So, be careful while formatting
the drive. You can use either command line or the graphical way to
format the drive. Once, you plug in external drives in the computer,
that will map to /dev/sda or /dev/sdb1 etc. The names can vary. We will
identify external drive with the name. Follow these simple steps to
quickly format the USB drive or pendrive or external drive in Linux:
Format using Terminal:
1. Identifying drive:
Insert the external drive and type the following command in the terminal:dmesg | tail
The word “sdb” between the big brackets is the name of your external device that you just inserted. And the sdb1 is the partition name or generally it is the actual name that we are going to use while formatting the drive.
2. Unmount the drive:
After we identified our drive, another step is to unmount the external drive. Use the following command:sudo umount /dev/sdb1
The word “sdb” between the big brackets is the name of your external device that you just inserted. And the sdb1 is the partition name or generally it is the actual name that we are going to use while formatting the drive.
3. Format the drive:
The drive can be formatted into two formats: EXT3 and FAT32. The EXT3 format only works in Linux machines whereas FAT32 format works in Linux, MAC and PCs.Format in FAT32 file system:
Use the following command:
sudo mkdosfs -n 'New' -I /dev/sdb1
Format in EXT3 file system:
Use the following command:
sudo mkfs.ext3 -n 'New' -I /dev/sdb1
Wheres, -n ‘New’ gives the name ‘New’ to the formatted drive and -I force the format to work properly. However, they both are not mandatory.
Format using GUI:
If command line scares, you there’s a tool called Gnome format that lets you to format external drives easily. Install gnome format using the following command:In Ubuntu/Mint:
In Fedora/Cent OS/Red Hat:sudo apt-get install gnome-disk-utility
Most probably, Gnome Disk Utility is already available in Fedora, Cent OS or Red Hat machines.
If it’s not, type the following command to install.
sudo yum install gnome-disk-utility
0 comments:
Post a Comment