メモ2に続くのか不明。
・openSUSE用パッケージ
https://build.opensuse.org/package/show?package=fuse-lessfs&project=home%3Axkitty68
filesystemsプロジェクトのが1.3.3で止まってた上にファールなってたので,適当に作りなおした。
・設定
ググれば出てくるので省略する。
openSUSE用パッケージでは,デフォルトの/etc/lessfs.confは
/usr/share/doc/packages/fuse-lessfsのetc/lessfs.confからコピーしてくる。
以下,デフォルトのlessfs.confのまま。
・挙動
・ボリューム容量
/data # l dta mta
dta:
total 6615988
drwxr-xr-x 2 root root 4096 2月 14 21:30 ./
drwxr-xr-x 5 root root 4096 2月 14 21:30 ../
-rwx------ 1 root root 6774757912 2月 14 22:04 blockdata.dta*
-rwx------ 1 root root 0 2月 14 21:30 replog.dta*
mta:
total 75772
drwxr-xr-x 2 root root 4096 2月 14 21:31 ./
drwxr-xr-x 5 root root 4096 2月 14 21:30 ../
-rw-r--r-- 1 root root 13471716 2月 14 22:42 blockusage.tch
-rw-r--r-- 1 root root 276 2月 14 22:42 blockusage.tch.wal
-rw-r--r-- 1 root root 9457152 2月 14 22:42 dirent.tcb
-rw-r--r-- 1 root root 276 2月 14 22:42 dirent.tcb.wal
-rw-r--r-- 1 root root 16691084 2月 14 22:42 fileblock.tch
-rw-r--r-- 1 root root 276 2月 14 22:42 fileblock.tch.wal
-rw-r--r-- 1 root root 9442048 2月 14 22:42 freelist.tcb
-rw-r--r-- 1 root root 276 2月 14 22:42 freelist.tcb.wal
-rw-r--r-- 1 root root 9442048 2月 14 22:42 hardlink.tcb
-rw-r--r-- 1 root root 276 2月 14 22:42 hardlink.tcb.wal
-rw-r--r-- 1 root root 9598587 2月 14 22:42 metadata.tcb
-rw-r--r-- 1 root root 276 2月 14 22:42 metadata.tcb.wal
-rw-r--r-- 1 root root 9437580 2月 14 22:42 symlink.tch
-rw-r--r-- 1 root root 276 2月 14 22:42 symlink.tch.wal
実際にlessfsに使用されるファイルシステムは/dataのコンテナ?に入るので,例:/mntにマウントしたlessfsで扱えるボリューム容量は/dataのボリュームに依存する。なので,/dataに適当なボリュームをマウントすればいい。
最終的な冗長性やジャーナリングは/dataのボリュームろファイルシステムに依存するので,元をraid1にするなりすればおk(lessfs自体の仕様が依存するわけではない)。
# df -h
/dev/vda2 29G 6.6G 22G 24% /data
lessfs 29G 6.6G 22G 24% /mnt
格納状態が/dataから見るとただの可変サイズのファイルなので,理論上は,既存ボリューム上にlessfsのコンテナ?を作り,例/data/datastore1から/mnt/datastore1に移動すれば,fuse lessfsを通過する時に圧縮と重複排除をして同一ボリューム内で元の容量を減らしつつ移動できるはず(未確認)。
・例:(/mnt)/.lessfs
:/mnt/.lessfs # l
total 2
drwxr-xr-x 4 root root 4096 2月 14 21:30 ./
drwxr-xr-x 6 root root 4096 2月 14 22:14 ../
-rwxr-xr-x 1 root root 86288 2月 14 21:30 lessfs_stats*
drwxr-xr-x 2 root root 4096 2月 14 21:30 locks/
drwxr-xr-x 2 root root 4096 2月 14 21:30 replication/
lessfs_statsはcatすると,
INODE SIZE COMPRESSED_SIZE RATIO FILENAME
10 0 0 0.00 lessfs_stats
14 0 0 0.00 enabled
15 0 0 0.00 backlog
16 0 0 0.00 sequence
17 0 0 0.00 rotate_replog
のような物がでていて,実際にファイルが入っていると圧縮率が表示される。