guestfish zerofree on LVM ?
Hi- Is it safe to use the zerofree utility on an ext4 partition inside an LVM with guestfish? I know zerofree works on ext4, but I am unsure about LVM. The info page uses the syntax "zerofree <device>", so using the info page example, could I (safely) do something like the following? $ guestfish Welcome to guestfish, the libguestfs filesystem interactive shell for editing virtual machine filesystems. Type: 'help' for a list of commands 'man' to read the manual 'quit' to quit the shell
<fs> add disk.img
<fs> run
<fs> list-filesystems
/dev/sda1: ext4 /dev/vg_guest/lv_root: ext4 /dev/vg_guest/lv_swap: swap
<fs> zerofree /dev/vg_guest/lv_root
Thanks for any light you can shed on this. -Ben
On Thu, Sep 01, 2011 at 02:55:06PM -0400, Ben Clay wrote:
Is it safe to use the zerofree utility on an ext4 partition inside an LVM with guestfish? I know zerofree works on ext4, but I am unsure about LVM. The info page uses the syntax "zerofree <device>", so using the info page example, could I (safely) do something like the following?
Using it on logical volumes makes no difference, it'll just work the same way as on partitions or whole devices. HOWEVER, I would be cautious about using zerofree at all. It's been checked reasonably carefully against ext2/ext3, but I don't think anyone has looked at whether it does reasonable things on ext4 (particularly w.r.t. filesystems with extents). So it might work, or it might silently corrupt files ... It might be advisable to keep a backup and check your filesystem before and after with 'virt-ls --checksum'. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On Thu, Sep 01, 2011 at 09:38:36PM +0100, Richard W.M. Jones wrote:
It might be advisable to keep a backup and check your filesystem before and after with 'virt-ls --checksum'.
eg doing this: http://libguestfs.org/virt-ls.1.html#differences_in_snapshots_and_backing_fi... but also adding the --checksum parameter to both commands. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
participants (2)
-
Ben Clay -
Richard W.M. Jones