高圧縮のSFS(SquashFS)ファイルを作成する

パピーを名犬にするための技、テクニック

モデレータ: 暇人, YoN, nyu

返信する
ssnys
記事: 64
登録日時: 14/02/19(水) 17:50

高圧縮のSFS(SquashFS)ファイルを作成する

投稿記事 by ssnys »

SFS(SquashFS)ではxz圧縮を利用して高圧縮することができます。 :D <https://techoverflow.net/2013/01/11/cre ... -a-folder/>によると、`mksquashfs`コマンドに以下のようなオプションを付与することで高圧縮を実現できるようです。

コード: 全て選択

mksquashfs [source folder] [SquashFS target file] -b 1048576 -comp xz -Xdict-size 100%
試しにdevx_precise_5.7.1.sfs<https://ja.osdn.net/projects/puppylinux ... 5.7.1.sfs/>を再圧縮してみます。

コード: 全て選択

~# du -b /mnt/home/puppy/devx_precise_5.7.1.sfs
155258912	/mnt/home/puppy/devx_precise_5.7.1.sfs
~# mkdir -p /mnt/devx_precise
~# mount -o loop -t squashfs /mnt/home/puppy/devx_precise_5.7.1.sfs /mnt/devx_precise
mount: warning: /mnt/devx_precise seems to be mounted read-only.
~# mksquashfs /mnt/devx_precise/ devx_precise_5.7.1-xz.sfs -b 1048576 -comp xz -Xdict-size 100%
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on devx_precise_5.7.1-xz.sfs, block size 1048576.
[===========================================================-] 23361/23361 100%
Exportable Squashfs 4.0 filesystem, xz compressed, data block size 1048576
	compressed data, compressed metadata, compressed fragments, compressed xattrs
	duplicates are removed
Filesystem size 134731.19 Kbytes (131.57 Mbytes)
	23.40% of uncompressed filesystem size (575666.10 Kbytes)
Inode table size 201022 bytes (196.31 Kbytes)
	23.96% of uncompressed inode table size (838894 bytes)
Directory table size 242414 bytes (236.73 Kbytes)
	41.74% of uncompressed directory table size (580750 bytes)
Number of duplicate files found 475
Number of inodes 25854
Number of files 23178
Number of fragments 330
Number of symbolic links  860
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 1816
Number of ids (unique uids + gids) 2
Number of uids 2
	root (0)
	unknown (500)
Number of gids 2
	root (0)
	users (500)
~# du -b devx_precise_5.7.1-xz.sfs
137965568	devx_precise_5.7.1-xz.sfs
元のdevx_precise_5.7.1.sfsが155258912Byte、xz再圧縮したのが137965568Byte、17293344Byte(約16.5MB)削減することができました。 :P

ちなみにxzはgzipより高圧縮ですが、展開速度は遅くなるとされています。 :(
💻Lenovo G550(CPU: Intel Celeron 900 @ 2.20GHz, RAM: 971MB, HDD: 149.05GiB) + Precise-571JP
🖥HITACHI FLORA 310 DL7(CPU: Intel Pentium III 700 MHz, RAM: 384MB) + Precise-571JP
返信する