JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Administration: ZFS File Systems     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Oracle Solaris ZFS File System (Introduction)

2.  Getting Started With Oracle Solaris ZFS

ZFS Rights Profiles

ZFS Hardware and Software Requirements and Recommendations

Creating a Basic ZFS File System

Creating a Basic ZFS Storage Pool

How to Identify Storage Requirements for Your ZFS Storage Pool

How to Create a ZFS Storage Pool

Creating a ZFS File System Hierarchy

How to Determine Your ZFS File System Hierarchy

How to Create ZFS File Systems

3.  Managing Oracle Solaris ZFS Storage Pools

4.  Managing ZFS Root Pool Components

5.  Managing Oracle Solaris ZFS File Systems

6.  Working With Oracle Solaris ZFS Snapshots and Clones

7.  Using ACLs and Attributes to Protect Oracle Solaris ZFS Files

8.  Oracle Solaris ZFS Delegated Administration

9.  Oracle Solaris ZFS Advanced Topics

10.  Oracle Solaris ZFS Troubleshooting and Pool Recovery

11.  Archiving Snapshots and Root Pool Recovery

12.  Recommended Oracle Solaris ZFS Practices

A.  Oracle Solaris ZFS Version Descriptions

Index

Creating a ZFS File System Hierarchy

After creating a storage pool to store your data, you can create your file system hierarchy. Hierarchies are simple yet powerful mechanisms for organizing information. They are also very familiar to anyone who has used a file system.

ZFS allows file systems to be organized into hierarchies, where each file system has only a single parent. The root of the hierarchy is always the pool name. ZFS leverages this hierarchy by supporting property inheritance so that common properties can be set quickly and easily on entire trees of file systems.

How to Determine Your ZFS File System Hierarchy

  1. Pick the file system granularity.

    ZFS file systems are the central point of administration. They are lightweight and can be created easily. A good model to use is to establish one file system per user or project, as this model allows properties, snapshots, and backups to be controlled on a per-user or per-project basis.

    Two ZFS file systems, jeff and bill, are created in How to Create ZFS File Systems.

    For more information about managing file systems, see Chapter 5, Managing Oracle Solaris ZFS File Systems.

  2. Group similar file systems.

    ZFS allows file systems to be organized into hierarchies so that similar file systems can be grouped. This model provides a central point of administration for controlling properties and administering file systems. Similar file systems should be created under a common name.

    In the example in How to Create ZFS File Systems, the two file systems are placed under a file system named home.

  3. Choose the file system properties.

    Most file system characteristics are controlled by properties. These properties control a variety of behaviors, including where the file systems are mounted, how they are shared, if they use compression, and if any quotas are in effect.

    In the example in How to Create ZFS File Systems, all home directories are mounted at /export/zfs/user, are shared by using NFS, and have compression enabled. In addition, a quota of 10 GB on user jeff is enforced.

    For more information about properties, see Introducing ZFS Properties.

How to Create ZFS File Systems

  1. Become root or assume an equivalent role with the appropriate ZFS rights profile.

    For more information about the ZFS rights profiles, see ZFS Rights Profiles.

  2. Create the desired hierarchy.

    In this example, a file system that acts as a container for individual file systems is created.

    # zfs create tank/home
  3. Set the inherited properties.

    After the file system hierarchy is established, set up any properties to be shared among all users:

    # zfs set mountpoint=/export/zfs tank/home
    # zfs set share.nfs=on tank/home
    # zfs set compression=on tank/home
    # zfs get compression tank/home
    NAME             PROPERTY       VALUE                      SOURCE
    tank/home        compression    on                         local

    You can set file system properties when the file system is created. For example:

    # zfs create -o mountpoint=/export/zfs -o share.nfs=on -o compression=on tank/home

    For more information about properties and property inheritance, see Introducing ZFS Properties.

    Next, individual file systems are grouped under the home file system in the pool tank.

  4. Create the individual file systems.

    File systems could have been created and then the properties could have been changed at the home level. All properties can be changed dynamically while file systems are in use.

    # zfs create tank/home/jeff
    # zfs create tank/home/bill

    These file systems inherit their property values from their parent, so they are automatically mounted at /export/zfs/user and are NFS shared. You do not need to edit the /etc/vfstab or /etc/dfs/dfstab file.

    For more information about creating file systems, see Creating a ZFS File System.

    For more information about mounting and sharing file systems, see Mounting ZFS File Systems.

  5. Set the file system-specific properties.

    In this example, user jeff is assigned a quota of 10 GBs. This property 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/jeff
  6. View the results.

    View available file system information by using 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/bill           8K  67.0G     8K  /export/zfs/bill
    tank/home/jeff           8K  10.0G     8K  /export/zfs/jeff

    Note that user jeff only has 10 GB of space available, while user bill can use the full pool (67 GB).

    For more information about viewing file system status, see Querying ZFS File System Information.

    For more information about how disk space is used and calculated, see ZFS Disk Space Accounting.