Clan x86

Technical (Development, Security, etc.) => General Programming => Topic started by: Newby on May 07, 2005, 05:55:07 pm

Title: [SH] Drive scrubbing script
Post by: Newby on May 07, 2005, 05:55:07 pm
I'm currently working on a pretty pretty drive scrubbing script in shell script.

I'll post it open-source when it's complete.

Sure, it's got the basis of the basic script I stole off of iago (for i in 1 2 3 4 5; do cat /dev/urandom > /dev/hda; done) but I made it pretty. It's mad sexy too.

Format so far for the command: ./scrub.sh <drive> <number of scrubs> <wipe with zeroes at the end>
Example: ./scrub.sh /dev/hda 3 yes (I may make the last parameter a 1 or a 0, just because I don't know how to do booleans with shell scripting)

If you forget a parameter (or just run it with ./scrub.sh) it'll prompt you for the parameters you forgot.

Sure, a useless waste of time, but if someone can sell a drive scrubber for $70 (iolo) why can't I release an open-source scrubbing script?!

(Well, the drive scrubber DOES run OS-independently, has a nice GUI, has lots more options, and gives you a time-remaining number, but you get what you paid for :P)

Another reason I'm doing this is so that I keep semi-fluent in programming/scripting. I haven't coded in forever^2 so I don't wanna lose all that skill because I don't want to program. :(
Title: Re: [SH] Drive scrubbing script
Post by: iago on May 07, 2005, 06:04:39 pm
Hmm, one of the live Linux distros I was playing with had a built-in drive scrubber.  I'll have to figure out which one.
Title: Re: [SH] Drive scrubbing script
Post by: Newby on May 08, 2005, 01:46:54 pm
Mmk. So far I've got three files.

scrub/scrub-dev.sh // The development edition! Optimized for testing, as it doesn't scrub your drive if you accidentally run it! :P
scrub/scrub.sh // The normal edition. Contains all colors, no comments, and will scrub your drive good!
scrub/scrub-naked.sh // iago comes to your house and scrubs your car naked. .. .. .. Just kidding! It doesn't have any colors! 400 bytes smaller than scrub.sh, half the size of scrub-dev.sh

Yeah! Woo!
Title: Re: [SH] Drive scrubbing script
Post by: iago on May 08, 2005, 02:11:36 pm
Don't forget to make it bootable off a floppy or a cd with a minimal Linux kernel.  Have it display statistics afterwards.  And have it support SCSI (can VirtualPC emulate that for testing?).  If you do all those, I can probably convince them to try/use it at work.
Title: Re: [SH] Drive scrubbing script
Post by: Newby on May 08, 2005, 03:23:32 pm
It requires bash/sh to work correctly.

I'll get around to looking at that. :)
Title: Re: [SH] Drive scrubbing script
Post by: iago on May 08, 2005, 03:24:47 pm
Well, things like Knoppix come with bash/sh.

But you can make a very compact Linux (or bsd) that fits on a floppy and is only useful for wiping.  It can even give a menu instead of making the user run the command.  :-)
Title: Re: [SH] Drive scrubbing script
Post by: Joe on May 11, 2005, 07:57:04 am
Dead sexy.
Title: Re: [SH] Drive scrubbing script
Post by: Quik on May 16, 2005, 07:45:09 pm
Hold on, hold on, wouldn't

Code: [Select]
for i in 1 2 3 4 5 6 7 8 9 ; do cat /dev/urandom > /dev/hda; cat /dev/zero > /dev/hda; done
work better?
Title: Re: [SH] Drive scrubbing script
Post by: Newby on May 16, 2005, 08:09:32 pm
The answer is no.
Title: Re: [SH] Drive scrubbing script
Post by: Joe on May 16, 2005, 10:41:06 pm
Are you going to release this any time soon? I want to try it on iago's harddrive. (No.)
Title: Re: [SH] Drive scrubbing script
Post by: iago on May 17, 2005, 06:54:14 pm
Are you going to release this any time soon? I want to try it on iago's harddrive. (No.)

Luckly, you don't have root :P
Title: Re: [SH] Drive scrubbing script
Post by: Newby on May 17, 2005, 06:57:51 pm
Are you going to release this any time soon? I want to try it on iago's harddrive. (No.)

Luckly, you don't have root :P

I was gonna comment. :P

EDIT -- Colorful source code can be found here (http://www.newbyproductions.net/junk/scrub.sh.html).
Title: Re: [SH] Drive scrubbing script
Post by: deadly7 on May 18, 2005, 05:49:18 pm
404 n3wby
u suk.
Title: Re: [SH] Drive scrubbing script
Post by: Joe on May 18, 2005, 10:17:25 pm
404 obliterated!