How to change the mount point for a ZFS dataset and pool

I created the zfs dataset and mount point to /dbbackup by typing zfs create -o mountpoint=/dbbackup zroot/mysql. But, now I need to mount /dbbackup-prod as our codebase and Python backup script hardcoded those path. Is there any way to change this path? I looked into zfs man page on FreeBSD but I am unable to find change option. Please advice.

The produce is as follows to change the mount point for a ZFS dataset or pool. Run it as the root user on FreeBSD or Solaris Unix:

  1. List zfs
    zfs list
  2. Get the mount point for zroot/mysql:
    zfs get mountpoint zroot/mysql
  3. Now rename /dbbackup to /dbbackup-prod instantly by setting the new mountpoint for zroot/mysql:
    zfs set mountpoint=/dbbackup-prod zroot/mysql
  4. Verify it:
    zfs list
1 Like

I didn’t know we can change mountpoint like that.

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki