From 8c9f6a64be9840a955e481e932f13d005c0de0de Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 15 Mar 2012 10:32:27 +0000 Subject: 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. --- sparsify/sparsify.ml | 8 +++----- 1 file 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 -- cgit