2004-06-01

Compressed Filesystems under Linux (ziosfs/squashfs)

isofs
$ isosize -x /dev/cdrom
sector count: 146112, sector size: 2048
$ isosize -d block_count /dev/cdrom
299,237,376
$ dd if=/dev/cdrom of=image.iso bs=2k count=146112 conv=notrunc,noerror
146112+0 records in
146112+0 records out

real    1m25.266s
user    0m0.098s
sys     0m4.379s
$ ls -l image.iso
299,237,376 image.iso
$ tar cvjpf image.tbz2 image.iso && ls -l image.tbz2
284,117,981 image.tbz2
ziofs
$ mkzftree -p 4 /mnt/cdrom ziso
real    1m27.215s
user    0m30.316s
sys     0m3.644s
$ mkisofs -z -R -J -o image.ziso ziso
Warning: using transparent compression. This is a nonstandard Rock Ridge
         extension. The resulting filesystem can only be transparently
         read on Linux. On other operating systems you need to call
         mkzftree by hand to decompress the files.

Total translation table size: 0
Total rockridge attributes bytes: 36308
Total directory bytes: 71680
Path table size(bytes): 228
Max brk space used 63000
139603 extents written (272 MB)

real    0m24.501s
user    0m0.463s
sys     0m1.647s
$ ls -l image.ziso
285,906,944
squashfs
$ mksquashfs /mnt/cdrom image.sqsh
Creating little endian filesystem on image.sqsh, block size 32768.

Little endian filesystem, data block size 32768, compressed data, compressed 
metadata
Filesystem size 277719.14 Kbytes (271.21 Mbytes)
        95.19% of uncompressed filesystem size (291761.77 Kbytes)
Inode table size 8704 bytes (8.50 Kbytes)
        36.38% of uncompressed inode table size (23925 bytes)
Directory table size 2517 bytes (2.46 Kbytes)
        53.70% of uncompressed directory table size (4687 bytes)
Number of duplicate files found 14
Number of inodes 353
Number of files 337
Number of symbolic links  0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 16
Number of uids 1
        root (0)
Number of gids 0

real    1m35.402s
user    0m31.254s
sys     0m2.945s
$ ls -l image.sqsh
284,385,280