Do NOT use fuse with ZFS. If there is the slightest hiccup, the filesystem will crash and you will lose all your data.
Use fdisk
to edit the partition, and then set the type to bf
or Solaris
.
Create a new pool named tank
using zpool
, for example, using /dev/sdb
zpool create tank /dev/sdb
zpool create tank mirror /dev/sdb /dev/sdc
zfs create tank/dataset
zfs create tank/dataset/child
zfs destroy tank/dataset
Useful for upgrading ZFS, moving things around, etc.
zpool export tank zpool import tank
ZFS allows you to create incremental snapshots easily enough, using zfs snapshot
.
Once a snapshot is created, ZFS will start using new space after data is modified.
Create a snapshot:
zfs snapshot tank/data@snapshot-name
List snapshots:
zfs list -t snapshot
Destroy an old snapshot:
zfs destroy tank/data@snapshot-name
You can access data directly from old snapshots by browsing the .zfs
directory in the zfs tree. The directory is hidden by default, and does not need to be toggled as visible to browse. Simply accessing the directory is sufficient.
ls /tank/data/.zfs/snapshot/snapshot-name/
Note: There may be a simpler way to get this using native ZFS tools.
Optionally, the .zfs directory can be toggled as visible so that it will show up using ls
:
zfs set snapdir=visible tank/data ls /tank/data/.zfs/snapshot/snapshot-name/ zfs set snapdir=hidden tank/data
On FreeBSD, once you create a zpool or a dataset, it will automatically mount it. It will also mount it at boot.
Add this line to /etc/rc.conf
:
zfs_enable="YES"