Creating a Basic ZFS File System
ZFS administration has been designed with simplicity in mind. Among the goals of the ZFS design is to reduce the number of commands needed to create a usable file system. When you create a new pool, a new ZFS file system is created and mounted automatically.
The following example illustrates how to create a non-redundant storage pool named tank and a ZFS file system name tank in one command. Assume that the whole disk /dev/dsk/c1t0d0 is available for use.
# zpool create tank c1t0d0
Note - This command creates a non-redundant pool. A non-redundant pool configuration is not recommended for production environments even if the single storage object is presented from a hardware RAID array or from a software volume manager. ZFS can only detect errors in these configurations. ZFS can corrects error in pool configurations with redundant data. For more information, about redundant ZFS pool configurations, see Replication Features of a ZFS Storage Pool.
The new ZFS file system, tank, can use as much of the disk space on c1t0d0 as needed, and is automatically mounted at /tank.
# mkfile 100m /tank/foo # df -h /tank Filesystem size used avail capacity Mounted on tank 80G 100M 80G 1% /tank
Within a pool, you will probably want to create additional file systems. File systems provide points of administration that allow you to manage different sets of data within the same pool.
The following example illustrates how to create a file system named fs in the storage pool tank. Assume that the whole disk /dev/dsk/c1t0d0 is available for use.
# zpool create tank mirror c1t0d0 c2t0d0 # zfs create tank/fs
# mkfile 100m /tank/fs/foo # df -h /tank/fs Filesystem size used avail capacity Mounted on tank/fs 80G 100M 80G 1% /tank/fs
In most cases, you will probably want to create and organize a hierarchy of file systems that matches your organizational needs. For more information about creating a hierarchy of ZFS file systems, see Creating a ZFS File System Hierarchy.