Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
dd if=/dev/zero of=<hard drive or partition to 0 fill)
Make sure you set of correctly, or you will likely wipe out something important. Note that residual data can be recovered even from a zero filled sector on a hard drive, but it requires special tools. If you require absolute security, wipe with a program that writes over the drive repeatedly with random data.
My hdd's are listed as hda and hdb (using Xandros 2) i'll assume (the mother of all disasters) that this is a fairly global label for hdd's. So if I add hdb to the end of the command, that will zap the one I want. Or have I missed the bus?
dd if=/dev/zero of=hdb
PS Have download dban as well, would rather have a go with a command 1st though. Cheers.
What is that you want to do exactly ? Delete the contents of the whole drive or just a partition ?
If it is the whole drive, follow the instruction by btmiller or barrett9h.
If it is just a partition then be careful. For eg. if you have 5 partitions on a drive say hada1, hda2, hda3, hda4, hda5 & hda6 (hda4 being the extended partition) and if you want to zero out hda5 then, using dd if=/dev/zero of=/dev/hda5 would zero out the contents of the partition hda5 including the partition table which would point at partition hda6. Which means, you'd lose the partition hda6 as you zeroed out the partition table which pointed at hda6.
To make sure you skip the partition table do the following:
dd if=/dev/zero of=/dev/hda6 bs=512 skip=1
Of course, you'll have to know the drive name and partition number be it hda3, hdb3 or sda3 or whatever. The above explanation assumes hda as the drive name.
If you need further clarifications, provide the details of your hard drives and partitions layout and also, which of the partitions you wanna zero out.
My hdd's are listed as hda and hdb (using Xandros 2) i'll assume (the mother of all disasters) that this is a fairly global label for hdd's. So if I add hdb to the end of the command, that will zap the one I want. Or have I missed the bus?
dd if=/dev/zero of=hdb
PS Have download dban as well, would rather have a go with a command 1st though. Cheers.
in general, the rule of thumb (the father of all disasters ) is that hd* is labelled after the onboard ide chain.
do, however, always doublecheck, if you blank the worng drive, its remarkably upsetting. oh, and if you have bizarre hardware configurations, this will go right out the window.
That is maybe the best sig I have seen in a long time.....
From the galloping nitpicker: There is a difference between erasing and wiping. Writing all zeros is not considered 100% secure. Utilities like dban do multiple writes to ensure no residual data can be found.
And of course, just deleting file and partitions still leaves the data on the disk where it can easily be recovered.
Just want to delete a slave drive. It has a botched duel boot install on it that isn't worth trying to retrieve. It's not national securtity by any means. Just want it blankish with peice of mind to play with another distro.
I've written (the old way, with a pen)down the commands and other info for keeps.
Cheers and thankyou all that replied.
Happy camper.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.