Re: [Users] re-thin a disk

2013-03-15 Thread Richard W.M. Jones
On Wed, Mar 13, 2013 at 09:23:04PM +, Jonathan Horne wrote:
 I have a virtual machine with a 500GB thin-provisioned disk, and on
 it is about 2GB of data.  Due to a pvmove operation I am running,
 the 500GB disk with 2GB of data is growing and growing and is
 currently 180GB in size, and im sure it will go all the way to the
 500GB before it stops.

 When this process is finished, is there a way to re-thin the disk
 back down to the proper size again?  What about the export/import
 process?  Would that export it to the data size, not the block size?

There's not a way to do this in-place currently, although we're
working on it.

If you can accept a copy, then 'qemu-img convert' will automatically
sparsify disks, although it only works if there is no left-over data
in the blocks.

Also requiring a copy, virt-sparsify can fully sparsify a disk even if
it has left-over but unused data blocks.

See also:

  http://libguestfs.org/virt-sparsify.1.html
  
http://libguestfs.org/guestfs-faq.1.html#why-doesnt-virt-sparsify-work-on-the-disk-image-in-place-

 - - -

Your question also made me wonder if there was a tool to do an
in-place sparsification of a thin provisioned DM device, but there
doesn't seem to be anything for that.  *If* such a tool did exist,
then you could use it in conjunction with the following guestfish
command:

  http://libguestfs.org/guestfish.1.html#zero-free-space

ie. something like:

  guestfish -a /dev/vg/guest
  fs run
  fs list-filesystems
  # for each filesystem do:
  fs mount /dev/XXX /
  fs zero-free-space /
  fs umount /

followed by running the non-existent thinning tool.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] re-thin a disk

2013-03-14 Thread Karli Sjöberg
ons 2013-03-13 klockan 21:23 + skrev Jonathan Horne:
I have a virtual machine with a 500GB thin-provisioned disk, and on it is about 
2GB of data.  Due to a pvmove operation I am running, the 500GB disk with 2GB 
of data is growing and growing and is currently 180GB in size, and im sure it 
will go all the way to the 500GB before it stops.



When this process is finished, is there a way to re-thin the disk back down to 
the proper size again?
I think this should do the trick; from inside the guest:
# dd if=/dev/zero of=/foo/bar bs=1M
# rm /foo/bar

You fill the drive with zeroes and then deletes the file so there´s nothing 
left. Worth a try.

/Karli

What about the export/import process?  Would that export it to the data size, 
not the block size?



Thanks,

jonathan





This is a PRIVATE message. If you are not the intended recipient, please delete 
without copying and kindly advise us by e-mail of the mistake in delivery. 
NOTE: Regardless of content, this e-mail shall not operate to bind SKOPOS to 
any order or other contract unless pursuant to explicit written agreement or 
government initiative expressly permitting the use of e-mail for such purpose.

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users