Difference between revisions of "Cloop"


From Knoppix Documentation Wiki
Jump to: navigation, search
 
m (rm dead link/s)
 
(10 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
= Introduction =
  
 +
'''Cloop''' is a [http://www.wikipedia.org/wiki/Kernel_(computers) Kernel] [http://www.wikipedia.org/wiki/module module] to add support for [http://www.wikipedia.org/wiki/filesystem filesystem]-independent, transparently decompressed, read-only, block devices.
  
 +
= Where to download =
  
 +
* [http://debian-knoppix.alioth.debian.org/sources/ http://debian-knoppix.alioth.debian.org/sources/] (Alternative link)
  
 +
Use version 1.xx if you have a 2.4 kernel, or version 2.xx for 2.6 kernel. Versions 0.xx are too old, probably won't work well.
  
<div id="wikitikitavi" style="overflow:auto; height: 1px; ">
+
= Installation =
[[http://WTHP1.disney.com] [WTHPD1]]
+
make KERNEL_DIR=/path/to/linux-kernel/sources
[http://WTHP2.disney.com WTHPD2]
+
 
[WTHPD3](http://WTHP3.disney.com)
+
Issue these commands as [[root]]
[http://WTHP4.disney.com | WTHPD4]
+
mkdir -p /lib/modules/misc && cp cloop.ko /lib/modules/misc/
[WTHPD5 | http://WTHP5.disney.com]
+
depmod -a
</div>
+
mknod /dev/cloop b 240 0
 +
 +
= Usage =
 +
 
 +
== Creating a compressed image: ==
 +
 
 +
create_compressed_fs image blocksize > image.cloop_compressed
 +
 
 +
Where
 +
blocksize must be a multiple of 512 bytes. Make sure you have enough
 +
swap to hold the entire compressed image in virtual memory!
 +
 
 +
The command may also be used in [[Linux]] [[command line]] pipe sequences. Use "-" as the image filename.   The dash, "-" will cause the command to read data from stdin, as in
 +
 
 +
  mkisofs -r datadir | create_compressed_fs - 65536 > datadir.iso.compressed
 +
 
 +
== Mounting a compressed image (see above for device creation): ==
 +
 
 +
# Unless zlib_deflate/inflate features are built-in to your kernel, you may
 +
# also need to install related kernel modules.
 +
modprobe zlib_inflate
 +
modprobe zlib_deflate
 +
 
 +
insmod cloop.ko file=/path/to/compressed/image
 +
 
 +
[[mount]] -o ro -t whatever /dev/cloop /mnt/compressed
 +
1
 +
 
 +
== If you boot from the LiveDVD and want to mount a compressed image, which you have saved on the disc: ==
 +
Check with the 'mount' command which /dev/cloopX  (where X goes from 0 to 7, because cloop can do just 8 devices)
 +
are already in use.
 +
Then mount your compressed image to a cloop device via
 +
 
 +
losetup /dev/cloopX /path/to/compressed/image
 +
 
 +
[[mount]] -o ro /dev/cloopX /mnt/compressed
 +
 
 +
[[Category:Useful Linux Commands]]

Latest revision as of 12:59, 16 October 2008

Introduction

Cloop is a Kernel module to add support for filesystem-independent, transparently decompressed, read-only, block devices.

Where to download

Use version 1.xx if you have a 2.4 kernel, or version 2.xx for 2.6 kernel. Versions 0.xx are too old, probably won't work well.

Installation

make KERNEL_DIR=/path/to/linux-kernel/sources

Issue these commands as root

mkdir -p /lib/modules/misc && cp cloop.ko /lib/modules/misc/
depmod -a
mknod /dev/cloop b 240 0

Usage

Creating a compressed image:

create_compressed_fs image blocksize > image.cloop_compressed

Where blocksize must be a multiple of 512 bytes. Make sure you have enough swap to hold the entire compressed image in virtual memory!

The command may also be used in Linux command line pipe sequences. Use "-" as the image filename. The dash, "-" will cause the command to read data from stdin, as in

mkisofs -r datadir | create_compressed_fs - 65536 > datadir.iso.compressed

Mounting a compressed image (see above for device creation):

# Unless zlib_deflate/inflate features are built-in to your kernel, you may
# also need to install related kernel modules.
modprobe zlib_inflate
modprobe zlib_deflate
insmod cloop.ko file=/path/to/compressed/image
mount -o ro -t whatever /dev/cloop /mnt/compressed

1

If you boot from the LiveDVD and want to mount a compressed image, which you have saved on the disc:

Check with the 'mount' command which /dev/cloopX (where X goes from 0 to 7, because cloop can do just 8 devices) are already in use. Then mount your compressed image to a cloop device via

losetup /dev/cloopX /path/to/compressed/image
mount -o ro /dev/cloopX /mnt/compressed