LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Way to shred all internal drives with one liner? (https://www.linuxquestions.org/questions/linux-newbie-8/way-to-shred-all-internal-drives-with-one-liner-4175640430/)

anon091 10-15-2018 03:28 PM

Way to shred all internal drives with one liner?
 
I'm hoping to boot an old machines with multiple internal drives off a live image of Linux Mint, then shred all the internal drives, some of which have bad sectors on them (just hoping it overwrites as best it can, not looking for a miracle).
What's the easiest way to accomplish this with one command, or do I just need separate shell windows, one per disk?

jefro 10-15-2018 03:59 PM

Dban is a popular distro for this task over mint.

One could usually create a script and run it. Guess part of the issue is how old are the systems.

Might wish to look at the man page or web page use of shred to see if that is really what you wish.

berndbausch 10-15-2018 04:02 PM

The shred command takes several drives as parameters.
Code:

shred $various_parameters /dev/sd[abcdefg]
To shred the disks in parallel, you probably need a loop and run shred on single disks in the background, e.g.:
Code:

for drive in /dev/sd[abcdefg]
do shred $various_parameters $drive &
done


anon091 10-15-2018 04:03 PM

System is only maybe 5 years old, but the drives are of varying degrees of greatness but about the same vintage. Tried booting off DBAN but it errored out, hoping shred is a little more forgiving of bad sectors and tries them then moves on without completely bombing out. will probably just do separate console windows, was just looking for something with a bit more coolness factor if possible

anon091 10-15-2018 04:03 PM

thanks Bern

zeebra 10-15-2018 04:54 PM

Code:

dd if=/dev/zero of=/dev/sdX bs=4096 && dd if=/dev/zero of=/dev/sdX bs=4096
Why do you need to use shred?

https://wiki.archlinux.org/index.php/Securely_wipe_disk

A few different ways on that page.

Habitual 10-17-2018 10:18 AM

Are these drives {mounted,In Use} while attempting this?

agillator 10-17-2018 10:42 AM

I would go with DBAN. Just realize it will clear ALL connected hard drives. If there is something on the computer you don't want wiped, physically disconnect it so DBAN can't get to it.
Download from https://dban.org/, burn it to CD and off you go. If you look at the DBAN page you may find something you like better.

boombaby 10-17-2018 10:47 PM


Hello, rjo98...

I have had a couple of very bad experiences trying to save (and work with) aged drives having "bad sectors". To be clear, I have come to the conclusion that it is not worth the trouble - IF it is just as easy to save/move data to another drive. You said yours are about "5 years old" so they may still have some legs on them. There is the balance (of things) to contend with.

So, for me, if you want some advice on "...way to shred all internal drives (with bad sectors) with one liner..." - hammer.

(Other Members have given worthy advice, so I am not discounting their info in any way.)


Regards,
boombaby
_

mrmazda 10-17-2018 11:31 PM

Might be simplest just to use command history, sending all to background:
Code:

# dd if=/dev/zero bs=32768 of=/dev/sda &
# UP LEFT LEFT BS b ENTER
...
# top



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