Tech stuff and info dump

How to list partitions and basic partition information: linux

May 31st, 2010

To find out basic information about partitions, open a terminal window (Applications -> Accessories -> Terminal in Ubuntu 10.04 and others) and type

fdisk -l

at the command line.

(If nothing happens, try typing

sudo fdisk -l

at the command line and entering your password when prompted.)

Something like this should be displayed:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x66666666

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2613 20988891 c W95 FAT32 (LBA)
/dev/sda2 2614 17532 119830471+ f W95 Ext’d (LBA)
/dev/sda3 17532 19458 15471448 12 Compaq diagnostics
/dev/sda5 13566 17532 31856640 7 HPFS/NTFS
/dev/sda6 2614 13194 84991819+ 83 Linux
/dev/sda7 13195 13565 2980026 82 Linux swap / Solaris

Here, /dev/sda6 is my linux partition.

In Ubuntu 10.04, you can navigate to System -> Administration -> Disk Utility to get a big graphical display of this information (and more).


Filed under: Command line,linux
May 31st, 2010 11:09:40