1NOTE: This the original README for version 2.0. It is retained as it 2contains information about the fragment design. A description of the new 2.0 3mksquashfs options has been added to the main README file, and that 4file should now be consulted for these. 5 6 SQUASHFS 2.0 - A squashed read-only filesystem for Linux 7 8 Copyright 2004 Phillip Lougher (plougher@users.sourceforge.net) 9 10 Released under the GPL licence (version 2 or later). 11 12Welcome to the final release of Squashfs version 2.0! A lot of changes to the 13filesystem have been made under the bonnet (hood). Squashfs 2.0 uses fragment 14blocks and larger blocks (64K) to improve compression ratio by about 5 - 20% 15over Squashfs 1.0 depending on the files being compressed. Using fragment 16blocks allows Squashfs 2.0 to achieve better compression than cloop and similar 17compression to tgz files while retaining the I/O efficiency of a compressed 18filesystem. 19 20Detailed changes: 21 221. Squashfs 2.0 has added the concept of fragment blocks (see later discussion). 23 Files smaller than the file block size (64K in Squashfs 2.0) and optionally 24 the remainder of files that do not fit fully into a block (i.e. the last 32K 25 in a 96K file) are packed into shared fragments and compressed together. 26 This achieves on average 5 - 20% better compression than Squashfs 1.x. 27 282. The maximum block size has been increased to 64K. 29 303. The maximum number of UIDs has been increased to 256 (from 48 in 1.x). 31 324. The maximum number of GIDs has been increased to 256 (from 15 in 1.x). 33 345. New mksquashfs -all-root, -root-owned, -force-uid, and -force-gid 35 options. These allow the uids/gids of files in the generated 36 filesystem to be specified, overriding the uids/gids in the 37 source filesystem. 38 396. Initrds are now supported for kernels 2.6.x. 40 417. Removal of sleep_on() function call in 2.6.x patch, to allow Squashfs 42 to work on the Fedora rc2 kernel. 43 448. AMD64, check-data and gid bug fixes. 45 469. Numerous small bug fixes have been made. 47 4810. New patch for Linux 2.6.7. 49 50 51New Squashfs 2.0 options 52------------------------ 53 54-noF or -noFragmentCompression 55 56 Do not compress the fragments. Added for compatibility with noI and 57 noD, probably not that useful. 58 59-no-fragments 60 61 Do not use fragment blocks, and rather generate a filesystem 62 similar to a Squashfs 1.x filesystem. It will of course still 63 be a Squashfs 2.0 filesystem but without fragments, and so 64 it won't be mountable on a Squashfs 1.x system. 65 66-always-use-fragments 67 68 By default only small files less than the block size are packed into 69 fragment blocks. The ends of files which do not fit fully into a block, 70 are NOT by default packed into fragments. To illustrate this, a 71 100K file has an initial 64K block and a 36K remainder. This 72 36K remainder is not packed into a fragment by default. This is 73 because to do so leads to a 10 - 20% drop in sequential I/O 74 performance, as a disk head seek is needed to seek to the initial 75 file data and another disk seek is need to seek to the fragment 76 block. 77 78 Specify this option if you want file remainders to be packed into 79 fragment blocks. Doing so may increase the compression obtained 80 BUT at the expense of I/O speed. 81 82-no-duplicates 83 84 Do not detect duplicate files. 85 86-all-root 87-root-owned 88 89 These options (both do exactly the same thing), force all file 90 uids/gids in the generated Squashfs filesystem to be root. 91 This allows root owned filesystems to be built without root access 92 on the host machine. 93 94-force-uid uid 95 96 This option forces all files in the generated Squashfs filesystem to 97 be owned by the specified uid. The uid can be specified either by 98 name (i.e. "root") or by number. 99 100-force-gid gid 101 102 This option forces all files in the generated Squashfs filesystem to 103 be group owned by the specified gid. The gid can be specified either by 104 name (i.e. "root") or by number. 105 106 107Compression improvements example 108-------------------------------- 109 110The following is the compression results obtained compressing the 2.6.6 111linux kernel source using CRAMFS, Cloop (with iso filesystem), Squashfs 1.3 and 112Squashfs 2.0 (results generated using big-endian filesystems). 113 114In decreasing order of size: 115 116 CRAMFS 62791680 bytes (59.9M) 117 Squashfs 1.x 51351552 bytes (48.9M) 118 Cloop 46118681 bytes (44.0M) 119 Squashfs 2.0 45604854 bytes (43.5M) 120 121 122The Squashfs 1.x filesystem is 12.6% larger than the new 2.0 filesystem. 123The cloop filesystem is 1.1% larger than the Squashfs 2.0 filesystem. 124 125 126Fragment blocks in Squashfs 2.0 127------------------------------- 128 129Squashfs like all other compressed filesystems compresses files individually 130on a block by block basis. This is performed to allow mounting and 131de-compression of files on a block by block basis without requiring the entire 132filesystem to be decompressed. This is in contrast to data-based compression 133schemes which compress without understanding the underlying filesystem (i.e. 134cloop and tgz files) and which, therefore, do not compress files individually. 135Each approach has advantages and disadvantages, data-based systems have better 136compression because compression is always performed at the maximum block size 137(64K in cloop) irrespective of the size of each file (which could be less than 138the block size). Compressed filesystems tend to be faster at I/O because 139they understand the filesystem and therefore employ better caching stategies 140and read less un-needed data from the filesystem. 141 142Fragment blocks in Squashfs 2.0 solves this problem by packing files (and 143optionally the ends of files) which are smaller than the block size into 144shared blocks, which are compressed together. For example five files each of 14510K will be packed into one shared fragment of 50K and compressed together, 146rather than being compressed in five 10K blocks. 147 148This scheme produces a hybrid filesystem, retaining the I/O efficiency 149of a compressed filesystem, while obtaining the compression efficiency 150of data-based schemes by compressing small files together. 151 152 153Squashfs 1.x and Squashfs 2.0 compatibility 154------------------------------------------- 155 156Appending to Squashfs 1.x filesystems is not supported. If you wish to append 157to 1.x filesystems, then either use the original mksquashfs, or convert them 158to Squashfs 2.0 by mounting the filesystem and running the 2.0 mksquashfs 159on the mounted filesystem. 160 161Mounting Squashfs 1.x filesystems IS supported by the 2.0 kernel patch. 162