WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

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

To: "'James Pifer'" <jep@xxxxxxxxxxxxxxxx>
Subject: AW: [Xen-users] Recovering space or "shrink" disk img?
From: "Steffen Heil" <lists@xxxxxxxxxxxxxxx>
Date: Fri, 12 Sep 2008 09:16:12 +0200
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 12 Sep 2008 00:17:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1221178848.11534.43.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <1221178848.11534.43.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AckUbdEqHHYQPqYGS8+/cQPrbtprBAAOQ7FQ
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
<Prev in Thread] Current Thread [Next in Thread>