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.
Can anyone post a link for a good step-by-step guide for wiping a hdd clean (like with DBAN) and setting up the cd-rom and floppy drive from scratch so one can install a new os (like FreeDOS, linux, whatever else)...
You would boot with the LiveCD, then get to a root console, then, assuming it's the primary master drive on an IDE cable:
fdisk /dev/hda
Using fdisk, you'll need to delete the partitions:
d
And do this until all the partitions are gone, then, create the new partition (hit m for more info, I can't remember the exact key off the top of my head).
Then, after the single new partition is created, use dd (yeah, just dd):
dd if=/dev/zero of=/dev/hda1
dd is for data dump (maybe, someone may have a better idea, but that's what I've always taken it to mean). You take the input file (if=) and output it to output file (of=).
In my experience, I've wasted 2 drives dd then entire thing. I don't see a need to dd /dev/zero to the MBR, it's just the MBR afterall It could be coincidence, but since then I've never dd'd the entire drive, instead I'll create a single partition of the entire drive and then dd that partition. Superstition? Yeah maybe, but I haven't had a drive die doing it that way...
In my experience, I've wasted 2 drives dd then entire thing. I don't see a need to dd /dev/zero to the MBR, it's just the MBR afterall It could be coincidence, but since then I've never dd'd the entire drive, instead I'll create a single partition of the entire drive and then dd that partition. Superstition? Yeah maybe, but I haven't had a drive die doing it that way...
Cool
Maybe it's my lack of experience, but how do you irreversibly damage a drive by writing data to it...
Maybe it's my lack of experience, but how do you irreversibly damage a drive by writing data to it...
Good point! I'm just a paranoid delusional... I guess I shouldn't spread my fear to others just because I coincidentally had drives die during the process.
The following will wipe each partition clean. It can take a while to run, so let it run overnight.
Easiest way is to run badblocks. The normal behavior of badblocks with the -w option (destructive write) is to write 0xAA, then 0x55, then 0xFF, and finally 0x00. If you give the -v option, you can watch the progress as badblocks cycles through.
Let's say I have a disk (or disk array) with 7 soft (O/S) partitions: hda0, hda1, hda2, hda3, hda4, hda5, hda6.
The first command wipes the whole disk:
badblocks -vw /dev/hda
Let's say I wanted to wipe the odd partitions only.
for i in 1 3 5; do
badblocks -vw /dev/hda$i
done
Now, let's say I have a disk array with 4 hard (controller based) partitions: sda1, sdb1, sbc1, sdd1.
use the following command.
for i in a b c d; do
badblocks -vw /dev/sd${i}1
done
I have had similar problems with reloading windows after using linux.
What I did was grab a mandriva installer disc (mandriva's installer cd was the best for doing this that I had found), boot into the installer and go through the steps until I got to the partitioning.
I then setup a fat32 partition and some ext3 partitions and hit next, the installer formatted the partitions. I then quit the installer and put in the WinXP CD and restarted.
The Windows installer came up and was able to load the necessary files, I was able to recreate the partitions the way I wanted and install
When a user starts the cfdisk program with command like
Code:
cfdisk /dev/hda
he can delete any or all of the partitions, click "write" and everything is gone on a reboot.
People can be obsessed with the boot loader in the MBR as it is not supposed to be deleted. Every user needs it for booting and so when installing a new system it will automatically "overwrite" it. If needed One can zero it by
Code:
dd if=/dev/zero of=/dev/hda bs=512 count=1
That only zeros the first sector of 512 bytes which is where MBR is. It is a lot quicker than to zero say a 100Gb hdd, about 200,1000 times quicker. If the partition table, which is inside the MBR, is destroyed then all the information in the partitions will become inaccessible. Any later information will be just overwritten on the same space as the case of normal working with the hard disk. Does it really matter that we have every bit zero to start with? If you want to read this thread 100 times zeroing a disk will give ample time to do it.
People who have a need to "zero" every bit in the hard disk are bankers or secret agents who cannot let others to recover their information. Good forensic people can still recover your data after you have zeroed a hard disk a few times.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.