How to Rename a ZFS File System

File systems can be renamed by using the zfs rename command. With the rename subcommand, you can perform the following operations:

  • Change the name of a file system.

  • Relocate the file system within the ZFS hierarchy.

    The new location must be within the same pool and must have enough disk space to accommodate the new file system.

    Note:

    Quota limits might become a contributing factor to insufficient disk space. See Setting ZFS Quotas.
  • Change the name of a file system and relocate it within the ZFS hierarchy.

The rename operation attempts an unmount/remount sequence for the file system and any descendent file systems. The rename command fails if the operation is unable to unmount an active file system. If this problem occurs, you must forcibly unmount the file system.

  1. Assume the root role or an equivalent role with the appropriate ZFS rights profile.
  2. Rename the ZFS file system.

    For example, to change the name of the file system only, you would type:

    $ zfs rename tank/home/soloh tank/home/mindy_old
    

    To relocate a file system, you would type:

    $ zfs rename tank/home/mork tank/ws/mork