Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 8 down vote accepted

You can use the 'diskutil' tool for that:

% diskutil list
/dev/disk0
   #:                       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
/dev/disk1
   #:                       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! –  VitoShadow Nov 9 '13 at 14:11
1  
@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 at 18:58

Your Answer

 
discard

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.