zeroing out empty space on a drive

Gregory Nowak greg at romuald.net.eu.org
Wed Jul 11 03:58:50 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello all.

According to the vboxmanage reference of the virtualbox user's manual,
it is possible to compact a dynamic virtual hard drive, so that it is
only as big as the data currently stored on it. However, the manual
states that the empty space needs to be filled with zeros for this to
be effective.

Of course, when you first create a dynamic drive, it grows only as you
need it, so compacting it isn't necessary. However, if you've put a
large amount of data on the drive, and then removed that data, the
expanded space remains, so it would be nice to compact the drive.

My question is how do I zero out empty space in a gnu/linux guest? I'm
assuming I'd use dd on the raw partitions (I.E. /dev/hda1, /dev/hda2
and so on), providing it an offset I would somehow determine. The
problem I see with this is what if the file system is fragmented,
(ext3 in my case and swap), and you don't have an empty block of zeros
all at the end, especially if you've added data, removed it, and added
another set of data? Is there an easier way to do this for ext3 and
swap with e2fsprogs, or some other utility? If not, and if dd is the
only way, then could
someone please explain how to determine the offset I would need to
pass to dd, and how to make sure that data on the drive is in one
contiguous block? Thanks in advance.

Greg
 
- -- 
web site: http://www.romuald.net.eu.org
gpg public key: http://www.romuald.net.eu.org/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

- --
Free domains: http://www.eu.org/ or mail dns-manager at EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGlI267s9z/XlyUyARArREAJ9Zd/cmZNLwRH9duy+juFJuJLlwlgCgtkx/
y1wWCYEXwafTsv/h73+hfPQ=
=i0nV
-----END PGP SIGNATURE-----




More information about the Speakup mailing list