Linux Partitions — They Make Sense! (0)
90% of computer users use Windows. In Windows the command line is largely foregone in favour of GUI (graphical user interface) tools like ‘Computer Management’ and just right-clicking on everything and selecting ‘Properties.’ While Linux (a.k.a. GNU/Linux) has about as many GUI tools intended for administration, it is much more convenient and consistent to use a single tool–the command line interface (CLI).
Regardless of the Linux distribution (i.e. Ubuntu, Mint, Fedora, etc.) that you’re running, you have your CLI interface available with largely the same functionality, regardless of the flavour of Linux (and even BSD) you happen to be running.
Today I’m going to show my fellow Windows users how to look at their partition and drive information using the CLI. Using a few simple commands, you can instantly see your drive configuration, usage information, and much more useful stuff.
In Windows all hard drive/flash drive partitions get a drive letter, as do CD/DVD-Rom and Floppy drives. Usually the main system partition is called C:, the CD-DVD-Rom drive gets the D: letter, and the floppy drive gets the A: letter. A hard drive partition can consist of a whole drive or just a part of a drive. Usually, drives are not “sliced up” in several partitions. The C: drive can just be the C: drive, or is can be the C:, E:, F:, and G: drives.
In Linux the concept of drive letters does not exist. Instead, drives have names and numbers. PATA (wide cables) drive get the name of ‘hd,’ while SATA (narrow cables) drives get the name of ’sd’. After the name of the drive comes a letter which signifies the order in which the drive is looked at. For example, the first PATA drive is ‘hda’ and the first SATA drive is ’sda’. After the order of the drive comes the partition number. Again, the PATA drive’s two partitions will be known as ‘hda1′ and ‘hda2,’ similarly, the SATA drives get ’sda1′ and ’sda2.’
Let’s say that you have two SATA drives in your system, each with three partitions. You will have the following naming scheme:
First SATA drive: sda1, sda2
Second SATA drive: sdb1, sdb2
So, how do you find out what kind of hard drive configuation you have? It’s simple! Open up a Terminal window (if you don’t know how to do this, google “terminal [your distro]“)
less /boot/grub/device.map (note: this will show your your physical drives and their order)
sudo fdisk -l [or] su && fdisk -l (note: this will expand upon the previous command by showing you all parition information)
Next up, I’ll write about the linux file system. It too makes sense!
