Thursday, February 16, 2017

How to check disk partition on Ubuntu


You might have more than one disk partition on your hard drive, and checking for disk partition on ubuntu is easy to do, you can do it from the command line, i'm going to show you right now.

There are some commands that you can use to check disk partition on ubuntu such as fdisk, cfdisk, parted, and lsblk, here's how to use them:
sudo fdisk -l
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *           63 106028999 106028937  50.6G  7 HPFS/NTFS/exFAT
/dev/sda2       325158912 625139711 299980800   143G  7 HPFS/NTFS/exFAT
/dev/sda3       106029054 325158911 219129858 104.5G  5 Extended
/dev/sda5       106029056 207972415 101943360  48.6G 83 Linux
/dev/sda6       207974400 223596543  15622144   7.5G 82 Linux swap / Solaris
/dev/sda7       223598592 325158911 101560320  48.4G 83 Linux

Partition table entries are not in disk order.

The 'cfdisk' is more advanced command, not only display the partition you can also do something else, like delete partition, set bootable partition and so on.
sudo cfdisk
The 'parted' command only display info about disk partition on your computer. 
sudo parted -l
Last but not least the 'lsblk' command, this one will only display minimum information about disk partition on your system, but this one you don't need to run with sudo.
lsblk

No comments:

Post a Comment