0

How can I permanently erase data on Internal HDD?

I have a laptop which I use Ubuntu as my primary OS. However I am trying to sell it to help towards a new PC. I want to COMPLETELY erase data on the Internal HDD (Such as passwords, banking info, etc...) and use my Windows 10 USB Installer to put a new Windows setup for whoever it gets passed on to. I do have another PC which I can use to help with this process, if needed.

PS: This is only for an INTERNAL hard drive, not a USB or external hdd.

DELETED
  • 11
  • @mikewhatever I saw that post, but it is only for an external hdd (a USB to be exact), which is a much more simple process. I believe vidarlo has a good answer. I just wasn't sure exactly how to approch a process that could possibly damage the main HDD for the Laptop to function. – DELETED Jul 08 '17 at 17:38
  • 2
    Actually, the procedure is exactly the same for external and internal devices, and works just as well. I don't know why you think it's simpler or could damage something. – mikewhatever Jul 08 '17 at 17:44

2 Answers2

1

Boot with a live CD. Then issue the command lsblk to list the block devices. Find the device name of the harddrive. Issue the command

sudo shred -n 1 /dev/sdX
  • where /dev/sdX refers to the device you found.

If you're paranoid, you can overwrite more than once. Increase the 1 above to your desired number. If it's a SSD, a secure erase is quicker and better for the drive: https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase

Secure erase can be used on a normal hard drive as well, but it is more complex than simply running shred. It may be better, as it may overwrite unaccessible areas, or in case of encrypted drives, simply erase the encryption key.

vidarlo
  • 22,691
1

DBAN

An alternative to shred is DBAN, which is preferred for wiping a HDD by several people. It is rather straightforward to run DBAN and let it wipe the internal drive (when there is only one internal drive in the computer).

  • Download an iso file or two: I suggest two versions, because they might work in different computers. The file size is less than 20 MB (very small compared to typical linux iso files),

    • See this link (to the current version), where you find a description of DBAN and the Download DBAN button near the bottom of the page to download the newest iso file, when this is written dban-2.3.0_i586.iso, or

    • Download an older iso file dban-2.2.7_i586.iso via this link (DBAN 2.2.7). This version of DBAN has worked for me in several computers, also when treated with isohybrid and cloned to a USB pendrive. This is a good alternative, if there is no CD drive in the computer.

  • md5sums:

    066fb83c43f6ba96f92b8fe1302cb431  dban-2.2.7_i586.iso
    33a1df4171e649462ef9679ac207aa77  dban-2.3.0_i586.iso
    

    Check with

    md5sum dban-2.2.7_i586.iso
    md5sum dban-2.3.0_i586.iso
    
  • Either burn the iso file to a CD or DVD disk: 'Burn an iso image' (do not create a CD data disk),

  • or treat the iso file with isohybrid:

    isohybrid dban-2.2.7_i586.iso
    

    and after that you can clone the iso file to a USB pendrive in a safe way using mkusb according to this link (mkusb).

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • 1
    dban is nice, but for a SSD secure erase is prefered, as this is essentially running a trim on the whole drive. – vidarlo Jul 09 '17 at 07:49
  • @vidarlo, I agree, for a SSD secure erase is preferred :-) – sudodus Jul 09 '17 at 09:18
  • secure erase: One still have to trust that the SSD does it well. It's not even about backdoors (though for critical use cases, that would be an important concern) but it could be for technical reasons. The same kind of reasons that make writing random data in the whole disk not perfect. Of course we expect the secure erase to actually erase every flash memory that can contain user data. – tuxayo Dec 04 '18 at 10:24