We generally use either Hard disk drives (HDDs) or Solid-state drives (SSDs) to store data on our system. These drives can be connected through interfaces – Parallel Advanced Technology Attachment (PATA), Serial Advanced Technology Attachment (SATA), Small Computer System Interface (SCSI) & Non-Volatile Memory Express (NVMe).
After we have attached a drive, the Kernel automatically assigns files (in /dev/ directory). These files represent the drives we have attached. So, when a drive is connected through PATA – it would name device files as /dev/hdX. Similarly, for SATA & SCSI interfaces it would be /dev/sdX. Here X represents a letter for each drive attached. For instance, if there are two drives attached through PATA then drive files would be – /dev/hda and /dev/hdb.
A storage drive can have one ore more partitions depending on what the user prefers. For each partition, we have a separate drive file in /dev/ directory. The partition numbers are allocated to each drive in a sequence, so first partition would be /dev/sda1, second – /dev/sda2 etc. Here, /dev/sda identifies our storage drive and /dev/sda1, /dev/sda2 is about the number of partitions therein.
Then there are other parameters as well. With basics done, we now cover two tools which help us view our disk partitions. These are –
- fdisk and,
Note: Following operations require superuser privileges. In case you don’t have one then, we advise you to contact your System Administrator for assistance.
View disk partitions in Ubuntu
Method I. Through fdisk tool.
Open a terminal and issue the following –
sudo fdisk -l
And, to know more about a specific device –
sudo fdisk -l <device_name>
For instance, for /dev/sda1
sudo fdisk -l /dev/sda1
Method II. Through parted tool.
Issue the following in terminal –
sudo parted -l
In conclusion, we have covered the basics of partitions and tools which are used to view disk partitions in Ubuntu here.