Results 1 to 5 of 5
  1. #1
    Inadvertant 'diskutil eraseDisk'. Options?
    I am hoping for some power user input here.

    Problem: I inadvertently performed a 'diskutil eraseDisk' on an external hard drive (I specified wrong device). File system JHFS.

    Question 1: Is there a Mac OS command to recover the original partition table. I have not written to the drive.
    Question 2: Is there a suggested utility to simply rebuild the original partition table? Most just rebuild the file table, so you can offload.
    Question 3: If 1 & 2 are not an option, would EaseUS or Gparted recover the disk, even though it was reformatted?

    Command & Disk Details: Here are the before & after details, as well as the offending command.

    Before
    diskutil list
    /dev/disk4 (external, physical):
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *8.0 TB disk4
    1: EFI EFI 314.6 MB disk4s1
    2: Apple_HFS LIVE-A-DATA 7.0 TB disk4s2
    3: Apple_HFS LIVE-A-TIMEMACHINE 999.9 GB disk4s3

    Offending Command
    sudo diskutil eraseDisk JHFS+ NEWDISK disk4

    After
    diskutil list
    /dev/disk4 (external, physical):
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *8.0 TB disk4
    1: EFI EFI 314.6 MB disk4s1
    2: Apple_HFS NEWDISK 8.0 TB disk4s2

    Please let me know if you need anymore information.

    Thank You.

  2. #2
    I should also add that I have another disk, exact same make/model/spec, with the exact same partition layout
    as the one that I inadvertently erased.

    I am wondering if that also might open some doors, since I have a dump of the partition table:
    $ sudo fdisk -d /dev/rdisk3
    1,1953506645,0xEE,-,1023,254,63,1023,254,63
    0,0,0x00,-,0,0,0,0,0,0
    0,0,0x00,-,0,0,0,0,0,0
    0,0,0x00,-,0,0,0,0,0,0

    Question: Is it plausible that I can manually edit the erased disk with the partition table data of the good disk?

  3. #3
    Inadvertant 'diskutil eraseDisk'.  Options?
    chscag's Avatar
    Member Since
    Jan 23, 2008
    Location
    Keller, Texas
    Posts
    59,795
    Your Mac's Specs
    2017 27" iMac, 10.5" iPad Pro, iPhone 7+, iPhone 8, Numerous iPods, Catalina
    Rep Power
    55
    Welcome to our forums.

    There are numerous data recovery apps for the Mac. Some of them work better than others, however, most are expensive to buy.

    Data Rescue 5 and Disk Drill Pro seem to be the most effective. You asked about recovering the partition table which I don't believe either of those recovery apps can do.

    Someone else will have to comment on whether you can copy the partition table from one drive to another.

  4. #4
    Inadvertant 'diskutil eraseDisk'.  Options?
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    12,400
    Rep Power
    24
    Since you know what the drive looked like before and have another machine you can use as a reference, try following the instructions on this page: Repair a Mac OS X HFS+ Partition table – [PERR0_HUNTER]
    --
    Regards
    ...Ashwin


  5. #5
    Inadvertant 'diskutil eraseDisk'.  Options?
    Randy B. Singer's Avatar
    Member Since
    Feb 01, 2011
    Location
    Sacramento, California
    Posts
    1,783
    Rep Power
    13
    [QUOTE=capnd;1843161]
    Question 2: Is there a suggested utility to simply rebuild the original partition table?


    I have just the thing, and it's free too!:

    testdisk (free)

    TestDisk - CGSecurity

    TestDisk Download - CGSecurity
    Randy B. Singer
    Co-author of The Macintosh Bible (4th, 5th, and 6th editions)
    Mac OS X Routine Maintenance http://www.macattorney.com/ts.html

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Confusing Diskutil List result?
    By rolanddes in forum macOS - Operating System
    Replies: 23
    Last Post: 07-04-2018, 05:11 PM
  2. inadvertant change in the way Mail is displayed
    By grumpygramps in forum macOS - Apps and Games
    Replies: 1
    Last Post: 07-20-2014, 09:52 AM
  3. mounting 2nd hdd in mac OS (diskutil) issues
    By ruh8n2 in forum macOS - Operating System
    Replies: 0
    Last Post: 10-04-2011, 11:38 AM
  4. Command Line Diskutil question
    By Vpr99 in forum macOS - Operating System
    Replies: 2
    Last Post: 08-08-2011, 04:34 PM
  5. diskutil resizeVolume question
    By xbsd in forum macOS - Operating System
    Replies: 0
    Last Post: 03-20-2007, 02:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •