Hi, i have two twofold e2image related questions: 1) The man page mentions "cp (1)"'s --sparse=always option. I wonder if there are sparse aware tools which a) display the "real" amount of disk space occupied by a sparse file b) compress sparse files (other than compressing very thightly several GiB of zeros) 2) "E2fsck, mke2fs, etc. will now reliably notice when image files are mounted using the loopback interface. (Addresses Sourceforge bug #619119)" (quoted from RELEASE-NOTES.gz) a) Is e2fsck now able to use (raw) e2images while repairing ext2 file systems? b) Is this also useful for ext3 file systems? Thanks for developing e2-tools and for the the great support in this list, Gregor -- echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D3F204445524F42snlbxq'|dc
Theodore Ts'o
2003-Jan-08 16:15 UTC
Re: [Q] e2image: tools for sparse files & e2sfck support
On Wed, Jan 08, 2003 at 01:08:04PM +0100, Gregor Zattler wrote:> i have two twofold e2image related questions: > > 1) The man page mentions "cp (1)"'s --sparse=always option. I > wonder if there are sparse aware tools which > > a) display the "real" amount of disk space occupied by a > sparse filels -s will return the amount of "real" disk space occupied by a sparse file.> b) compress sparse files (other than compressing very > thightly several GiB of zeros)bzip2 or gzip do a very nice job of compressing a sparse file. Unfortunately, bunzip2 and gunzip do not write out a sparse file when it uncompresses it. It isn't hard to write a program though that will write a sparse file given a file with lots of zeros on stdin, which you could use as follows: bunzip2 < foo.img.bz2 | make-sparse foo.img Writing such a program is left as an exercise to the reader. If someone writes one and sends it to me, I'll likely even include it in e2fsprogs. :-)> 2) "E2fsck, mke2fs, etc. will now reliably notice when image > files are mounted using the loopback interface. (Addresses > Sourceforge bug #619119)" (quoted from RELEASE-NOTES.gz) > > a) Is e2fsck now able to use (raw) e2images while repairing ext2 > file systems?You can run e2fsck on a raw e2image; e2image -r makes a raw image which contains all the blocks that e2fsck would ever try to look at. I will often ask for a bzip2 compressed raw image file when trying to debug some problem with a filesystem, and I will often run e2fsck against the raw image to see how e2fsck is complaining about a particular filesystem. However, while you could allow e2fsck to "fix" the problems it finds in the raw e2image, this wouldn't actually help you fix the problem found in the original filesystem.> b) Is this also useful for ext3 file systems?See above. - Ted