Learning the Basic Linux Commands and Partitioning a USB
So after learning the basic Linux commands, I was able to learn a few more commands that are completely new to me especially because I was asked to partition a flash disk (USB).
I really did not know what to do back then. O_O I was tasked to be able to partition the flash disk and be able to have more than one flash disk drive appear upon plugging the USB to the USB port. After 2 days of brooding, browsing the Internet, and asking Sir Renan for help, I successfully made 3 partitions on the USB. \ m /
Let me share to you my experience while trying to learn to partition the flash drive and the basic Linux commands. Sir Renan tested me on the basic Linux commands I learned first. I was able to successfully perform the first ones quite easily until he asked me to create 3 folders then erase them all at the same time without typing a long command. That is how I learned of the “wildcard.” It is just the use of an asterisk (*) that means any arbitrary character.
It is better explained in an example. Like if you want to erase all the files contained in one folder, just type $rm * and that will do the trick. So even if you have hundreds of files to erase, you do not have to type them one by one, just use the wildcard. Another example is if you want to delete all files starting with letters abc just type $rm abc* (that will erase all the files that starts with abc followed by any other characters e.g. abcfile.txt, abckat.txt, abc123.txt and with that, other files not starting with abc won’t be erased).
So much for that (haha!), here is my exprerience in partitioning the flash disk. From reading this, hopefully you would know what to do if faced with the same problems I encountered.
First, I had to know which device is the USB so as not to damage any other disk drive upon performing the cfdisk command. After searching for so long and reading many cfdisk tutorials and even the $man cfdisk, I was not able to know how. So I asked Sir Renan and here is the command for determining the devices you recently plugged: $dmesg
or if you want to cut the output short just type $dmesg | tail. With that, I knew that my flash drive is in /dev/sdb.
On to performing the cfdisk command, at first, I could not write the partitions successfully after creating them. It was because I have not tagged any primary partition as bootable. So I tried again but it did not work as well because I failed to specify the file system type. Then, yet again I failed to make the partitions. Beats me why but that’s how my first day in trying to do partitioning ended. On to the second day, I tried searching once more for cfdisk command tutorials and found this site (You can also check it out to learn how to partition your disk drive). I tried partitioning again and this time, I was successful enough to make the partitions but no other disk drives appeared as I plugged the USB. After that, I had to have the USB formatted because it already failed to boot upon plug in. Then, continuing to explore the cfdisk command, I found out that other disk drive names were only created for the logical partitions. So I made logical partitions as well but I still did not have my other flash drive names. I was able to change my partitions and such but no other flash drives appeared as I plugged my device. Sir Renan then asked me to install Gparted, a gnome partition editor, to help me. With that, I realized that the right file system type to use was the FAT so I can be able to share files in my flash disk assigned with different disk drive name. With that, I successfully finished partitioning the USB. But still, I had to use both the Gparted, for specifying the right file type, and cfdisk, to write the partition. My challenge to myself now is to learn the file system types better and working my way through Gparted so I can just work using either when I do my partitioning in the future. 🙂