On 4 January 2012 02:15, Srija <swap_proj...@yahoo.com> wrote:

> Hi,
>
> If the  file contains the sparse  bits then can anybody guide me , how to
> remove those ?  For example
> when I am checking file.img [ as below] , it's size is 38G.  Basically
> it's size is 93G because of the sparse.
>
>
You mean you want to fill in the holes?

The easy way to do this, assuming you have the disk space, is with "cp
--sparse=never file.img newfile.img; mv newfile.img file.img".

You can also just re-write the file in place using perl/python/C/whatever
but that's slightly risky because if you run out of disk space part way
through you'll probably trash the file and lose whatever data you have.

If this is a virtual machine image then you can fill in the sparse blocks
by creating a very large file in the guest (cp /dev/zero /tmp/huge; rm
/tmp/huge) although this won't necessarily fill all the sparse blocks (it
won't touch swap, for example).

Why do you think you need to make the file non-sparse?

jch
_______________________________________________
rhelv5-list mailing list
rhelv5-list@redhat.com
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to