Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I bought a 1TB drive and I'm planning on doing DD on it. It's a WD, so I guess using a Seagate disk to wipe is not recommended.
What does it take? (what commands), How long? Does doing it very often hurts the drive? (my old 320GB drive had +4000 reallocated sectors)
All I'm used to do is:
* Erase the partition table with $sudo dd if=/dev/urandom of=/dev/sda count=1
* Create random size partitions with random file systems
* Delete all partitions
* Erase the partition table again and then create the partitions I needed.
Are those above enough, let's say, in a virus case, a bootloader virus or a MBR virus? WHY and in what cases are DD needed besides selling the drive? How is data recoverable? Can the FBI recover it? :P
Currently my partitions are:
- 320GB for Windows, used ONLY for games, nothing pirated
- 40GB for /
- 571GB for /home, encrypted.
Sorry for the lack of information, I'm on a hurry with my daughter so I had no time to write it down like it should.
Quote:
????
what is it you want to do ?
some random guesses ? might be ?
overwrite the drive with /dev/rand ?
or what ?
DD for what I know can also be used to wipe a HD with either zeroes (/dev/zero) or with random zeroes and ones (/dev/urandom), right?
Well, I want to wipe my disk and I want to know how long it could take. Info on google is not precise and guessing by my other (but failed) drive ins't gonna help since they're both distinct disks.
Quote:
What ?
please read the help and manual page for dd
Wiping the disk has many uses, but all I know about 'dd' is that it can copy/erase data. If I ever plan to sell my drive I don't want somebody seeing my personal information.
Quote:
that answer will require 10,000+ small font pages on bookshelf
please google the subject of " data recovery"
Yes. I just wanted to know if is it recoverable after doing "dd if=/dev/zero".
Sory for the inconvenience. Let me know if you need any information regarding the drive/my computer.
PS: Don't judge me, I'm not a Linux exper. Since I use Linux and 'dd' is a Unix command (if I recall) I thought this would be the perfect place to ask.
just putting zeros only and in only one pass
will not make the drive "unrecoverable "
the forensics lab of the state police or fbi can recover it if they NEED TO
the average "joe" though will NOT be able to recover the data
if this is a usb drive this WILL TAKE A LONG TIME !!!
Warning:
one of these commands is VERY VERY DANGEROUS!!!!!!!!! ( the rm command )
use EXTREME CAUTION !!!!!!
make 100% sure that the drive location is 100% CORRECT!!!!
replace /dev/sd? with the correct location you get from the command
Code:
su -
fdisk -l
the shread "n 1 " writes 1 time random numbers -- this can be changed to "1 to 37 "
the "-zuv" "zero the file" , then " uninstall/ remove the file" and the " v" is verbose " show what the program is doing
then go to bed
if this is a usb drive then in about 2 days it should be done
"dd" with a random generator and 512 byte blocks will take forever. Maybe longer.
I've used /dev/zero as a source when scrubbing laptops that need to go back to lease companies. Then allocate a single partition and use mkfs.ntfs - that writes zero blocks over the formatted filesystem as well.
Still takes a while - use "bs=1G" to speed things up. Maybe leave it running overnight.
Waste of time on a new (as in *new*) drive - if you bought it off a private seller, might be worthwhile. I've never done that.
It's an internal drive, the model is WD10EARS-00Y5B1.
So besides it being unnecessary it will take forever? I was thinking about 3 hours tops, with "sudo dd if=/dev/zero of=dev/sda" <<- I don't know if any additional command (like bs=X) is necessary.
If the steps bellow are enough to make any data unreadable FROM ANY OPERATING SYSTEM (not from users), then I guess 'dd' is really not necessary. Plus I store all my important data on /dev/sda6 with drive encryption and strong passwords like "KejHA_@#$98&*!152OQ", so I guess I'm reasonable safe against a normal user.
Steps I use:
* Erase the partition table with $sudo dd if=/dev/urandom of=/dev/sda count=1
* Create random size partitions with random file systems
* Delete all partitions
* Erase the partition table again and then create the partitions I needed.
I had a WD750EARS (I call them WD EARS hdds) -- so slow I bought an enclosure and made it my external storage device, for which it has functioned admirably for over three years.
I think I'd just use gparted to first format entire drive to ext2, then do as you have stated in the last.
As stated by others more qualified than myself, random would take two days or more, zeros a little shorter.
Or divide like into 5 partitions and use dd on each one as is convenient, and make it a week-long project!
Best wishes!
Last edited by hilyard; 04-25-2013 at 10:29 PM.
Reason: clarity
I had a WD750EARS (I call them WD EARS hdds) -- so slow I bought an enclosure and made it my external storage device, for which it has functioned admirably for over three years.
I think I'd just use gparted to first format entire drive to ext2, then do as you have stated in the last.
As stated, random would take two days or more, zeros a little shorter. Best wishes!
Thanks!
Sad to hear your story, the reviews on this green type of drive are really disappointing, but I guess mine's a 7200RPM and has 512B sectors instead of 4KB like it used to have. I don't know how to measure/compare to other so I can't complain on it so far
if that data is so dangerous just drop the device into fire and by a new disk. It will be much faster and much safer. Otherwise you will not need to wipe all the drive. as it was mentioned you can wipe the beginning, make new partitions and wipe those partitions one by one when you have time to do that. the speed highly depends on the hardware and the value of bs. You can try to execute dd on a 1 GB area to check speed.
If I output the BS to 4M, how will the disk get it back to 512? Because:
Quote:
‘bs=bytes’
Set both input and output block sizes to bytes. This makes dd read and write bytes per block, overriding any ‘ibs’ and ‘obs’ settings. In addition, if no data-transforming conv option is specified, input is copied to the output as soon as it's read, even if it is smaller than the block size.
I imagine 'dd' will read and write 4M per whatever and make the disk blocksize as 4M, right? That will make the disk performance slower. How do I get it back to 512 after making 'dd' bs=4M?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.