CREATE_COMPRESSED_FS(1)

โœจ CREATE_COMPRESSED_FS(1) โœจ ๐Ÿ’–

Okay so bestie, this is the manual page for create_compressed_fs and extract_compressed_fs ๐ŸŽ€ Both tools convert a filesystem to and from a cloop volume, which is a compressed image you can mount with the cloop driver. Main character energy, no cap ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

create_compressed_fs, extract_compressed_fs โ€” convert and extract a filesystem to/from a cloop volume ๐Ÿฆ‹


๐Ÿงš SYNOPSIS ๐Ÿงš

create_compressed_fs [ OPTIONS ] image outfile

extract_compressed_fs filename

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

create_compressed_fs takes a filesystem image and compresses it into a compressed image that's ready to mount with the cloop driver. It's giving tiny file, big energy โœจ

extract_compressed_fs does the reverse ๐Ÿ”ฅ It uncompresses a filesystem image that was made by create_compressed_fs. Iconic.


๐ŸŽ€ OPTIONS ๐ŸŽ€

Run create_compressed_fs with "-h" to get the full list of options ๐Ÿ“‹ You'll also find descriptions of the data storage modes and advanced usage stuff (like working with a network cluster) in there. Blocksize has to be a multiple of 512 bytes, so keep that in mind ๐Ÿ™ˆ

There's also an alternative set of options that's supported for compatibility with the original version of create_compressed_fs. If you call it with a pure number as the output, it assumes the old syntax ๐Ÿ•ฐ๏ธ and maps the default options to memory mode, with the block size set to that number. -b for best mode is recognized too, so you're covered ๐Ÿ’–


๐Ÿ“ EXAMPLES ๐Ÿ“

Here are some combos you can try, bestie ๐Ÿซถ

create_compressed_fs image.ext2 image.ext2.cloop

extract_compressed_fs image.ext2.cloop | cmp image.ext2 -

mkcmd="genisoimage -joliet-long -D -r data"

$mkcmd | create_compressed_fs -s $($mkcmd --print-size)i - file.cloop

create_compressed_fs image.iso -S image.cloop.a0 - | split -b 1024m -
image.cloop.

cat image.cloop.* | cdrskin -

๐ŸŒˆ NOTES ๐ŸŒˆ

okay so this part is lowkey important ๐Ÿ‘€

For optimal performance, create_compressed_fs should be used with real input and output files. Real files are the move ๐Ÿ’…

Operation with STDIN or STDOUT is complicated ๐Ÿ˜ญ create_compressed_fs can't work as a simple pipe filter because it needs to know some things in advance: a) the data length, and b) the block lengths calculated during compression. That metadata has to be stored in the header AFTER the compression is through, so it's not possible to push all the generated data to STDOUT on-the-fly. Not a vibe.

So compromises have to be made ๐Ÿฅบ The simplest method, the one used by the ancient create_compressed_fs, is a big temporary memory buffer (option -m) that keeps the compressed data in RAM. Be warned though: this tanks overall system performance and can drive other applications into OOM conditions ๐Ÿ’€

Heads up bestie: the -m memory buffer can push other apps into OOM conditions. Use with care!

The next option is storing the temporary data in an extra file on the side (the -f option). This improves overall system performance, but create_compressed_fs gets slower because it has to copy the data back when it's finished. Plus, you need double the disk space for the output. If disk space is limited, you can use the -r option to reuse the output file for temporary data, but the copy-back step may slow down significantly ๐Ÿข

There are strategies to avoid temporary data storage completely ๐Ÿง  First, only use files. If that's not possible, the output should be a (seekable) file and the input data length should be known, either specified with the -s option or detected from the input file size.

Second, you can store the cloop volume header in a separate file. After the work is done, merge the header with the compressed data using the cat command. The output data can be written to stdout. Since the header is stored too late, this method isn't very useful for immediate data transfer. It does allow some tricks though, like piping to the split utility (to store DVD images in smaller files on VFAT) or piping data through ssh if the local system has no disk space (and copying the header separately) ๐Ÿฆ‹


๐Ÿ”ฎ MOUNTING ๐Ÿ”ฎ

You can pass an option to the cloop module when loading it, or use losetup or the losetup functionality of the mount command. Examples, bestie:

insmod cloop.o file=/path/to/compressed/image

losetup /dev/cloop1 /path/to/compressed/image

mount -o ro -t whatever /dev/cloop /mnt/compressed

mount cl /mnt/misc -oloop=/dev/cloop0

๐Ÿฆ„ SEE ALSO ๐Ÿฆ„

/usr/share/doc/cloop-utils/*, /usr/share/doc/cloop-src/* ๐Ÿ“š


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

This manual page was written by Eduard Bloch <blade@debian.org> for the Debian GNU/Linux system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU GPLv2 โญ


Originally written in 04 Dezember 2006 by the cloop-utils crew, so it's a little vintage now ๐Ÿ•ฐ๏ธ Stay iconic, bestie ๐Ÿ’…โœจ๐Ÿซถ