Check my post here <a href="http://planet.admon.org/howto/how-to-check-sparse-files-with-perl/">How to Check Sparse Files with Perl</a><br><br>For any issues plesae let me know :)<br><br>J<br><br><div class="gmail_quote">On Thu, Mar 11, 2010 at 3:43 AM, Eric Sandeen <span dir="ltr"><<a href="mailto:sandeen@redhat.com">sandeen@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">Sean McCauliff wrote:<br>
> Is there a way to find the holes in sparse files, other than assuming<br>
> contiguous blocks of zeroes are holes?<br>
<br>
</div>yes, programatically you can use a couple ioctls:<br>
fibmap (block-at-a-time) or fiemap in newer kernels.<br>
<br>
If you want a commandline, try filefrag -v.<br>
<br>
For ioctl usage examples, take a look at how filefrag is implemented.<br>
<br>
# dd if=/dev/zero of=testfile bs=4k count=1; dd if=/dev/zero of=testfile conv=notrunc bs=4k seek=4 count=1<br>
# sync<br>
# filefrag -v testfile<br>
Filesystem type is: ef53<br>
File size of testfile is 20480 (5 blocks, blocksize 4096)<br>
 ext logical physical expected length flags<br>
   0       0  1829913               1<br>
   1       4  1802777  1829913      1 eof<br>
testfile: 2 extents found<br>
<br>
the logical+length gap shows you that there was a hole in there<br>
<br>
Andreas has patches to make it still clearer in the table output.<br>
<font color="#888888"><br>
-Eric<br>
</font><div><div></div><div class="h5"><br>
> Thanks,<br>
> Sean<br>
><br>
> _______________________________________________<br>
> Ext3-users mailing list<br>
> <a href="mailto:Ext3-users@redhat.com">Ext3-users@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/ext3-users" target="_blank">https://www.redhat.com/mailman/listinfo/ext3-users</a><br>
<br>
_______________________________________________<br>
Ext3-users mailing list<br>
<a href="mailto:Ext3-users@redhat.com">Ext3-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/ext3-users" target="_blank">https://www.redhat.com/mailman/listinfo/ext3-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Sponser and operater: Linux monitoring solution: <a href="http://www.admon.org">http://www.admon.org</a> <br>