LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-05-2019, 05:25 AM   #1
hddfsck
Member
 
Registered: Aug 2019
Distribution: Debian; Ubuntu
Posts: 122

Rep: Reputation: Disabled
Will the following dd command completely erase my hdd?


"# echo "warning, this ERASES everything on this drive."

"# dd if=/dev/zero of=/dev/sdx count=8196"?


I don't know how the 'count=8196' was derived.

Thanks.

Last edited by hddfsck; 09-05-2019 at 05:44 AM.
 
Old 09-05-2019, 05:30 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Yes
 
1 members found this post helpful.
Old 09-05-2019, 05:43 AM   #3
hddfsck
Member
 
Registered: Aug 2019
Distribution: Debian; Ubuntu
Posts: 122

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
Yes
Thanks. I know to delete everything including every piece of malware on a hdd, there is software made by the company Blancco which works 100%; don't believe there is anything out there that can compete with it, including dban. It is able to open locked areas, etc.; I don't remember all the details.

How would you compare this dd command to blancco, if you had to guess?

Thank you!

Last edited by hddfsck; 09-05-2019 at 05:45 AM.
 
Old 09-05-2019, 05:44 AM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
well
yes and no

That command is copying 512 bytes ( dd's defaul; block size ) of "nothing" 8196 times to the drive in sequence.

so the first 4 mb of the drive will be "blank"
It will look "empty" but with some work the data could be retrieved.
 
1 members found this post helpful.
Old 09-05-2019, 05:46 AM   #5
hddfsck
Member
 
Registered: Aug 2019
Distribution: Debian; Ubuntu
Posts: 122

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Firerat View Post
well
yes and no

That command is copying 512 bytes ( dd's defaul; block size ) of "nothing" 8196 times to the drive in sequence.

so the first 4 mb of the drive will be "blank"
It will look "empty" but with some work the data could be retrieved.
Thanks. Should I change the count size?
 
Old 09-05-2019, 05:58 AM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
it really depends on what you want to achieve

I see mention of malware ( I didn't see that post before I made mine )

if you wanted to get rid of that,, it would depend on the malware and how sophisticated it is.

you could completely fill the drive with random, then repeat a few times.
I don't know blancco , it is probably doing something similar to that.
does it take a while?
 
1 members found this post helpful.
Old 09-05-2019, 06:01 AM   #7
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by hddfsck View Post
Thanks. Should I change the count size?
From dd man page:

Quote:
count=N
copy only N input blocks
So, as mentioned; it depends on what you want.
If you want to write zeros' to the whole drive, then just use dd command without count.
When it reaches the end, you will see message similar to "no space left on device".
 
2 members found this post helpful.
Old 09-05-2019, 06:13 AM   #8
hddfsck
Member
 
Registered: Aug 2019
Distribution: Debian; Ubuntu
Posts: 122

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Firerat View Post
it really depends on what you want to achieve

I see mention of malware ( I didn't see that post before I made mine )

if you wanted to get rid of that,, it would depend on the malware and how sophisticated it is.

you could completely fill the drive with random, then repeat a few times.
I don't know blancco , it is probably doing something similar to that.
does it take a while?
Yes, blancco takes about 8-12 hours for a 1TB hdd. It is used around the world to clean hospital drives, financial places, etc.
 
Old 09-05-2019, 06:15 AM   #9
hddfsck
Member
 
Registered: Aug 2019
Distribution: Debian; Ubuntu
Posts: 122

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dc.901 View Post
From dd man page:



So, as mentioned; it depends on what you want.
If you want to write zeros' to the whole drive, then just use dd command without count.
When it reaches the end, you will see message similar to "no space left on device".
In this case, it doesn't matter if it can be gotten to later since there will be a lot of duplicate data anyway. For one drive I just need to get rid of it so I can encrpypt the partition and then add data. So the faster the better, in this case. Thanks.
 
Old 09-05-2019, 06:24 AM   #10
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by hddfsck View Post
In this case, it doesn't matter if it can be gotten to later since there will be a lot of duplicate data anyway. For one drive I just need to get rid of it so I can encrpypt the partition and then add data. So the faster the better, in this case. Thanks.
in that case
the dd in the OP will be fine
/!\ do make sure you are writing to the correct drive /!\


Personally I would just delete the existing partitions with the partition manager I would be using to create the partitions for the encrypted drive.
 
1 members found this post helpful.
Old 09-05-2019, 06:39 AM   #11
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Sorry hddfsck, I should have been more clear than what I was. The command in your OP would zero out the MBR partition table, or in the case of GPT partitioning, the header that points to where it is (from my understanding of GPT partitioning). Therefore that would effectively "erase" the drive as far as the system's concerned as said above - that's what I should have said.

In any case, why not just format whatever partitions you have on the drive if you don't care about the data on it?
 
1 members found this post helpful.
Old 09-10-2019, 02:32 AM   #12
hddfsck
Member
 
Registered: Aug 2019
Distribution: Debian; Ubuntu
Posts: 122

Original Poster
Rep: Reputation: Disabled
Thanks to all.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
actually while debugging an assembly language i have got the following error can any body figure out how i can rectify the following error niranjan1609 Linux - Newbie 3 06-03-2018 05:21 PM
How do I completely erase my computers RAM? cousinlucky Linux - Hardware 21 12-19-2014 04:57 PM
completely erase disk cursor just blinks when boot Rukiri Linux - Hardware 2 09-03-2012 12:41 PM
[SOLVED] Wanted: a lowlevel tool to erase data from harddisks completely. Sjonnie48 Linux - Hardware 4 03-10-2011 11:50 AM
i use the following way to install vlc in cent os but i got the following error praveenkalam Linux - Software 6 12-21-2009 03:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration