Cramfs
|
The compressed ROM filesystem (or cramfs) is a read-only Linux files ystem designed for simplicity and space-efficiency. It is mainly used in embedded systems and small-footprint systems.
Some Linux distributions also appear to use cramfs as a file system for initial ramdisks (recent versions of Debian in particular) and installation images (SuSE in particular), where there may be onerous space constraints. Unlike a compressed image of a conventional filesystem, a cramfs image does not have to be uncompressed first and can be used as-is, compressed.
Contents |
Design
Files on cramfs file systems are compressed file one page at a time to allow random read access. The meta-data is not compressed, but is expressed in a terse representation that is more space-efficient than conventional filesystems.
cramfs is intentionally read-only to simplify its design: random write access for compressed files is difficult to implement. Instead, it ships with a utility (mkcramfs
) to pack files into new cramfs images.
Limits
- File sizes are limited to less than 16MB.
- Maximum filesystem size is a little over 256MB; the last file on the filesystem is allowed to extend past 256MB.
- Only the low 8 bits of gid are stored. The current version of mkcramfs simply truncates to 8 bits, which is a potential security issue.
- Hard links are supported, but hard linked files will still have a link count of 1 in the cramfs image.
- Cramfs directories have no `.' or `..' entries. Directories (like every other file on cramfs) always have a link count of 1(however, there's no need to use -noleaf in `find').
- No timestamps are stored in a cramfs, so these default to the epoch (1970 GMT). Recently-accessed files may have updated timestamps, but the update lasts only as long as the inode is cached in memory, after which the timestamp reverts to 1970, i.e. moves backwards in time.
- Currently, cramfs must be written and read with architectures of the same endianness, and can be read only by kernels with the same cramfs page size. At least the latter of these is a bug, but it hasn't been decided what the best fix is.
See also
External Links
cramfs Sourceforge.net project page (http://sourceforge.net/projects/cramfs/)