diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-03-15 10:32:27 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-03-15 16:15:45 +0000 |
commit | 8c9f6a64be9840a955e481e932f13d005c0de0de (patch) | |
tree | c8bef20f8808966c18d2353a7aa3936022ccb68e /sparsify | |
parent | b05611d8efbfad10518fe874d53292c6a1b7f2b9 (diff) | |
download | libguestfs-8c9f6a64be9840a955e481e932f13d005c0de0de.tar.gz libguestfs-8c9f6a64be9840a955e481e932f13d005c0de0de.tar.xz libguestfs-8c9f6a64be9840a955e481e932f13d005c0de0de.zip |
sparsify: Use zero-device instead of dd if=/dev/zero to zero device.
zero-device is more efficient in general, and avoids writing to blocks
which are already zero.
Diffstat (limited to 'sparsify')
-rw-r--r-- | sparsify/sparsify.ml | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml index fe12490d..501540c6 100644 --- a/sparsify/sparsify.ml +++ b/sparsify/sparsify.ml @@ -231,11 +231,9 @@ let () = if not quiet then printf "Fill free space in volgroup %s with zero ...\n%!" vg; - (* This command is expected to fail. *) - (try g#dd "/dev/zero" lvdev with _ -> ()); - - g#sync (); - g#lvremove lvdev + g#zero_device lvdev; + g#sync (); + g#lvremove lvdev ) ) ) vgs |