[Libguestfs] guestfish zerofree on LVM ?

Richard W.M. Jones rjones at redhat.com
Mon Sep 5 15:52:26 UTC 2011


On Mon, Sep 05, 2011 at 10:01:33AM +0100, Richard W.M. Jones wrote:
> On Sun, Sep 04, 2011 at 06:30:58PM -0400, Ben Clay wrote:
> > I'm trying to run zerofree on the root LVM (/dev/VolGroup/lv_root), but I'm
> > getting the following error:
> > 
> > ><fs> zerofree /dev/VolGroup/lv_root 
> > libguestfs: error: zerofree: /dev/VolGroup/lv_root: zerofree: No such file
> > or directory
> 
> It looks like the zerofree command is missing.
> 
> What does this say:
> 
>  ><fs> available "zerofree"
> 
> Do you have /usr/sbin/zerofree installed on the host?
> 
> What do these commands say:
> 
>  ><fs> debug ll /usr/sbin
> 
>  ><fs> debug ll /dev
> 
>  ><fs> debug ll /dev/VolGroup
> 
> Which version of libguestfs is this, and where did you obtain it?

As well as trying the above steps, you could also try this command (if
it fails, try also adding the -v option):

$ guestfish -N lvfs zerofree /dev/VG/LV -x
libguestfs: trace: set_pgroup true
libguestfs: trace: set_pgroup = 0
libguestfs: trace: add_drive "test1.img"
libguestfs: trace: add_drive = 0
libguestfs: trace: is_config
libguestfs: trace: is_config = 1
libguestfs: trace: launch
libguestfs: trace: launch = 0
libguestfs: trace: part_disk "/dev/sda" "mbr"
libguestfs: trace: part_disk = 0
libguestfs: trace: pvcreate "/dev/sda1"
libguestfs: trace: pvcreate = 0
libguestfs: trace: vgcreate "VG" "/dev/sda1"
libguestfs: trace: vgcreate = 0
libguestfs: trace: lvcreate "LV" "VG" 1
libguestfs: trace: lvcreate = 0
libguestfs: trace: lvresize_free "/dev/VG/LV" 100
libguestfs: trace: lvresize_free = 0
libguestfs: trace: mkfs "ext2" "/dev/VG/LV"
libguestfs: trace: mkfs = 0
libguestfs: trace: zerofree "/dev/VG/LV"
libguestfs: trace: zerofree = 0
libguestfs: trace: close
libguestfs: trace: internal_autosync
libguestfs: trace: internal_autosync = 0
libguestfs: trace: kill_subprocess
libguestfs: trace: kill_subprocess = 0
$ guestfish version
major: 1
minor: 13
release: 11
extra: -1.fc17

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




More information about the Libguestfs mailing list