Re: copying 'holey' files ...

2008-11-03 Thread Wojciech Puchar


I have a disk img for qemu that is 4G, but disk usage is only 650M ... due to
how the image is created, it will grow to 4G, but only uses as much as it needs
... but, if I run a simple 'cp' on the file, it goes from:


tar have options for that



image: debian.img
file format: raw
virtual size: 4.0G (4294967296 bytes)
disk size: 652M

to:

image: dtc.img
file format: raw
virtual size: 4.0G (4294967296 bytes)
disk size: 4.0G

Is there a way of moving things around such that it *maintains* the holes,
instead of fills them in?

Thx


- --
Marc G. FournierHub.Org Hosting Solutions S.A. (http://www.hub.org)
Email . [EMAIL PROTECTED]  MSN . [EMAIL PROTECTED]
Yahoo . yscrappy   Skype: hub.orgICQ . 7615664
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkkPKWEACgkQ4QvfyHIvDvNJIwCeOTgfxMEf/g/7bnFehXlDZAva
dCwAoJL8sNsCD+h3PnJAAzebAQFsHhfa
=fcAm
-END PGP SIGNATURE-

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: copying 'holey' files ...

2008-11-03 Thread Marc G. Fournier
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Sweet, never even thought about doing that ... thank you ...

- --On Monday, November 03, 2008 11:04:22 -0600 Matt <[EMAIL PROTECTED]> wrote:

> On Mon, Nov 3, 2008 at 10:40 AM, Marc G. Fournier <[EMAIL PROTECTED]> wrote:
>>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>>
>> I have a disk img for qemu that is 4G, but disk usage is only 650M ... due to
>> how the image is created, it will grow to 4G, but only uses as much as it
>> needs ... but, if I run a simple 'cp' on the file, it goes from:
>>
>> image: debian.img
>> file format: raw
>> virtual size: 4.0G (4294967296 bytes)
>> disk size: 652M
>>
>> to:
>>
>> image: dtc.img
>> file format: raw
>> virtual size: 4.0G (4294967296 bytes)
>> disk size: 4.0G
>>
>> Is there a way of moving things around such that it *maintains* the holes,
>> instead of fills them in?
>>
> The "qemu-img" program using the "convert" command should do what you
> want it to.  I've used it to make copies of qcow-format disks without
> having them grow to their max-size.
>
> Matt



- -- 
Marc G. FournierHub.Org Hosting Solutions S.A. (http://www.hub.org)
Email . [EMAIL PROTECTED]  MSN . [EMAIL PROTECTED]
Yahoo . yscrappy   Skype: hub.orgICQ . 7615664
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkkPMP4ACgkQ4QvfyHIvDvOvRACgyVOSp3nqJgqFQE7Ilm4IXbUZ
d+YAnj2lddYnGcLMBzSkXjbk0onRfnZY
=+Ft+
-END PGP SIGNATURE-

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: copying 'holey' files ...

2008-11-03 Thread Fabian Keil
"Marc G. Fournier" <[EMAIL PROTECTED]> wrote:

> I have a disk img for qemu that is 4G, but disk usage is only 650M ... due to 
> how the image is created, it will grow to 4G, but only uses as much as it 
> needs 
> ... but, if I run a simple 'cp' on the file, it goes from:
> 
> image: debian.img
> file format: raw
> virtual size: 4.0G (4294967296 bytes)
> disk size: 652M
> 
> to:
> 
> image: dtc.img
> file format: raw
> virtual size: 4.0G (4294967296 bytes)
> disk size: 4.0G
> 
> Is there a way of moving things around such that it *maintains* the holes, 
> instead of fills them in?

Quoting dd(1):

| conv=value[,value ...]
|  Where value is one of the symbols from the following list.
[...]
|  sparse   If one or more output blocks would consist solely of
|   NUL bytes, try to seek the output file by the required
|   space instead of filling them with NULs, resulting in a
|   sparse file.

I haven't actually tested it with qemu images, though.

Fabian


signature.asc
Description: PGP signature


Re: copying 'holey' files ...

2008-11-03 Thread Matt
On Mon, Nov 3, 2008 at 10:40 AM, Marc G. Fournier <[EMAIL PROTECTED]> wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> I have a disk img for qemu that is 4G, but disk usage is only 650M ... due to
> how the image is created, it will grow to 4G, but only uses as much as it 
> needs
> ... but, if I run a simple 'cp' on the file, it goes from:
>
> image: debian.img
> file format: raw
> virtual size: 4.0G (4294967296 bytes)
> disk size: 652M
>
> to:
>
> image: dtc.img
> file format: raw
> virtual size: 4.0G (4294967296 bytes)
> disk size: 4.0G
>
> Is there a way of moving things around such that it *maintains* the holes,
> instead of fills them in?
>
The "qemu-img" program using the "convert" command should do what you
want it to.  I've used it to make copies of qcow-format disks without
having them grow to their max-size.

Matt
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


copying 'holey' files ...

2008-11-03 Thread Marc G. Fournier
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


I have a disk img for qemu that is 4G, but disk usage is only 650M ... due to 
how the image is created, it will grow to 4G, but only uses as much as it needs 
... but, if I run a simple 'cp' on the file, it goes from:

image: debian.img
file format: raw
virtual size: 4.0G (4294967296 bytes)
disk size: 652M

to:

image: dtc.img
file format: raw
virtual size: 4.0G (4294967296 bytes)
disk size: 4.0G

Is there a way of moving things around such that it *maintains* the holes, 
instead of fills them in?

Thx


- -- 
Marc G. FournierHub.Org Hosting Solutions S.A. (http://www.hub.org)
Email . [EMAIL PROTECTED]  MSN . [EMAIL PROTECTED]
Yahoo . yscrappy   Skype: hub.orgICQ . 7615664
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkkPKWEACgkQ4QvfyHIvDvNJIwCeOTgfxMEf/g/7bnFehXlDZAva
dCwAoJL8sNsCD+h3PnJAAzebAQFsHhfa
=fcAm
-END PGP SIGNATURE-

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"