Terminal eraseDisk Command

Discussion in 'macOS' started by kkachurak, Apr 22, 2009.

  1. kkachurak macrumors regular

    Joined:
    Jun 26, 2007
    Location:
    Orlando, FL
    #1
    I need to erase a disk I bought with NO formatting. I shouldn't have initialized it when I connected it, and now I need to erase it but do NOT want to format it.

    I've been trying to use diskutil eraseDisk %noformat% /dev/disk1

    Like the diskutil eraseDisk instructions tell me to, but it won't take.

    Any help?
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
  3. Guiyon macrumors 6502a

    Joined:
    Mar 19, 2008
    Location:
    North Shore, MA
    #3
    Try one of these:
    Code:
    sudo dd if="/dev/zero" of="/dev/rdisk1" bs=8m
    sudo dd if="/dev/random" of="/dev/rdisk1" bs=8m
    The first will zero out the drive while the second will write random data to it (it will be much slower!); either command should kill any existing formatting or partition tables. Make sure you have the correct 'of' argument! Having the incorrect value will cause dd to scribble over whatever is there, it will not ask or confirm, it will just do; dd is not nicknamed 'Data Destroyer' for nothing! Tweaking the 'bs' argument may also increase/decrease the speed of the copying. Leaving off the suffix will indicate a blocksize in bytes and 'k' (kilobytes) or 'm' (megabytes) are valid.
     
  4. kkachurak thread starter macrumors regular

    Joined:
    Jun 26, 2007
    Location:
    Orlando, FL
    #4
    Thanks! I eventually figured this out, but you also supplied some helpful commands that I'm sure will come in handy in the future. Appreciate it.
     

Share This Page