Become root or assume an equivalent role with the appropriate ZFS rights
profile.
For more information about the ZFS rights profiles, see 8.4 ZFS Rights Profiles.
Create desired hierarchy.
In this example, we create a filesystem
that will act as a container for individual file systems:
Now we can group our individual filesystems under the home file
system in our pool tank
Set inherited properties.
Now that we have established a filesystem
hierarchy, we want to set up any properties that should be shared among all users:
# zfs set mountpoint=/export/zfs tank/home
# zfs set sharenfs=on tank/home
# zfs set compression=on tank/home
|
For more
information on properties and property inheritance, see 5.2 ZFS Properties.
Create individual filesystems.
Now we can create our individual
user filesystems. Note that we could have also created the filesystems first and then
changed properties at the home level. All properties can be changed
dynamically while filesystems are in use.
# zfs create tank/home/bonwick
# zfs create tank/home/billm
|
These filesystems inherit their property settings from their parent, so they
be automatically mounted at /export/zfs/user and
shared via NFS. There is no need to edit the /etc/vfstab or /etc/dfs/dfstab file.
For more information on creating filesystems,
see 5.1.1 Creating a Filesystem.
For more information
on mounting and sharing filesystems, see 5.5 Mounting and Sharing File Systems.
Set filesystem-specific properties.
As mentioned in the previous
task, we want to give bonwick a quota of 10 Gbytes. This places
a limit on the amount of space he can consume, regardless of how much space is available
in the pool:
# zfs set quota=10G tank/home/bonwick
|
View the results.
Display available filesystem information
with the zfs list command:
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
tank 92.0K 67.0G 9.5K /tank
tank/home 24.0K 67.0G 8K /export/zfs
tank/home/billm 8K 67.0G 8K /export/zfs/billm
tank/home/bonwick 8K 10.0G 8K /export/zfs/bonwick
|
Note that bonwick only has 10 Gbytes of space available,
while billm can use the full pool (67 Gbytes).
For
more information on getting filesystem status, see 5.3 Querying Filesystem Information.
For more information on how space is
used and calculated, see 3.2 Space Accounting.