Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Linux, the command sudo fdisk -l produces an output the lists all the disks and partitions in the computer. The following is an example of fdisk -l output:

Example of fdisk -l output

If I try to use sudo fdisk -l in MacOS X 10.7.5, the output is like this:

fdisk: illegal option -- l
usage: fdisk [-ieu] [-f mbrboot] [-c cyl -h head -s sect] [-S size] [-r] [-a style] disk
    -i: initialize disk with new MBR
    -u: update MBR code, preserve partition table
    -e: edit MBRs on disk interactively
    -f: specify non-standard MBR template
    -chs: specify disk geometry
    -S: specify disk size
    -r: read partition specs from stdin (implies -i)
    -a: auto-partition with the given style
    -d: dump partition table
    -y: don't ask any questions
    -t: test if disk is partitioned
`disk' is of the form /dev/rdisk0.
auto-partition styles:
  boothfs     8Mb boot plus HFS+ root partition (default)
  hfs         Entire disk as one HFS+ partition
  dos         Entire disk as one DOS partition
  raid        Entire disk as one 0xAC partition

Is there another command in MacOS to replicate the behavior of fdisk -l in Linux?

share|improve this question
up vote 23 down vote accepted

You can use the 'diskutil' tool for that:

% diskutil list
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage                         499.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           *498.9 GB   disk1
share|improve this answer
Perfect, it's exactly what I've been searching for! Thank you very much! – Vito Gentile Nov 9 '13 at 14:11
@VitoShadow - Make sure to accept the correct answer please (I think you can at your level). – nerdwaller Nov 9 '13 at 14:12
But what if I want to know the endblock of a partition? – johnboiles Sep 26 '14 at 18:58

Simply use fdisk /dev/rdisk0 to get CHS and end block of a partition

LiuJianweis-iMac:~ liujianwei$ sudo fdisk /dev/rdisk0
Disk: /dev/rdisk0   geometry: 15566/255/63 [250069680 sectors]
Signature: 0xAA55
        Starting       Ending
 : id  cyl  hd sec -  cyl  hd sec [     start -       size]
1: EE 1023 254  63 - 1023 254  63 [         1 -  250069679] <Unknown ID>
2: 00    0   0   0 -    0   0   0 [         0     -      0] unused      
3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
4: 00    0   0   0 -    0   0   0 [         0 -          0] unused 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.