The compressed loop device (cloop) is a
module for the
Linux kernel
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
. It adds support for transparently decompressed, read-only
block devices. It is not a compressed
file system: cloop is mostly used as a convenient way to compress conventional file systems onto
Live CD
A live CD (also live DVD, live disc, or live operating system) is a complete booting, bootable computer installation including operating system which runs directly from a CD-ROM or similar storage device into a computer's memory, rather than lo ...
s.
Cloop was originally written for the
Levanta
Levanta (previously Linuxcare) was a company based in San Mateo, California, United States, that created products for Linux management and data virtualization.
Company history
Linuxcare was founded in San Francisco in 1998 by Dave Sifry, Arthur T ...
Bootable Business Card by
Rusty Russell
Rusty Russell is an Australian free software programmer and advocate, known for his work on the Linux kernel's networking subsystem and the Filesystem Hierarchy Standard.
Software development
Russell wrote the packet filtering systems ipch ...
, but is now maintained by
Klaus Knopper, the author of
Knoppix
Knoppix, stylized KNOPPIX ( ), is an operating system based on Debian designed to be run directly from a CD or DVD (Live CD) or a USB flash drive ( Live USB). It was first released in 2000 by German Linux consultant Klaus Knopper, and was one ...
.
A compression ratio of about 2.5:1 is common for software. The Knoppix cloop image, for example, is 700 MB compressed and around 1.8 GB uncompressed.
Design
cloop images contain:
* A
shell script
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be command languages. Typical operations performed by shell scripts include file manipu ...
(with mount commands for the image)
* A header with the number of blocks and the uncompressed block size
* A seek index with compressed and uncompressed block sizes in pairs
*
zlib
zlib ( or "zeta-lib", ) is a software library used for data compression as well as a data format. zlib was written by Jean-loup Gailly and Mark Adler and is an abstraction of the DEFLATE compression algorithm used in their gzip file compre ...
-compressed data blocks, packed end-to-end
The data blocks are compressed separately; this makes it possible to seek to individual blocks without having to decompress the entire image from the start, but at the cost of slightly reducing the compression ratio. Live CD images typically use a block size of 256 KB as a compromise between decompression speed and space-efficiency.
Apple uses a similar file format in the compressed variant of its
DMG DMG may refer to:
Organizations Entertainment
* DMG Clearances, music licensor in Delaware, USA
* DMG Entertainment, a Chinese-based film production and distribution company
* DMG Nashville, a brand of Hollywood Records specializing in country musi ...
disk images.
Limitations
The design of the cloop driver requires that compressed blocks be read whole from disk. This makes cloop access inherently slower when there are many scattered reads, which can happen if the system is low on memory or when a large program with many shared libraries is starting. A big issue is the seek time for CD-ROM drives (~80 ms), which exceeds that of hard disks (~10 ms) by a large factor. On the other hand, because files are packed together, reading a compressed block may thus bring in more than one file into the cache. The effects of tail packing are known to improve seek times (cf.
reiserfs
ReiserFS is a general-purpose, journaling file system initially designed and implemented by a team at Namesys led by Hans Reiser and licensed under GPLv2. Introduced in version 2.4.1 of the Linux kernel, it was the first journaling file syst ...
,
btrfs
Btrfs (pronounced as "better F S", "butter F S", "b-tree F S", or "B.T.R.F.S.") is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager (distinct from Linux's LVM), d ...
), especially for small files. Some performance tests related to cloop have been conducted.
[ 31-Dec-2011]
See also
*
Loop device
In Unix-like operating systems, a loop device, vnd (vnode disk), or lofi (loop file interface) is a pseudo-device that makes a computer file accessible as a block device.
Before use, a loop device must be connected to an existent file in the fil ...
*
Cramfs
The compressed ROM/RAM file system (or cramfs) is a free ( GPL'ed) read-only Linux file system designed for simplicity and space-efficiency. It is mainly used in embedded and small-footprint systems.
Unlike a compressed image of a convention ...
*
SquashFS
Squashfs is a compressed read-only file system for Linux. Squashfs compresses files, inodes and directories, and supports block sizes from 4 KiB up to 1 MiB for greater compression. Several compression algorithms are supported. Squashfs is ...
*
e2compr
References
External links
{{Wiktionary
*cloo
sourcesagainst the mainline Linux kernels and
patchto support any known cloop format. Note: versions 0.xx are for kernel 2.2; 1.xx are for kernel 2.4; 2.xx are for kernel 2.4 and 2.6.
cloop at Knoppix Linux Wiki(installation instructions are here)
*Slides from a LinuxTa
presentationby Klaus Knopper on the implementation of cloop (in German).
*
fusedriver for cloop with
patchdescription to support any known cloop format and th
binary
Compression file systems
Knoppix
Third-party Linux kernel modules