Go to the first, previous, next, last section, table of contents.


e2compr with the loop driver

There's no problem with mounting ext2 filesystems (whether or not they use ext2 compression) through the loop driver on a non-ext2-compressed file.

However, you can't mount a loop-back device on an ext2-compressed file, like:

# chattr +c myfile
# losetup /dev/loop0 myfile

If you want to do this (i.e. create a large block device from a smaller file or block device) then you should look at DouBle, which was built for this very purpose. (See section Reference for DouBle.)

For those interested: The reason the loop driver won't work on a compressed file is that the loop driver uses bmap, i.e. it asks the filesystem "Which blocks hold this file?" and tries to access that block directly. Since the file data is stored in compressed format, there is no correct answer to that question. You'll get a couple of syslog messages, like so:

EXT2-fs warning (device 03:02): ext2_bmap: compressed cluster
loop: block 1 not present
end_request: I/O error, dev 07:00, sector 2


Go to the first, previous, next, last section, table of contents.