Fsck: How to Use Fsck Command to Repair Hard Drive on Mac?

By Anna | Posted to Home > Wiki, on October 22nd, 2021

Summary: This post is a simple guide about what fsck is and how to use the fsck command to repair your Mac internal hard disk or any other external hard disk. It also talks about the cases when you need to run fsck.

fsck

Is this annoying you sometimes? Your MacBook fails to boot or Mac is stuck on the loading screen due to a corrupted startup volume or your external hard disk can't work normally because of file system issues.

Don’t panic. This post tells you how to run fsck on Mac to repair the internal and external hard disks and related information about the fsck command.

What does fsck mean?

fsck (file system consistency check) is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux and macOS. And there is a similar command named CHKDSK existing in Microsoft Windows and its ancestor, MS-DOS.

The main function of fsck is to check and repair file system problems. So you can run fsck manually to check your Mac internal disk or external hard drive and repair it if any problem has been found.

However, running fsck requires the familiarity of the command-line interface. As any command can make changes to a file system, so you need to be careful when using the fsck command.

fsck repairs hard disk

When to run fsck on Mac?

The Mac will signal the use of fsck if it has run into issues and needs your attention to fix them. So if you notice the following signs upon startup then your Mac may have encountered issues with the file system and it needs repairing. Watch out for these signs:

  • 1. If the Mac boots up partially and then shows a message asking you to run fsck, then this usually displays a command-line prompt, indicated by a number sign (#). As the command line suggests, you need to run fsck manually.
  • 2. Your Mac failed to display the login screen after booting.
  • 3. Your Mac isn’t able to load the desktop after you have logged in.

Besides, if your external hard drive stops working suddenly, or becomes corrupted, unmountable, unreadable, and inaccessible on Mac, using fsck to repair external hard drive on Mac is highly recommended.

How to use fsck on Mac to repair a hard drive?

If you have run into one of the above situations, it is recommended to use the fsck command now. Also, fsck is highly recommended when Disk Utility First Aid or Mac Safe Mode failed to fix your Mac internal disk or external hard disk.

Run fsck on Mac to repair internal hard drive:

  1. 1. Start or restart your Mac, hold down Command + S key combinations together to boot into Mac Single User Mode.
  2. 2. Some white text will scroll by quickly. When it stops, you’ll see a command prompt at the bottom of the screen that says root#.
  3. 3. Type the following command and then press Enter key:
  4. /sbin/fsck -fy
  5. This runs fsck with the -f flag, which forces it to check journaled file systems like HFS+, as well as the -y flag, which automatically says “yes” to any prompts that fsck may encounter.
  6. Run fsck in Mac Single User Mode
  7. Your Mac will run a diagnostic on your internal drive, and attempt to repair any damage it finds.
  8. If “FILE SYSTEM WAS MODIFIED” appears on the screen, it means one or more problems have been found and repaired. Since additional issues may exist after a repair is made, you should rerun fsck until you see the message:
  9. “The volume (name of your volume )appears to be OK”
  10. 4. This means your hard disk has no problems now. Simply type “reboot” and then press Return to restart your Mac.

Run fsck on Mac to repair external hard drive:

  1. Step 1: Open Launchpad > Other > Terminal.
  2. Step 2: Type in the following command, then press Enter to list all the connected drives on your Mac currently.
  3. diskutil list
  4. Step 3: According to the disk information, Locate the disk you want to run fsck on and find its device identifier. It will look like “/dev/disk2”. You need to write this information down somewhere or take a picture of it since you’ll need it in the next steps.
  5. diskutil list
  6. Step 4: Restart your Mac and hold down Command + S keys to boot your Mac into Single User Mode.
  7. Step 5: This time type in the following command then press Enter.
  8. /sbin/fsck_hfs -fy /dev/disk2
  9. fsck repairs external disk
  10. You need to replace "hfs" with the true file system of your external hard drive as well as replace the drive identifier with the one you just located in setp 3.
  11. Step 6: When fsck is finished checking and repairing the errors in your external hard drive, type “reboot” into the command prompt and press Enter to restart your Mac.

FAQs about fsck

1. How long will it take to repair a disk using fsck on Mac?

The time it takes to repair the disk itself will depend on the condition of your drive, how big it is, and how full it is.

2. Is running fsck safe on Mac?

Since fsck deletes the corrupted files and the blocks related to that file, you’d better back up all the data you care about to keep them safe.

Boot your Mac in Safe Mode

How to Boot Your Mac in Safe Mode to Diagnose & Fix Issues?

Can you use another method to repair Mac internal disk? The answer is yes. This post outlines how to start Mac in Safe Mode and use it to fix Mac issues.Read more >>