Fix mountpoint after full fs transfer if needed master
authorAlan J. Pippin <ajp@pippins.net>
Fri, 1 Dec 2023 17:24:34 +0000 (10:24 -0700)
committerAlan J. Pippin <ajp@pippins.net>
Fri, 1 Dec 2023 17:24:34 +0000 (10:24 -0700)
Change-Id: Idd9f9ac83e4191e00c883469e6d3a9242e0a6e38

zfs-replicate

index cd38657fbf00f80f3b9d1d809b7ecf2eaa2fe4a8..352c8e14c8ed9390689edbeb0a8bf501f5f4094f 100755 (executable)
@@ -262,6 +262,12 @@ else
     if [ $? != 0 ]; then
       fatal_and_exit "-E- remote full $zfs send $current_backup_marker command failed on $hostname" $mailto
     fi
+    # Make sure the mount point of our backed up filesystem is mounted under the backups pool not the src filesystem
+    mountpoint=`$zfs get -H mountpoint ${backup_pool}/${remote_fs} | awk '{print $3}'`
+    backup_pool_mountpoint=`$zfs get -H mountpoint ${backup_pool} | awk '{print $3}'`
+    if [[ "$mountpoint" != "${backup_pool_mountpoint}/${remote_fs}" ]]; then
+       $zfs set mountpoint="${backup_pool_mountpoint}/${remote_fs}" "${backup_pool}/${remote_fs}"
+    fi
   fi
 fi