<SOLVED> Nuke Entire Hard drive?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
DAMIEN1307

<SOLVED> Nuke Entire Hard drive?

Post by DAMIEN1307 »

hi folks...im about receive about 14 computers via donation to install linux mint onto them and then donate them to deserving school students and seniors in my area...some of these are already linux based but old versions...the people donating them do not know how to securely nuke their hard drives...my question is just for the linux based computers...(the windows and macs i know will have other methods)...is the following terminal command line a total, complete nuke option to use where all will be totally unrecoverable?

sudo dd if=/dev/urandom of=/dev/sda1

this is of course assuming sda1 is the drive...i know there are variations of this of course...any guidance is really appreciated

DAMIEN
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
richyrich

Re: Nuke Entire Hard drive?

Post by richyrich »

A comprehensive page (with lots of links of specific directions) for you to get totally confused ! :lol:

https://wiki.archlinux.org/index.php/Securely_wipe_disk
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Nuke Entire Hard drive?

Post by Flemur »

DAMIEN1307 wrote:sudo dd if=/dev/urandom of=/dev/sda1
I'd do this:

Code: Select all

sudo dd if=/dev/zero of=/dev/sda
because zero-fill really is good enough and much faster - it won't be readable by anyone; and the full disk will be /dev/sda; a partition is /dev/sda1, etc.
Disclaimer: I've never nuked a full disk, just partitions.

You might try the first one and then make sure you can still put partitions on it afterwards, with gparted.
this is of course assuming sda1 is the drive..
WATCH OUT!
When you're booted into linux the system partition is typically /dev/sda1 - make sure you don't write to that! EDIT: And don't write to /dev/sda!

Also: there might be a "bs=1024" type thing that'd make it run faster, like
"sudo dd if=/dev/zero of=/dev/sda bs=whatever"
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
DAMIEN1307

Re: Nuke Entire Hard drive?

Post by DAMIEN1307 »

hi flemur...so lets see if i got this right...and yes i DO want to use the random rather than the zero even though it takes longer would this now be the correct command?

sudo dd if=/dev/urandom of=/dev/sda1 bs=1024

i did notice that you did not use the numeral "1" after sda...is their a reason why or is the "1" appropriate for the drive in question...i also have some here that are sda2 main drive instead of sda1 mainly because they have a separate boot drive partition formatted in fat32 that is entitled sda1...DAMIEN
User avatar
kc1di
Level 18
Level 18
Posts: 8151
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Nuke Entire Hard drive?

Post by kc1di »

If you use sda1 then you'll not wipe the whole drive just the partition sda1 if you use sda without the number you'll wipe the whole drive. Depends which you want to do. if say windows boot partition is sda1 that would be the only one wiped. Of course if you have two drives then sda would be the first one sdb the second and so on. other than that the command looks good.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
DAMIEN1307

Re: Nuke Entire Hard drive?

Post by DAMIEN1307 »

hi kc1di...thank you for the answer of 1 verses no 1...i take it that i can just install linux mint as normal after this proceedure...as a side point i notice your in Maine...my last 20 yrs before moving to Alamogordo NM 6 yrs ago was portsmouth NH..."ahyaaah"...you cant get "thayha" from "heaya"...got to go by "kittry" to get to "banghar...lol...DAMIEN
DAMIEN1307

Re: Nuke Entire Hard drive?

Post by DAMIEN1307 »

thanks to all of you that have helped me fine tune this command...by the way...richyrich...love your comment about link to read in order to be totally confused...it goes along well with your avatar pic...lol...DAMIEN
User avatar
kc1di
Level 18
Level 18
Posts: 8151
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Nuke Entire Hard drive?

Post by kc1di »

Hi DAMIEN1307,
Glad to be of Help and yes I'm and old Mainah. Spent about 3 year in El Paso,Tx and NM Desert back in the 1970's. Returned to maine 30 years ago. The old saying is true "you can take the boy out of Maine but you can't take the Maine out of the boy" :D
I've done what your doing with old machines and give quite a few away. all with Mint or other linux distros on them of course. Good luck and enjoy the process.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Nuke Entire Hard drive?

Post by jimallyn »

DBAN. Darik's Boot And Nuke.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
DAMIEN1307

Re: Nuke Entire Hard drive?

Post by DAMIEN1307 »

hi jimallyn...i did know about dban but am really comfortable using terminal command lines rather than downloading programs...i have found that the terminal is my friend lol...but many thanks to you as well as all others out here.I find that advice by you as well as kc1di, pjotr, flemur, moem, richyrich, phd1, joseph, clem, majorpooper, catweazel, etc as well as many other names i cant remember right now to have been quite informative and helpful...just try to get this kind of help with windows lol...i especially appreciate the moderators here in the forums that take their time to do this...i suspect that most of you moderators are older retired folks like myself that have found a great niche here not only to keep minds active through computers but also sharing their collective knowledge with others...i do realise that no one has all the answers but collectively all together this just works...thanks to all once again...oh and by the way KC1DI...i really do enjoy the process of converting old computers etc...i now , since oct.2016 have been able to convert 50 computers so far to linux mint of one flavour or another...now for the next 14...lol...keeps me busy and i love it...DAMIEN
User avatar
Moem
Level 22
Level 22
Posts: 16238
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Nuke Entire Hard drive?

Post by Moem »

Aww, DAMIEN. What a lovely thing to say. You made me blush! :oops:
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
richyrich

Re: Nuke Entire Hard drive?

Post by richyrich »

@DAMIEN1307 , heehee Yellowbeard, one of my favorite comedies of all time . . and what I imagine Richy Rich from those old comics would look like if he lived his life in my shoes . . :lol:
Petermint
Level 9
Level 9
Posts: 2983
Joined: Tue Feb 16, 2016 3:12 am

Re: Nuke Entire Hard drive?

Post by Petermint »

ATA Secure Erase, https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase, works at the hardware level and wipes everything including unused portions of the disk. It works on most modern disks. If a disk does not have ATA Secure Erase built in, it is probably so old it is about to die.

ATA Secure Erase and some other disk commands fail across USB. Leave the disk in the computer and run the erase from a live boot of Linux.

The next level of security above ATA Secure Erase is to acquire and use the following hardware. This hardware will work no matter what operating system you use. Note that the disk may not format or boot after this procedure. :shock:
https://www.bunnings.com.au/aeg-18v-li- ... y_p6210356
https://www.bunnings.com.au/p-n-10mm-di ... t_p5710034
User avatar
Pierre
Level 21
Level 21
Posts: 13204
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Nuke Entire Hard drive?

Post by Pierre »

since I've recycled lots of PCs over the years,
and never really bothered too much about Nuking / Erasing the HDDs that much.

if it's not going to be an Dual_ boot ( or Tri or Quad ) then I've simply used Gparted on the Live Environment,
- Device - - Create <New> Partition Table - - will erase whatever is on that HDD . . .
then - - New - - create partition(s) as needed for the proposed installation(s).
8)

it will take an IT type to reverse any of that, once it's completed.
:)
ie: there won't be anything or valuable, to recover, from any previous Operating System.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Lanser

Re: <SOLVED> Nuke Entire Hard drive?

Post by Lanser »

Hi Damien. Fully agree with what the others have suggested, but depending on the size of the drive can take a long time.
Another strategy that I have found to be a bit quicker, is to reformat the whole drive to ext2, then create a formatted veracrypt container to fill the entire partition.
Then delete the whole partition and reformat. To date, using available tools, I have been unable to recover anything on a drive.

cheers Lanser
Locked

Return to “Other topics”