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

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?

share|improve this question

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.

share|improve this answer
1  
This is the best answer. Before you run it, List all your disks with diskutil list My SD card is disk2. Then you want to find the partition number, so do something like ls /dev/disk2*. This results in disk2s1. So the final command I run is this sudo fsck_hfs -f /dev/disk2s1. NOTE: I purposly formatted my SD card as hfs. Normally they are using like fat or something. – portforwardpodcast Dec 14 '15 at 9:46

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)
share|improve this answer
    
Actually, it looks like as of 10.9, you can't use fsck without some sort of flag. Using the command as given here results in the help/usage output. – ray Dec 15 '13 at 20:43
    
See Paul’s answer - you have to use fsck_hfs. – Zev Eisenberg Feb 17 '14 at 21:46

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.

share|improve this answer

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.