How to run fsck on an external drive with OS X?

I'm getting this error when trying to repartition an external drive: "".

I want to run fsck -fy on the drive, but don't know the proper syntax for doing it on an external drive?

Can anyone help me out with this problem?


Actually you want to do:

% sudo fsck_hfs -fy /dev/disk1s1 (depending on what partition you want to check).

It won't work with just fsck you have to put fsck_hfs as the command to run.


I'm getting this error when trying to repartition an external drive: ""

That's a very descriptive error indeed.


In order to run fsck on an external drive, you first need to find out the identifier of the drive. Run diskutil list and check the name of the volume listed under IDENTIFIER – it'll be something like disk3s4, for example.

Use that name to run fsck. You can also pass the -f option to force checking a clean filesystem.

sudo fsck /dev/disk3s4

fsck has shorthands for diverse file system types:

  • fsck_hfs for HFS, use the -f option to force checking journaled systems
  • fsck_exfat for ExFAT (no -f option here)
  • fsck_msdos for FAT (no -f option here)

I had to run with the -l flag:

diskutil list # find your identifier
/sbin/fsck_hfs -l -f /dev/disk16

The -l flag tells fsck to check the drive in read only mode.


This is not a direct answer to the original question, but closely related.

Another option is to use diskutil itself to verify or repair an external drive.
I'm not sure how it compares to fsck, but it fixed my external drive that was not mounting after I accidentally left it plugged in during a restart for a system update.

diskutil list  # to find the IDENTIFIER
  (some internal disks listed first)
  /dev/disk2 (external, physical):                                              
    #:                    TYPE NAME                    SIZE       IDENTIFIER
    0:   GUID_partition_scheme                        *500.1 GB   disk2     
    1:                     EFI EFI                     209.7 MB   disk2s1   
    2:               Apple_HFS FreeAgent GoFlex Drive  499.8 GB   disk2s2   

and then commands such as

diskutil verifyDisk disk2
diskutil verifyVolume disk2s1
diskutil verifyVolume disk2s2

For some reason just running the verify commands solved my issue, but if you need to go further there are also repair commands:

diskutil repairDisk disk2
diskutil repairVolume disk2s1
diskutil repairVolume disk2s2