- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: using dd command to zero out disks
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 01:19 AM
03-07-2004 01:19 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 01:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 02:08 AM
03-07-2004 02:08 AM
Re: using dd command to zero out disks
/dev/null will not do.
It returns 'eof' rightaway and your disk blocks will nto be overwritten.
Use
if=/dev/zero bs=1024k
[use search in the forum for more detailed discussion on device scrubbing, /dev/random, torches (the only real way to destroy data :-) and so on.]
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 02:42 AM
03-07-2004 02:42 AM
Re: using dd command to zero out disks
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 02:48 AM
03-07-2004 02:48 AM
Re: using dd command to zero out disks
you can write the disk devices in a file and let a loop run over it.
dskfile:
/dev/dsk/c0t0d0
/dev/dsk/c0t1d0
...
while read DISK
do
dd if=/dev/zero of=${DISK}
done < dskfile
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 03:43 AM
03-07-2004 03:43 AM
Re: using dd command to zero out disks
(dd... ; dd... ;dd...)&
Or just paste a bunch in a window.
I'll include and attach here a perl script that is pretty close to your needs and which can run a selectable number of streams in parallel taking note of the stat time and results. For now it READS, to allow testing.
Once satisfied replace if with of and null with zero. No I did not write this just for you :-). I had something very similar handy.
Input param is a list of (raw) device names
hth,
Hein.
#!/bin/perl
$file = shift (@ARGV);
$max_streams = shift (@ARGV);
die "Must provide file" unless $file;
$max = ($max_streams)? int ($max_streams) : 10;
open (FILE, $file) || die "Error open $file";
while (
if ($par++ >= $max) {
$pid = wait();
$par--;
$s = 1;
$s++ while (($stream[$s] != $pid) && ($s <= $max) );
die "Lost child process ?" if ($s > $max);
} else {
$s = $par;
}
$pid = fork();
if ($pid) {
$stream[$s] = $pid;
} else {
($sec,$min,$hour) = localtime(time);
$date = sprintf("%02d:%02d:%02d ",$hour,$min,$sec);
open (LOG, ">>${file}_${s}.log" );
print LOG $date, $_;
close(LOG);
chop ($_);
exec ("dd of=/dev/null bs=128k count=100 if=$_ 2>> ${file}_${s}.log ")
}
}
close (FILE);
wait() while (--$par > 0);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 12:11 AM
03-08-2004 12:11 AM
Re: using dd command to zero out disks
Regards
Roland