[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: [Xen-users] Recovering space or "shrink" disk img?



Hi

This is not a xen issue, this is a linux fs issue.

In short: Xen does not know and neighter care about sparse files.
It justs looks at the file like at a disk.

The domUs writes are written into the file - while the file system allocates
space it it was a sparse area.
However, there is no such thing as removing blocks from a device.

If you delete the file, you delete the filesystems pointer to that file.
The data itself stays where it is.

Even if it would be overwritten (by 0 or something), it would not get freed
as sparse area again.


The only thing you can do, is create a new file, copy all contents
(backup/restore) and delete the old file.
As the new file will only be allocated as much space as nessessary, it is a
"shrink".

Surely, the domU needs to be shut down completely.

Regards,
  Steffen


-----Ursprüngliche Nachricht-----
Von: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] Im Auftrag von James Pifer
Gesendet: Freitag, 12. September 2008 02:21
An: Xen List
Betreff: [Xen-users] Recovering space or "shrink" disk img?

We use a lot of sparse disk images. On one of them I setup a temporary
swapfile of 4 gig and enabled it. I did not add it to fstab, etc. On
reboot I wanted it to go away in this case. 

Anyway, upon rebooting and removing the 4gb file, I have not gained back
the space in the sparse file. For example, if I do:
du -s -B1 disk0
13056692224     disk0

That's the same thing I got before removing the 4 gb file. Should I
expect disk0 to "recover" the space automatically? VMware has a shrink
disk option, does something similar need to be done in xen?

Thanks,
James


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.