To do this, I first check all my partitions of my file system using the sudo fdisk -l command. According to man fdisk “fdisk (in the first form of invocation) is a menu driven program for creation and manipulation of partition tables. ” -l will ensure the listing of all the partitions. When I run the command on my pc, I got this output:
tarif@tarif-desktop:~$ sudo fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5a4fa8c1
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3243 26049366 c W95 FAT32 (LBA)
/dev/sda2 3244 9729 52098795 f W95 Ext'd (LBA)
/dev/sda5 3244 6486 26049366 b W95 FAT32
/dev/sda6 6487 6610 995998+ 82 Linux swap / Solaris
/dev/sda7 6611 9729 25053336 83 Linux
Disk /dev/sdb: 1017 MB, 1017117696 bytes
33 heads, 63 sectors/track, 955 cylinders
Units = cylinders of 2079 * 512 = 1064448 bytes
Disk identifier: 0xf522590c
Device Boot Start End Blocks Id System
/dev/sdb1 1 956 993263 b W95 FAT32
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 1, 1) logical=(0, 0, 33)
Partition 1 has different physical/logical endings:
phys=(217, 32, 63) logical=(955, 17, 42)
You can clearly see that the disturbing part is the pen drive part! Just what we need. Now, what we are actually going to do is to create a linux file system on our device (which is the USB data drive in this case). So, we need to use the mkfs, which “is used to build a Linux file system on a device, usually a hard disk partition”. Before using the command, we need to unmount the USB drive. So we should write in my case,
sudo umount /dev/sdb1
The drive is now unmounted.
Now we need to use the mkfs command, I'll assume that everyone is very careful at this point, because as my genius friend Taskinoor Hasan once said, “mkfs can not make mistakes. But you can only mistakenly vaporize your entire drive using it!”
So, let's format the thing now!
Write sudo mkfs -t vfat /dev/sdb1
The output was
tarif@tarif-desktop:~$ sudo mkfs -t vfat /dev/sdb1
mkfs.vfat 2.11 (12 Mar 2005)
It's done with ease!
All credit goes to Taskinoor Hasan who taught me this little trick while chatting! This guy is a gem, great to have him as a mentor and friend.
Cheers everyone and if not already, prepare to fall in love!
No comments:
Post a Comment