You are here: Foswiki>ATLAS Web>ZFS (30 Jul 2007, Sebastian)Edit Attach

ZFS

ZFS is a file system created by Sun Microsystems for Solaris/OpenSolaris in 2005. ZFS combines concepts of filesystem and volume management. The name ZFS originally means 'Zetabyte File System' but now is some kind of pseudo acronym.

ZFS is integrated and operational in Solaris 10 and OpenSolaris in particular all distributions.

ZFS on FUSE

Suns CDDL licence makes porting of ZFS to Linux complicated, but there is an ZFS implementation for the Linux FUSE system:

apt-get install fuse-utils libfuse2 libfuse-dev
   1. http://download.berlios.de/zfs-fuse/zfs-fuse-0.4.0_beta1.tar.bz2
   1. ...
scons
scons install
/etc/init.d/zfs-fuse start

Make sure that fuse module is loaded.

Using ZFS

ZFS is easy! Basicly you just need two commands for managing your filesystem.

zpool

Storage is managed in zpools, in which the filesystems are created and shared in an abstract way. Creation is easy, e.g.
zpool create mypool hda1 hda2
zpool add -f mypool mirror hda3 hda4
creates a pool named mypool of two devices and then adds a mirror of two discs. Devices - or vdevs - can be blockdevices, mirror, raidz(1,2) or files. The -f flag may be used to override warnings of existing filesystems on specified devices. By default checksums are used by zfs to verify data integrity. The zpool scrub command is used to detect and correct errors in the filesystem.
Important commands for examining zpools:
   1. Lists zpools with health and usage overview
zpool list
   1. Health status for pool
zpool status mypool
   1. Device usage
zpool iostat -v mypool

zfs

In a zpool the zfs filesystems are created. Purportedly creating of filesystems in zfs is a quick and easy thing, thus the user is encouraged doing that more often then in traditional filesystems. Filesystems are mounted automatically by ZFS - no need editing fstab etc.
Create filesystems:
zfs create mypool/home
zfs create mypool/home/sebastian
zfs create mypool/test

Set filesystem properties (e.g. checksum, compression, quota, reservation...) and inherit the features recursivly from parent:
zfs set compression=on mypool/home
zfs set quota=100MB mypool/home/sebastian
zfs inherit -r mypool/home

Information:
   1. List of all filesystems
zfs list
   1. List filesystems properties
zfs get all mypool/home/sebastian

ZFS supports snapshots in which the changes of the filesystem are stored - so creating a snapshot initially is fast and wastes no space.
zfs snapshot mypool/home/sebastian@snap1
zfs rollback mypool/home/sebastian@snap1
zfs destroy mypool/home/sebastian@snap1
   1. Clone a certain filesystem:
zfs clone tank/home/sebastian@snap2 mypool/testcopy
Topic revision: r1 - 30 Jul 2007, Sebastian
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback