5

When I asked about filesystems with compression I got recommendation to try ZFS. Looks like it worth trying, however I find tools that manage ZFS (zfs, zpool) quite overcomplexified - you need to create some volume, then add it, then create filesystem on it. And finally it suddenly created things in root directory like /qqq/test and it uses /var/run/zfs/zfs_socket (strange for a filesystem).

How to use ZFS (with FUSE) without it's complicated things with volumes, just as good filesystem with compression, something like mount -o loop image.zfs /mnt/qqq -t zfs-fuse?

How to setup ZFS as non-root? FUSE usually means "user can use it too" (example: ntfs-3g). I expect something like this:

$ dd if=/dev/zero of=/home/user/qqq.zfs bs=1M count=100
$ mkfs.zfs /home/user/qqq.zfs -o compress=gzip
$ zfs-fuse /home/user/qqq.zfs /home/user/mnt

Can ZFS be more usual FUSE filesystem that I can add to /etc/fstab and user can install and use on its own?

Vi.
  • 16,755
  • 32
  • 111
  • 189

1 Answers1

4

Here is something close to what you are looking for, although you would need to be root to achieve it:

$ dd if=/dev/zero of=/home/user/qqq.zfs bs=1M count=100
# zpool create -O compression=gzip -m /home/user/mnt qqq /home/user/qqq.zfs
# chown user /home/user/mnt

ZFS supports non root operations (i.e. delegation) but ZFS-FUSE doesn't implement them.

jlliagre
  • 13,899
  • 4
  • 31
  • 48
  • OK, then question 2: Suppose some system have working FUSE (e.g. sshfs works), but zpool/zfs/zfs-fuse is not installed at all. How to install ZFS manually and create/mount ZFS as user? I expect it to use /home/user/var/run/zfs, not /var/run/zfs in this case. – Vi. Sep 04 '11 at 16:11
  • There is probably no documented way to install ZFS manually as a user on Linux. Given the security implications, I even strongly doubt it to be doable at all. – jlliagre Sep 04 '11 at 20:58
  • security? What's wrong if user creates certain big file in his home directory and uses certain FUSE program to mount it to directory (without affecting other users). Security should just like in `mkisofs ... -o qqq.iso ; fuseiso qqq.iso $HOME/mnt/myiso`. – Vi. Sep 05 '11 at 07:04
  • 1
    ZFS, being also an NFS and CIFS service and implementing POSIX ACL, set-uid bits, allowing setting arbitrary and persistent mount points and the likes cannot be implemented/mounted as is by a non root user without compromising the host security. What you are looking for would require to develop a stripped down version of ZFS and this hasn't been done. – jlliagre Sep 05 '11 at 12:24
  • It's a pity the ZFS-FUSE project did not yet take advantage of the ability of FUSE to run as a non-root user. I guess that would be extra work above the basic porting. If you control the box, you could set up a 'sudo' command to do what jlliagre suggested – Sam Watkins Aug 06 '12 at 08:19
  • This "file mapping" approach is expected to have lower performance compared to "native zfs-formatted partition", right? – Anatoly Alekseev Feb 22 '23 at 04:05
  • 1
    @AnatolyAlekseev It is expected indeed, given the extra file-system layer. – jlliagre Feb 22 '23 at 08:59