https://wiki.archlinux.org/api.php?action=feedcontributions&user=Paddlaren&feedformat=atomArchWiki - User contributions [en]2024-03-29T04:49:57ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=ZFS_on_FUSE&diff=211691ZFS on FUSE2012-07-01T07:21:08Z<p>Paddlaren: /* Quick Setup Guide */</p>
<hr />
<div>[[Category:File systems]]<br />
ZFS on FUSE/Linux is a project bringing the ZFS file system to Linux. Due to incompatible license with GPL it is argued that it cannot exist as a direct kernel module, however, this does not apply for implementation as a FUSE file system.<br />
<br />
Some of the capabilities of version 0.7.0 (as of Feb 2012) are limited compared to original implementation (incomplete list):<br />
<br />
* sharenfs uses different syntax than on Solaris;<br />
* it is possible to create snapshots, however, they have to be cloned to another disk to actually be able to browse the file system (due to missing .zfs special directory).<br />
<br />
==Installation==<br />
<br />
ZFS on FUSE/Linux is available in AUR as "zfs-fuse" (0.7.0 as of Feb 2012). Install manually or with yaourt:<br />
<br />
$ yaourt -S zfs-fuse<br />
<br />
Read the messages after installation and be sure to edit the configuration files as per your needs.<br />
<br />
Further, make sure that fuse module is loaded (as root):<br />
<br />
# modprobe fuse<br />
<br />
Start zfs-fuse daemon:<br />
<br />
# rc.d start zfs-fuse<br />
<br />
You will want to add "fuse" module to MODULES array in /etc/rc.conf and the zfs-fuse to the DAEMONS array to have it started after reboot.<br />
<br />
==Use==<br />
===Quick Setup Guide===<br />
<br />
Search on Google how ZFS works. Be sure, which block device you specify and better backup before continueing!<br />
<br />
Briefly, you will want to create a pool (as root):<br />
<br />
# zpool create mypool /dev/sdb<br />
<br />
This will create a "pool" called "mypool" on physical block device /dev/sdb (on whole disk, not on a single partition). Also, a first dataset (aka zfs file system) with the same name will be created and automatically mounted to /mypool.<br />
<br />
You can create other datasets (file systems) within the pool. The reason for doing so is to be able to set various properties on them, to be able to create snapshots independently, etc.<br />
<br />
# zfs create mypool/my1stdataset <br />
<br />
NB that "mypool" is a reference to an existing pool, not to the mount point (which is /mypool at the moment).<br />
<br />
====Automatically mount pools and datasets on boot====<br />
<br />
Pools and datasets can be mounted during boot by adding them to the arrays in /etc/conf.d/zfs-fuse.<br />
<br />
If you like to have all pools and all datasets mounted you can add a "-a" in the array:<br />
<br />
ZFS_IMPORT=("-a")<br />
<br />
If you like to have all datasets mounted add "-a" in that array as well:<br />
<br />
ZFS_MOUNT=("-a")<br />
<br />
===NFS shares===<br />
ZFS can export datasets (file systems) as NFS without the need to place the directories in /etc/exports.<br />
<br />
The nfs-kernel daemon should be installed and started:<br />
<br />
# pacman -S nfs-utils<br />
# rc.d start nfs-kernel<br />
<br />
Add the nfs-server to DAEMONS array in /etc/rc.conf well before the nfs-fuse.<br />
<br />
The syntax of setting the NFS share is:<br />
<br />
# zfs set sharenfs="host1:option1,option2,option3 host2:option1,...,optionN" dataset_name<br />
# zfs set sharenfs="192.168.1.1/24:ro 192.168.1.3:rw" mypool/my1stdataset<br />
<br />
The exported shares and their options can be listed as follows:<br />
<br />
# cat /var/lib/nfs/etab<br />
<br />
NB:<br />
<br />
* It does not work to use only "zfs set sharenfs=on mypool/my1stdataset" - it is not possible to mount such a share from other computers.<br />
<br />
* Only NFS version 3 seems to be supported for readonly (ro) shares (use "mount servername:/mypool/my1stdataset /mnt -o vers=3,defaults" to force that version)<br />
<br />
* It does not work to use "*" as shortcut for any host name. Use the actual IP address / mask of NFS clients list.<br />
<br />
* Running subsequent 'zfs set sharenfs="10.1.0.3:rw" mypool/my1stdataset' will ''add'' the extra host to the existing exports.<br />
<br />
* To remove existing exports, run "zfs set sharenfs=off mypool/my1stdataset".<br />
<br />
* To enable sharing after reboot, put "zfs share -a" to your /etc/rc.local".<br />
<br />
* It is possible to use also the regular way of exporting NFS shares via /etc/exports, however, do not set it up for the shares, which are exported by zfs directly!</div>Paddlaren