LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-15-2018, 03:28 PM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,784

Rep: Reputation: 49
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?
 
Old 10-15-2018, 03:59 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,217

Rep: Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926
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.
 
Old 10-15-2018, 04:02 PM   #3
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora, Alpine, Cirros, OpenSuse/SLES
Posts: 3,461

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
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
 
1 members found this post helpful.
Old 10-15-2018, 04:03 PM   #4
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,784

Original Poster
Rep: Reputation: 49
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
 
Old 10-15-2018, 04:03 PM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,784

Original Poster
Rep: Reputation: 49
thanks Bern
 
Old 10-15-2018, 04:54 PM   #6
zeebra
Member
 
Registered: Dec 2011
Distribution: Mageia, Slackware
Posts: 820
Blog Entries: 7

Rep: Reputation: 201Reputation: 201Reputation: 201
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.
 
1 members found this post helpful.
Old 10-17-2018, 10:18 AM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Are these drives {mounted,In Use} while attempting this?
 
Old 10-17-2018, 10:42 AM   #8
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 251

Rep: Reputation: Disabled
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.
 
Old 10-17-2018, 10:47 PM   #9
boombaby
Member
 
Registered: Mar 2016
Posts: 93

Rep: Reputation: Disabled

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
_
 
Old 10-17-2018, 11:31 PM   #10
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 1,762

Rep: Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto mount internal drives AGazzaz SUSE / openSUSE 4 04-25-2013 02:03 AM
LXer: How To Securely Destroy/Wipe Data On Hard Drives With shred LXer Syndicated Linux News 0 02-22-2012 10:10 AM
2 internal hard drives RacecarBMW Linux - Hardware 5 05-10-2010 08:40 PM
Two internal hard drives for one laptop johnph Linux - Newbie 5 04-21-2004 02:06 PM
Internal and External SCSI drives dka1 Linux - Hardware 1 03-15-2004 05:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration