in

Verify and Repair a Mac Disk via Command Line in Terminal



In this video we show some Terminal commands that allow you to have a bit more control over Verifying and Repairing your Hard Drive or any External Disk or USB Flash Drive than what the Disk Utility App gives you.

Please Like, Comment, Subscribe and Share! We release videos often to help you get the most out of your Apple devices!

Let us know if the video helped you in the comments below! If you have any suggestions on topics we should cover, please also put them in the comments below.

Thanks for watching!

Gemsbok Website:

Share this:

32 Comments

  1. Please advise how to get my iMac to function correctly by viewing description of my problem below –

    I have a circa 2009 iMac 27" 1352 running macOS High Sierra 10.13.6.
    Here's the story so far. Computer always boots 👢 to recovery mode no matter what I have tried so far. I am trying to avoid a USB recovery as I don't want to lose data, which is circa 280GB. Also, I don't want to pay for data recovery software. This is what I have done so far
    1) Recovery Mode/Disk Utility (refer to picture's)
    2) Initially Disk0 was showing full 1TB Untitled
    3) OS X Base System circa 1.5 GB Disk0s2
    All options were available, so I chose to click on the recover option of OS X Base System.
    After that, Disk0 showing full at 1TB but instead of Untitled it has changed to OS X Base System with all options greyed out.
    Disk0s2 is the same except OS X Base System now has a smiley Mac face with all options greyed out.
    I am using a PC keyboard as I don't have a Mac keyboard yet.
    No matter what start up options or terminal commands I try, I am coming to a brick 🧱 wall.
    I have spent many hours so far & don't want to give in to formatting.
    I know someone out there with more knowledge than me has the answer.
    If you are a computer enthusiast as I am you will understand my passion.
    What a great sense of achievement it will be to be able to boot 🥾 to the desktop without formatting & no loss of data.
    Please help me to bring my computer back to its former glory.

  2. Is there any other solution to mount the drive, if its either not showing in disk utility, nor in the terminal? I only see the Hard Drive in System Information under USB. In my case I cant use the commands, because I dont see anywhere the BSD name diskxsy…

  3. Hi, I have error my SSD 6TB Please is there any suggestion will appreciate Thanks
    ~ % diskutil repairDisk /dev/disk3
    Repairing the partition map might erase disk3s1, proceed? (y/N) y
    Started partition map repair on disk3
    Checking prerequisites
    Checking the partition list
    Adjusting partition map to fit whole disk as required
    Problems were encountered during repair of the partition map
    Error: -69697: Partition map repair failed while adjusting structures to fit current whole disk size
    Underlying error: 5
    Ali@Asifs-MacBook-Pro-2 ~ %

  4. Hi there, I came across your video while searching how can I pull files from an old Windows laptop's hard drive. I was able to unscrew the hard drive from the (Dell) laptop and I purchased a shell case that allows you to put the hard drive in it to act like an external hard drive. I've hooked it up to my Mac, but nothing comes up when I try to find it. I tried using the tips in your tutorial, but was unsuccessful. The drive does lit up and vibrates from time to time so I know there is some type of connection. I just can't seem to locate the drive itself on my Mac. Any suggestions or ideas on what to do would be greatly appreciated. Thanks in advanced for your time.

  5. Hi, thank you for this very helpful and straight forward video. Unfortunately I have an exFat formatted drive (formatted using a Mac), and the volume, I believe, was corrupted or compromised while connected to a Synology NAS, for backing up data, ironically.. I tried this repair in command line, but received this message… "Unable to repair this whole disk: A GUID Partition Table (GPT) partitioning scheme is required (-69773)
    " Any suggestions? Most if not all of the data was backed up, but it's an edit drive so I'd really like to get the volume back so I can preserve the file structure I had for Premiere Pro. Any advice would be greatly appreciated!

  6. Currently, I am working on a macOS Monterey MacBook Air (M1, 2020), and I can't use sudo command in Terminal
    sudo: /etc/sudoers is world-writable
    sudo: no valid sudoers sources found, quitting
    sudo: error initializing audit plugin sudoers_audit

    How can I fix it? Please help me

  7. I received the following error when trying to repair my disk. diskutil repairDisk /dev/disk2
    Unable to repair this whole disk: A GUID Partition Table (GPT) partitioning scheme is required (-69773) Any suggestions?

  8. Thanks, I tried but doesn't works. It writes me " Nonexistent, unknown, or damaged partition map scheme
    If you are sure this disk contains a (damaged) APM, MBR, or GPT partition map,
    you can hereby try to repair it enough to be recognized as a map; another
    "diskutil repairDisk /dev/disk7" might then be necessary for further repairs
    Proceed? (y/N) y
    Error repairing map: Input/output error (5) "
    Can you help me?

  9. Hi how you doing… I follow all the steps in your video.. at the end the Mac mounts the external hdd but then I can do nothing more.. does this mean the hdd it finished??? or is anything else I can do???
    Thanks in advance

  10. Your video on the diskutil is great. I'm in the process of making a clone copy of the disk but thought of using the new SDD and formatting as AFPS encrypted and re-running CCC but warning comes up that the machine may not start properly etc etc. Not sure if that would work anyway.

    Not sure if you have worked out a work around but everything says that Mojave will not operate Time Machine due to format not being encrypted. Is there a way to work around this problem that you miraculously discovered. I can't upgrade to 64 bit as my accounting software is still the old 32 bit AccountEdge which works fine.

    Cheers