Results 1 to 7 of 7

Thread: Erase a hard drive to RAW data in terminal

  1. #1
    Join Date
    Jan 2013
    Beans
    3

    Red face Erase a hard drive to RAW data in terminal

    Hello I cant seem to figure out how to quick erase a drive to RAW space. Can anyone please help me. It needs to be done in terminal. I figured out how to use mkfs to create partitions but cant find anything on quick erasing the whole drive.

    For now I am using palimpsest to erase the partitions however there has to be a faster way in Terminal. All the clicking with the new interface is a pain!

    THANKS!!

  2. #2
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Erase a hard drive to RAW data in terminal

    RAW is a partition that is NTFS but not yet formatted. Or partition table says NTFS but partition boot sector has not been properly configured for NTFS.

    Do you really want to delete all partitions and totally redo it? I would not use dd unless I have really good backups.

    Powerful command, but often misused and then nicknamed "dd" Data Destroyer
    http://www.linuxquestions.org/questi...ommand-362506/


    This totally erases boot loader and partition table, not not actual data on drive.
    Erase - Make double sure you have correct drive

    dd if=/dev/zero of=/dev/sda bs=512 count=1


    I prefer to use gparted, but you have to run that from liveCD and swap off if running on the same drive as your install.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  3. #3
    Join Date
    Jan 2013
    Beans
    3

    Re: Erase a hard drive to RAW data in terminal

    Quote Originally Posted by oldfred View Post
    RAW is a partition that is NTFS but not yet formatted. Or partition table says NTFS but partition boot sector has not been properly configured for NTFS.

    Do you really want to delete all partitions and totally redo it? I would not use dd unless I have really good backups.

    Powerful command, but often misused and then nicknamed "dd" Data Destroyer
    http://www.linuxquestions.org/questi...ommand-362506/


    This totally erases boot loader and partition table, not not actual data on drive.
    Erase - Make double sure you have correct drive

    dd if=/dev/zero of=/dev/sda bs=512 count=1


    I prefer to use gparted, but you have to run that from liveCD and swap off if running on the same drive as your install.

    Thanks this works good when there is only one partition!
    dd if=/dev/zero of=/dev/sdx bs=512 count=1
    However when there is more than one it doesent seem to be wiping the whole drive (aka deleting all the partitions and only leaving RAW format) Or MBR would be fine.

    by the way yes im trying to just quickly delete existing partitions and leave the drive as raw I do not need to replace with zeros or anything I just want to do it as fast as It does it in disk utility when you hit format drive and select "don't partition" its practically instant.
    Last edited by magace; January 31st, 2013 at 09:22 PM.

  4. #4
    Join Date
    Apr 2006
    Location
    Dallas, TX
    Beans
    1,359
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Erase a hard drive to RAW data in terminal

    Could you use GNU parted to do that?

    Code:
    sudo parted /dev/sdX mklabel loop
    Where X is the target disk (a/b/c, etc.).

    https://www.gnu.org/software/parted/...d_2.html#SEC16

    Says it doesn't technically remove the data, but makes it hard to access, and leaves no partitions. I tested this on my flash drive, and it worked fine. Had to create a new msdos partition table and new FAT32 partition on the drive afterwards to make it work again.
    Last edited by kanikilu; January 31st, 2013 at 10:25 PM. Reason: typos

  5. #5
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Erase a hard drive to RAW data in terminal

    There are only 4 partition table entries in the partition table. That is why we have the 4 primary partition limit. And writing zeros to those 4 will erase the entire partition table.
    But any logical partitions have their own partition table in each partition. But they only have one entry linking to the next logical. The extended partition in the MBR partition table is a link to the first partition table.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  6. #6
    Join Date
    Jan 2013
    Beans
    3

    Re: Erase a hard drive to RAW data in terminal

    update! Sorry it was working all along. The partitions were still showing up in disk utility however if I refresh them or take the drive out and put it back in they are actually gone.

  7. #7
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Erase a hard drive to RAW data in terminal

    Quote Originally Posted by magace View Post
    update! Sorry it was working all along.
    Then MARK the thread.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

Tags for this Thread

Bookmarks

Posting Permissions

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