a syntax correction and adding dynamic block sizes to zeroing
This commit is contained in:
parent
40a7cfff21
commit
17b416926e
7
wipe.pl
7
wipe.pl
@ -167,8 +167,9 @@ sub wipethemdrives {
|
||||
seek($longdiskw,0,2);
|
||||
my $totalBytes = tell($longdiskw);
|
||||
seek($longdiskw,0,0);
|
||||
for (0..($totalBytes/4096 - 1)) {
|
||||
print $longdiskw "\0"x4096;
|
||||
my $blockSize = $totalBytes / 4096;
|
||||
for (0..($totalBytes/$blockSize - 1)) {
|
||||
print $longdiskw "\0"x$blockSize;
|
||||
if ( !($_ % 4) ) {
|
||||
system("hdparm -F ".$disks->{$diskid}{path}." 1>/dev/null 2>/dev/null");
|
||||
}
|
||||
@ -178,7 +179,7 @@ sub wipethemdrives {
|
||||
"Zeroing ".$disks->{$diskid}{path},
|
||||
"."x(tell($longdiskw)/$totalBytes*($spacer+11)),
|
||||
(tell($longdiskw)/$totalBytes)*100 ,
|
||||
"ETA: ".$diskTimes[7].", )".$diskTimes[2].":".$diskTimes[1].":".$diskTimes[0];
|
||||
"ETA: ".$diskTimes[7].", ".$diskTimes[2].":".$diskTimes[1].":".$diskTimes[0]);
|
||||
}
|
||||
}
|
||||
my $leftover = $totalBytes - tell($longdiskw);
|
||||
|
Loading…
x
Reference in New Issue
Block a user