I take it this only works on ext3 boxes? Seems fairly filesystem specific, 
although I by no means am a filesystem expert. 
 
Matt Smollinger
Application Engineer for Convergence Tech.
AdvancedAV

________________________________

From: [EMAIL PROTECTED] on behalf of Matthew Shea
Sent: Fri 4/27/2007 8:58 AM
To: [email protected]
Subject: [g4u-help] Fwd: Useful Script



I wrote the perl script below to automatically zero-out the free hard disk bits 
on a Linux box to reduce image size.  It was suggested to send it to this list. 
 The script reads /etc/fstab and automatically does a "dd if=/dev/zero..." on 
each ext3 partition.  The script was created for Fedora Core, but should work 
on other distros/*nixes with just a little adaptation. 

Matt

#!/usr/bin/perl

# Script to zero out all free bits on disk prior to imaging disk with G4U

open FSTAB, "/etc/fstab";
while (<FSTAB>) {
chomp;
if (/ext3/) {
if (/\s+(\/[0-9a-zA-Z\/-_]*)\s/) { $fspath = $1 };
print "Zeroing out free space on $fspath\n";
unless ( substr($fspath, -1) =~ "\/" ) { $fspath .= "/" };
system "dd if=/dev/zero of=${fspath}0bits bs=20971520"; 
system "rm ${fspath}0bits";
}
} 



This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. Any 
use, distribution, copying or disclosure by any other person is strictly 
prohibited. If you received this transmission in error, please notify the 
sender by reply e-mail and then destroy the message. Please note that any views 
or opinions presented in this email are solely those of the author and do not 
necessarily represent those of ADVANCED AUDIO VISUAL. Finally, the recipient 
should check this email and any attachments for the presence of viruses. 
ADVANCED AUDIO VISUAL accepts no liability for any damage caused by any virus 
transmitted by this email.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
g4u-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/g4u-help

Reply via email to