How to Repair a Mac Disk with fsck from Single User Mode

Aug 7, 2013 - 72 Comments

Using Disk Utility through Recovery Mode is the preferred and primary tool for repairing disks on the Mac platform, but if Disk Utility is either unavailable or not able to repair a drive, then Single User Mode and the command line tool fsck should be your next choice.

fsck

The fsck tool is bundled with every Mac, but because it’s accessible exclusively through the command line it may appear complex and sound more intimidating than it really is. Fear not though, because using fsck is actually quite simple, and there are several cases where it can repair a problem with a drive that Disk Utility was unable to.

How to use Single User Mode and fsck to repair a disk

  1. Boot the Mac into Single User Mode by holding down Command+S during system boot after you hear the boot chime, you know you will have successfully entered Single User Mode because you will see a bunch of white text on a black background scroll by
  2. When the Single User boot sequence has finished, you’ll find a small command prompt at the bottom of the screen prefixed by a hash sign (#), when you see that type the following command exactly:
  3. fsck -fy

  4. Once fsck completes, if you see a “File system was modified” message, then you should run “fsck -fy” again until you see a message stating “The volume (name) appears to be OK” – this is standard procedure of using fsck
  5. Type “reboot” to leave Single User Mode and boot the Mac back into OS X as usual

Once OS X is booted again, it can be a good idea to confirm all is well by going back to Disk Utility and running the “Verify” tool to check on the drives health.

Keep in mind that if the ‘fsck’ tool continuously fails or reports errors and Disk Utility is a no go as well, the hard drive itself very well may be failing and on its last legs, so be sure to initiate a back up all of your critical data using Time Machine or your backup method of choice, and aim to get the drive replaced sooner than later.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS X, Tips & Tricks

72 Comments

» Comments RSS Feed

  1. jeniffer brolaney says:

    amazing!! thank you sooo much! i was so mad cuz i bought a used macbook from a private seller and she/he left it logged in. i couldnt download anything. i couldnt change anythiny. for heavens sake i couldnt even get in! anyways thanks! haha(:

    • Sarah Lambert says:

      Sorry to publish as a reply to Jeniffer, but I can’t see a way to post a standalone comment.

      I’m using fsck_hfs on an external unmountable disk which shows up in the Disk Utility but can’t be repaired there. The trouble is it’s bex drive and I don’t know if it’s completed as fsck gives no progress feedback. I loaded the log into a browser (var/log/fsck_hfs.log) and it says:

      /dev/rdisk3s3: ** Checking volume bitmap.
      /dev/rdisk3s3: Volume bitmap needs minor repair for orphaned blocks
      /dev/rdisk3s3: ** Checking volume information.
      /dev/rdisk3s3: Invalid volume free block count
      /dev/rdisk3s3: (It should be 231534230 instead of 232333870)
      /dev/rdisk3s3: Volume header needs minor repair
      /dev/rdisk3s3: (2, 0)
      /dev/rdisk3s3: ** Repairing volume.

      but there is no completion indication. When I try to close terminal, it says it will terminate the running process fsck_hfs. The console was showing 99% CPU usage by this process last night, but this orning it’s zero.

      Can I assume fsck is finished? How else would you know?

      Thanks for any useful information!

      • Roberto says:

        Scroll down past the other comments and there’s a giant standalone comment box. You sound very impatient, not good for running disk repair.

        Unless fsck has finished running, which it will indicate by ceasing running on it’s own, do not assume fsck is done running until it has finished running. Period. Your log clearly shows the volume needs repair, and that fsck is “Repairing volume” that means it is repairing the volume. Be patient, it can take a long time if the drive is large, slow, or failing.

        If you reboot in the middle of fsck running you can damage the disk and cause data loss. I hope you have a good backup handy.

    • Michael says:

      This worked for me, the problem was fixed and only took about 5 minutes.

  2. Dimitris says:

    That was easy. The Mac is telling you that once in S.U. Mode!
    The trick is how you find the partitions (names) you might have and fsck them.

  3. Mikko says:

    This was a splendid advice. I used it for a Yosemite system disk.
    The first run of fsck was disappointing:
    ** The volume Macintosh HD could not be repaired.
    *****The volume was modified *****
    But the second run was very promising:
    ** The volume Macintosh HD was repaired successfully.
    *****The volume was modified *****
    And the third run confirmed
    ** The volume Macintosh HD appears to be OK.
    Thank you very much!

  4. Himadri says:

    Thanks a ton…!!!

    This was really an excellent approach… worked for me on my Macbook Pro HD with lately upgraded to OS X Yosemite…I tried to fix the issue using Disk Utility, but it failed to repair the disk…Then I tried with ‘fsck -fy’ and the first time it showed it’s charm….!!!

  5. Allan Ferreira says:

    Fixed!!! Thanks

  6. olka says:

    Thanks, saved my day!

  7. Khnz says:

    Hi mate

    Can you help me out with my MacBook Pro? I try to boot fsck on my mac according to your suggestion when it failed to show the HDD. When I put fsck in, it said command not found. What should I do?
    Thank you

  8. Feno1 says:

    sbin/fsck -fy absolutely worked for me on MB Pro. Well done and thanks for sharing.

  9. Josh. says:

    Hi,

    I’ve had big problems with my macbook, there is no command line prompt after starting up with command S. The last line finishes with ‘errno 5’. I am also unable to start the computer in recovery mode or safe mode, it just gets to the grey mac loading page and stops with the bar half full but never finishes.

    Please any help.

  10. Gian says:

    I’ve been having permission problems since I upgraded my mid 2009 macbook pro with a ssd drive and 8gb ram a few months ago. However what I notice is that after ejecting my external HDD the permission problems reappear and I have to reinstall everything using safe boot and the last backup in time machine. Does anyone have any idea if the external HDD or the new ssd or ram creates the problem? Is something failing?

  11. Alli says:

    Help! I don’t know what to and how to fix my Mac. When I ran the Fsck -fy this is the message I got:

    Running fsck on the boot volume…
    ** Checking Journaled HFS Plus Volume.
    ** Checking extents overflow file.
    ** Checking catalog file.
    Keys out of order
    (4, 25167)
    ** Rebuilding catalog B-tree.
    ** This volume Macintosh HD could not be repaired.
    ***** FILE SYSTEM WAS MODIFIED *****

    I have ran it several times and i still get the message.

  12. Jessica says:

    I’ve bern trying this method, but having trouble. I get to the root# but then I cannot enter any text. Above that a few lines it reads “singleuser boot — fsck not done”. Am I just not giving it enough time to process? I let it run for fifteen minutes. I wasn’t sure what to expect.

    • Mat says:

      fsck scans your entire hard drive, it can take hours. If you don’t have the time to wait, take it to an Apple Store for repair.

  13. Mark says:

    Hi thanks for all the info here! My 09 MacBook pro was updated with a Samsung 512 SSD and 8 Gig memory, it didn’t take the install of Yosemite the first several times when I installed last fall, and now it will not start up, will not let me install back ups from a external drive, I tried disk utility and it says it can’t be repaired I ran a the above mentioned and it says the samething can’t be repaired and invalid volume file, volume directory, volume free block count, it gives the number it should be and the number it is. The volume HD could not be repaired Do you have any suggestions before I call Apple? Thanks!
    Mark

  14. Isabelle says:

    Hello!

    I’m having the same problem as Josh with my iMac:

    “there is no command line prompt after starting up with command S. The last line finishes with ‘errno 5′. I am also unable to start the computer in recovery mode or safe mode, it just gets to the grey mac loading page and stops with the bar half full but never finishes.”

    Can anyone help? Thanks!

  15. Mike says:

    Awesome. It’s fixed. :-) Thanks a million

  16. bettina b says:

    I’m getting the “file system modified” running fsck until I get “The volume Macintosh HD appears to be OK.” and finally, typing reboot and hitting return.

    still getting stuck at the restart screen when trying to turn on my MacBook though. It’s a 2006. You think this means my hardrive is just on its last legs then?

  17. John says:

    I had to install new SSD after HDD failed. How can I run from command line to fix HDD that I now have connected via USB?

    • Chuck says:

      I am having the similar problem, replaced the hard drive in iMac, but now I would like to copy the files from old Mac HDD , I was able to see the folders after connecting USB, but I am not able to copy the files.

      Sincerely appreciate your help..please!!!!

  18. Bill Bamford says:

    Brilliant!! After wasting hours trying to get Disk Utility to fix my computer, and talking to Apple Help people in the USA (to no avail) your instructions worked perfectly.
    I’m very grateful

  19. maggie says:

    I tried fsck-fy it says command not found

    Tried sbin/fsck-fy and it says no such file or directory?
    I have a late 2009 imac updated the software and I cannot get it to boot at all, I got the same code 8 in disk utilities
    Anymore suggestions please

    • paul says:

      There needs to be a space between ‘fsck’ and the flag ‘-fy’ so the proper command is “fsck -fy”, not “fsck-fy”, the space in between characters is essential. Command line always requires precise syntax!

      You can also try:

      fsck -f

      If you want to have it more interactive.

      • AC says:

        Just a note: don’t suggest using only the “-f” flag for people that are, well, casual users.
        They’ll be better off just letting the fsck do its job automatically with “-fy”.

        • rinopo says:

          man fsck :

          > Without the -p option, fsck audits and interactively repairs inconsistent
          > conditions for filesystems. It should be noted that some of the correc-
          > tive actions which are not correctable under the -p option will result in
          > some loss of data. The amount and severity of data lost may be deter-
          > mined from the diagnostic output.

          > -y Assume a yes response to all questions asked by fsck; this
          > should be used with great caution as this is a free license
          > to continue after essentially unlimited trouble has been
          > encountered.

  20. maggie says:

    Thank you!
    Re entered it and it’s scrolling really fast the same thing, it says:

    Disk0s2: media is not present.

    And it’s been scrolling that for quite a while, not sure is it should be doing that or how long it should be doing that for (been over an hour already) but fans blowing and mac is pretty hot?
    Any suggestions ?

  21. Simon says:

    I’ve tried both fsck -f and fsck -fy but keep getting that the ‘volume could not be verified completely. Bash-3.2#

    Any advice would be much appreciated thanks

    • Kris says:

      Hi Simon — i’m experiencing the same issue (and error message) on a friend’s MacBook Pro. Was there any resolution for you?

    • PH says:

      I too, am having the same problem. I have searched online for hours upon hours and I cannot find a solution that works!

      • tim says:

        You have to run fsck from Single User Mode, recovery mode, or a separate boot partition, otherwise the drive is mounted in write mode and fsck can not work or run properly.

        Reboot > hold down OPTION key> choose Recovery mode > go to Utilities menu > Terminal > then run fsck -fy command from there

  22. Joel M says:

    Thank you so much! I just ran this and it completely fixed the problems that Disk Utility kept reporting. I’m so glad to know I don’t have to replace my hard drive!

  23. Mary says:

    Hi there, I’m trying out this method now and I’m getting a lot of “invalid node structure” and “invalid record count” on the black and white command lines after entering the fsck -fy command in single mode. Is this normal and should I wait it out?

  24. James says:

    Thank you for the clear, concise advice for a novice. After much research for different solutions this was the easiest and fixed my issue.
    Much appreciated!!

  25. James says:

    Thank you for the clear, concise advice for a novice. After much research for different solutions this was the easiest and fixed my issue.
    Much appreciation!

  26. James says:

    You’re the best! Thank you for the clear, concise walk through! Fixed my problem!

  27. uli says:

    Thanks a lot. Fixed my issues in el capitan…

  28. Ashley says:

    I am having the same problem as Bettina and Claire above, any advice?

  29. Menseken says:

    Hi, I just yesterday swapped a 32GB-highspeed-SDcard (with ATA adapter) for a 20GB HD in my oldie iBook-G3-600.

    I had previously cloned two partitions (MacOS 10.3 / 10.4.11) onto a Samsung-extreme SDcard with CarbonCopyCloner.
    I did the change (took me a few hours) only to learn that neither partition would startup …

    I tried to re-install MacOSX 10.4 but had NO success. To get things going I tried 10.3 which happily installed.

    After applying all fsk and diskutility tricks to be found on the net, I finally got rid of the “keys out of order” notification, BUT. Restarting hopefully, I got a black screen with “can’t exec bin/sh” sadistically spelled out on it.

    What finally saved me was totally simple:
    I once more cloned the 10.4-partitions contents to a third smaller partition (running 10.3), simply “erased” the 10.4-partition via disk utility -took about a minute- and re-cloned the 10.4 contents back to its original partition.

    THIS ONE WORKED.

    The solution was SOOOO simple – and would have saved me hours of research, restarts and despair.
    Now I have a G3-iBook, absolute silent, and a much quicker system start, plus additional 12GB HD — for just under 40 euros.
    Good luck to you, Menseken

  30. kelvin says:

    Hii. I badly need help/ I have a snow leopard macbook 10-6-8. The battery was not working properly and since february im using it without battery. But i was using it wiz only 25% brightness on as if i put it on 100 % brightness it switches off instantly. My problem is that since 2 days the brightness came up to full and im not being able to switch the mac on for long. Can u find me a way how i can reduce the mac’s brightness while being in the single user mode. Thank you very much in advance.

  31. Dave says:

    I’ve run fsck -fy but keep getting the message ‘volume could not be verified completely. Bash-3.2#

    Has anyone overcome this issue, noticed a couple of others have had this same error message.

    Thanks

  32. Sebastiaan says:

    OK, I have a MB Pro with a dual drive setup. OS drive and Data drive. It ‘s with the data drive that I’m having trouble. Disk Utility is not able to repair it. So how can I run this fsck command on this disk? I read somewhere to use ‘diskutil list’ to figure out what command line to use. But apparentely, you can’t run diskutil in single-user mode.

    • Steve says:

      Just boot with the working drive, it’s recovery partition or a USB recovery drive, open Terminal and type “diskutil list”. You’ll see the disk identifiers listed on the right. You’ll see several indentifiers for each disk. You want the one that corresponds to the name of the drive (the user partition).

      Better late than never :)

  33. Gary says:

    Is there a way to do this on an external drive? Remove the read only?

    • Jennifer says:

      Did you happen to find a solution to this problem? I’m getting the error message that my Time Machine Backup is corrupt (and also that it’s now a read-only drive since the backup had previously failed and still shows in progress – which is a backup that the system won’t let me delete because I don’t have the correct permissions.) and I’ve tried to repair the drive with Disk Utility, but it always fails. When I boot into recovery mode the Time Capsule doesn’t even show up. I’m willing to try using the “fsck -fy” command, but I don’t know how to do that for ONLY my Time Capsule and not my normal HD (which isn’t giving me any of these types of errors and shows as “OK” when using the disk utility.) does anyone know of a way to repair an external drive WITHOUT using the disk utility? Thanks!

      • Jennifer says:

        Also – when I run the disk utility on my Time Capsule drive, it’s fine. What I meant to say is that when I try to run the disk utility on my backup sparse bundle that is when I get the error and it says that it’s corrupted.

        • OTn says:

          Your external drive may be failing, it happens and can cause problems. There could be a problem with the Time Machine backups themselves too, you could always format the drive and set it up again, but you’d lose the data on the drive if you format it.

          You can get a list of all drives connected to the Mac with ‘diskutil list’ command:

          diskutil list

          Then you would have to locate the identifier (looks like disk3s2 or something like that) for the Time Machine drive, mount that, and run fsck on that volume.

          Good luck! If the drive is failing it would be best to buy a new one, external hard drives are cheap on Amazon these days, here is a list: http://amzn.to/1qEiM1L

  34. Jade says:

    Over the last few months I began to notice my iPhoto documents were getting corrupted. Either I couldn’t open a photo or video, the screen would be green, or my computer would freeze. Laptop was unable to back up documents as of January 2016. Other than iPhoto, everything ran quick and smooth, until I’d open iPhoto and 50% of the time I’d have an issue.

    Last night my computer tweaked out, the screen splitting down the middle and shifting half way across the computer. My mouse could not roam in the middle of the screen between the 6 and 7 keys, and when scrolling left or right it would continue to the other side of the screen, as if in a game of snake. Force restarted and it worked for about an hour until dying again.

    Current situation starts computer with chime, grey screen, Apple logo and spinning wheel. Last couple times grey lines appeared across the screen. Every reboot goes well until just before the login screen where it freezes up on the grey screen. Computer sounds normal, fan is running, no overheating.

    I’ve done the safe boot, command V, command R, command S with fsck-fy. Got the “volume appears to be okay” message twice. All reboots freeze on the grey screen before the login page, and my caps lock has only successfully lit up twice. Battery responds but other than that the only other function that seems to work is the power button.

    PLEASE HELP! My last hope short of returning to the Genius Bar!! Can’t find any other forums with a similar issue to this. Using a MacBook Pro 15″ replaced in 2013! Thanks

  35. Bilal says:

    My Mac is crashed and I tried fsck – fy with /sbin too. It shows the following message ‘ The volume could not be verified’. Please help me. I need my Mac back. Please plea#e please. And I don’t hav os x installation disk.

  36. rinopo says:

    What’s the point of specifying -f without the -p option?

  37. Hafid says:

    I’ve tried many times by using command “fsck -fy” but still its showing “The volume Mac OS could not be verified completely”

    Please help me to fix this error.

  38. Sara h says:

    Have an old macbook that I believe is having a kernel panic issue(won’t boot stuck on restart your computer message) won’t boot inyo recovery mode, tried safe mode&after selecting Mac HD was stuck on white screen then shut off. Booted in verbose mode& was able to take picture of the log on my phone. Then restarted into single user to try deck process but the last line stops at system uptime in nanoseconds:23735473361 and won’t let me enter anything, i also took a picture of the screen but I’m not one to post comments or questions much so I don’t even know how to upload or show that to anyone in this comment. I don’t have the original install disks but I know it came with osx 10.5.2 and is a macbook 4,1 .so I’m just wondering exactly what to buy when looking to purchase a new set of install disks, please be as specific with this as possible as I’m getting overwhelmed with all the different versions & names , thank you I appreciate your time.
    -not concerned about losing any data on the computer& don’t have any backup/recovery disks

  39. Ranjeet says:

    fsck_hfs this worked for me also. But performing this we should first take backup of the our Mac.

    • anthony says:

      I seem to be having the same problem as betina b. After running fsck -fy and going through reboot it is still freezing up at load 1/8th through. Should I run fsck_hfs or fsck -f?

  40. jay wang says:

    I tried the fsck -f,but its showing volume / is mounted with write access. Re-run with (-l) to freeze volume.and i tried fsck -l -f, but its still show fsck: -l flag requires a number.
    i dont know how to do next,please help me,thank you.

  41. Andrea says:

    Hi all,
    I’ve been experiencing some trouble with my MBP early 2011, running on Mavericks, but last night it completely gave up and is beyond repair by Disk utility, as I tried many advices from the web. There is clear a serious issue with HD so my last ditch effort was the fsck -fyd command on single mode. However, after 6hours I still don’t get the blinking cursor enabling me to type the command… I know I have to be patiente but I started to think over 6 hours is quite long.
    As I’m no expert on this I started to think it is repeating the command over and over and they are basically:

    hfs_mountfs: hfs_mountfs returned 22, rvp (0xffffff8038ba5f00) name (unknow device)
    Cannot mount root, errno = 19

    Bsd root: Disk 0s2, major 1, minor 3
    Hfs: open_journal_device
    ?UMñ not found. Waiting 10sec.

    hfs_mountfs: hfs_early_journal_init indicate external jnl

    I’ve tried the single mode twice, the first time due to low bat it shut down, my bad, so I’ve agian with the power on and it is over 6 hours…
    I’m tempted to stop it but I’m afraid to cause a greater damage on an already bad HD.
    Please help…Thanks.

  42. Utkarsh says:

    Thank you , I have fixed my Mac SSD using fsck.
    Thank you so much.

  43. KJHawk says:

    THANK YOU SO MUCH. And, yes, I was yelling. In gratitude. Glad to find simple solutions to complicated problems.

  44. Kimberly Green says:

    Thank you so much! Fixed my issue. Computer runs great

  45. Taz Ayafa says:

    Please help me on this:After restarting my MBP by holding down Command +S key, I arrive at a dark screen with white writings. The problem is that it is not displaying a space or ‘blinker’ for me to type fsck -fy in it.

  46. Candy says:

    Okay, the problem I am having after going through single user mode, running the file system check is it still won’t reboot after getting the okay message. I ran it three times. The first two said the file system was modified, and then the last run, everything came back okay. I typed reboot and enter. Was prompted for login password. Was able to input thatnand hit enter, but now after 5 minutes, I’m still staring at the grey screen with Apple and spinning pinwheel. It doesn’t boot past this. This was the same issue I had been having which brought me through all the repair steps upto the last attempt in single user. Not sure what the problem is here.

  47. Candy says:

    Also to add, the problems began when downloading a large software program, Adobe creative cloud. My suspicion is it was too much for my memory and then the crash began. It also won’t boot is safe mode. Same screen it gets stuck on.

  48. Candy says:

    Also already did the SMC and NVRAM reset 😲

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates