Have you every wanted to know how many hard drives a system has? Or how to find that USB drive that you just plugged in, that isn’t showing up? It very simple with fdisk.

Fdisk — Partition table manipulator for Linux. Is also a great tool to help you. To see your drives run the following command…

# fdisk -l

You will get an output like the following…

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders, total 156250000 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0×30303030

Device Boot Start End Blocks Id System
/dev/sda1 * 63 41945714 20972826 83 Linux
/dev/sda2 41945715 154191869 56123077+ 83 Linux
/dev/sda3 154191870 156232124 1020127+ 82 Linux swap / Solaris

Disk /dev/sdb: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0001c936

Device Boot Start End Blocks Id System
/dev/sdb1 16065 1465144064 732564000 fd Linux raid autodetect

Disk /dev/sdc: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x000ed120

Device Boot Start End Blocks Id System
/dev/sdc1 16065 1465144064 732564000 fd Linux raid autodetect

Disk /dev/md0: 1500.2 GB, 1500291006464 bytes
2 heads, 4 sectors/track, 366281984 cylinders, total 2930255872 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0×00000000

If a disk has been partation with GUID Partition Table (GPT), usually you will fild them on Apple Hardware, fdisk will not understand how to read them.

The key to remember device types.

/dev/hd[a-h] IDE Disk
/dev/sd[a-p] SCSI, SATA, and USB
/dev/ed[a-d] ESDI
/dev/xd[ab] XT Disks

–Pup