Using Fdisk to View Partition and Disk Information

If you ever need information about your attached media, whether it is a hard disk, solid state drive or something else, you can use fdisk to view them. It is quick, easy and can give you a lot of information.

To view currently attached disks, run this command as root:

fdisk -l

(That is a lowercase L)

Your output should look something like this:

Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0008cdc1


Device Boot Start End Blocks Id System

/dev/sda1 2048 17598463 8798208 82 Linux swap / Solaris

/dev/sda2 * 17598464 976771071 479586304 83 Linux

In this example, “/dev/sda” is the device name that Linux will use. It is a 500 GB disk, and it has two partitions: /dev/sda1, which is your swap partition, and /dev/sda2, which is a bootable partition. The “System” column gives you an idea about the file system type, also identified by the “Id” number. It will not list the specific file system type.

You can also use Fdisk to create and manipulate partitions. For more extensive information on fdisk, see the online documentation or type “man fdisk” from the command line.