Skip to content

Instantly share code, notes, and snippets.

@cstroe
Last active April 23, 2024 09:13
Show Gist options
  • Save cstroe/e83681e3510b43e3f618 to your computer and use it in GitHub Desktop.
Save cstroe/e83681e3510b43e3f618 to your computer and use it in GitHub Desktop.
FUSE on Ubuntu

FUSE on Ubuntu

It seems that Fuse is compiled into the Ubuntu kernel by default.

To test you can use sshfs:

sudo apt-get install sshfs
mkdir tmp
sshfs localhost:/tmp ./tmp
ls tmp

To compile a fuse filesystem that doesn't have a package:

sudo apt-get install libfuse-dev

and then follow the build instructions for your filesystem.

FUSEcompress 0.9.x

FUSEcompress implements transparent file compression as a FUSE filesystem.

sudo apt-get install libfuse-dev
svn checkout http://fusecompress.googlecode.com/svn/trunk/ fusecompress-read-only
cd fusecompress-read-only
./autogen
./configure
sudo ./make install

To mount a compressed filesystem, use the fusecompress command:

mkdir fusecompress-storage fusecompress
fusecompress -c gz ./fusecompress-storage ./fusecompress
bash -c 'for i in $(seq 1 100); do echo "this is a test" >> test.txt; done'
cp test.txt fusecompress
ls -la ./fusecompress/test.txt ./fusecompress-storage/test.txt

However, I found that this file system doesn't work with unix pipes:

mkdir -p fuse-test/fusecompress-storage fuse-test/fusecompress
fusecompress fuse-test/fusecompress-storage fuse-test/fusecompress
bash -c 'for i in $(seq 1 100); do echo "this is a test" >> fuse-test/fusecompress/test.txt; done'
ls -la fuse-test/fusecompress-storage/test.txt  fuse-test/fusecompress/test.txt

Notice that the test.txt in fusecompress-storage is not compressed. But this will trigger a compression:

cp fuse-test/fusecompress/test.txt fuse-test/fusecompress/copy.txt
ls -la fuse-test/fusecompress-storage/copy.txt  fuse-test/fusecompress/copy.txt

Maybe the C++ version of FUSEcompress doesn't have this problem? Who knows.

ZFS-FUSE on Ubuntu

sudo apt-get install zfs-fuse

Assuming the disk you want to run ZFS on is /dev/sdb, you can do the following:

WARNING: THIS WILL ERASE /dev/sdb!

zpool create mypool /dev/sdb

Turn on compression:

zpool set compression=on mypool

ZFS encryption is not supported in the Linux version of ZFS. You can work around it by encrypting the volume with LUKS and creating a ZFS pool on top of the encrypted volume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment