Unable to view files after replication

I'm backing up my FreeBSD root on zfs dataset 'zroot' to USB 'backup' on the same system using the syncoid replication tool from sanoid. I ran syncoid with sudo even though it wasn't required to rule out permissions as a factor but the results are the same without sudo. Afterward, I can't view the files under /backup/zroot/ until I reboot or unmount/mount backup or export/import backup. I don't believe this is the expected behavior, does anyone know why this is happening and how to resolve?
Code:
FreeBSD 14.2-RELEASE (GENERIC) releng/14.2-n269506-c8918d6c7412
joe@mini:/$ zfs -V
zfs-2.2.6-FreeBSD_g33174af15
zfs-kmod-2.2.6-FreeBSD_g33174af15
joe@mini:/$ syncoid -V
/usr/local/bin/syncoid version 2.2.0
joe@mini:/$ ls /backup/zroot
ROOT  home  tmp  usr  var
joe@mini:/$ sudo syncoid --delete-target-snapshots -r zroot backup/zroot
Sending incremental zroot@syncoid_mini_2024-12-07:09:12:24-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:14-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [74.8KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/ROOT@syncoid_mini_2024-12-07:09:12:25-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:14-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [57.6KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/ROOT/default@syncoid_mini_2024-12-07:09:12:25-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:15-GMT-06:00 (~ 14.0 MB):
13.6MiB 0:00:00 [19.5MiB/s] [==============================================================================================================>    ]  97%
Sending incremental zroot/home@syncoid_mini_2024-12-07:09:12:26-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:22-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [75.1KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/home/joe@syncoid_mini_2024-12-07:09:12:27-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:22-GMT-06:00 (~ 289 KB):
 280KiB 0:00:00 [ 698KiB/s] [=============================================================================================================>     ]  96%
Sending incremental zroot/home/kodi@syncoid_mini_2024-12-07:09:12:28-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:23-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [73.0KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/tmp@syncoid_mini_2024-12-07:09:12:28-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:24-GMT-06:00 (~ 85 KB):
92.5KiB 0:00:00 [ 200KiB/s] [===================================================================================================================] 108%
Sending incremental zroot/usr@syncoid_mini_2024-12-07:09:12:29-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:24-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [56.4KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/usr/ports@syncoid_mini_2024-12-07:09:12:29-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:25-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [68.6KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/usr/src@syncoid_mini_2024-12-07:09:12:30-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:26-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [74.1KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/var@syncoid_mini_2024-12-07:09:12:30-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:26-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [55.7KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/var/audit@syncoid_mini_2024-12-07:09:12:30-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:27-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [68.1KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/var/crash@syncoid_mini_2024-12-07:09:12:31-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:28-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [69.7KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/var/log@syncoid_mini_2024-12-07:09:12:31-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:28-GMT-06:00 (~ 682 KB):
 685KiB 0:00:01 [ 588KiB/s] [==================================================================================================================>] 100%
Sending incremental zroot/var/mail@syncoid_mini_2024-12-07:09:12:32-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:30-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [71.4KiB/s] [===========================================================>                                                       ]  53%
Sending incremental zroot/var/tmp@syncoid_mini_2024-12-07:09:12:32-GMT-06:00 ... syncoid_mini_2024-12-07:09:15:30-GMT-06:00 (~ 4 KB):
2.13KiB 0:00:00 [88.8KiB/s] [===========================================================>                                                       ]  53%
joe@mini:/$ zfs list -o name,mounted,mountpoint | grep backup
backup                     yes      /backup
backup/zroot               yes      /backup/zroot
backup/zroot/ROOT          yes      /backup/zroot/ROOT
backup/zroot/ROOT/default  yes      /backup/zroot/ROOT/default
backup/zroot/home          yes      /backup/zroot/home
backup/zroot/home/joe      yes      /backup/zroot/home/joe
backup/zroot/home/kodi     yes      /backup/zroot/home/kodi
backup/zroot/tmp           yes      /backup/zroot/tmp
backup/zroot/usr           yes      /backup/zroot/usr
backup/zroot/usr/ports     yes      /backup/zroot/usr/ports
backup/zroot/usr/src       yes      /backup/zroot/usr/src
backup/zroot/var           yes      /backup/zroot/var
backup/zroot/var/audit     yes      /backup/zroot/var/audit
backup/zroot/var/crash     yes      /backup/zroot/var/crash
backup/zroot/var/log       yes      /backup/zroot/var/log
backup/zroot/var/mail      yes      /backup/zroot/var/mail
backup/zroot/var/tmp       yes      /backup/zroot/var/tmp
joe@mini:/$ ls /backup/zroot
joe@mini:/$ sudo zpool export -f backup
joe@mini:/$ sudo zpool import backup
joe@mini:/$ ls /backup/zroot
ROOT  home  tmp  usr  var
 
I don't know what your use case is, but usually you never mount on the backup side.
If you do and start adding stuff in the backup directory, you will have issue later on to receive the new snapshot (except if you force it, but then this is not really a good idea).
To see the content of your backup you ever go in the hidden .zfs directory, or clone a specific snapshot and then use that clone for recovery purpose.
 
I don't add or modify the backup and I agree with you on that. I initially wanted to browse the files to make sure the backup was successful and that I could grab the files in case the need arose in the future. If I had to mount the backup to do so that would make sense but what threw me off is that rebooting would allow me to browse the files. Upon further investigation I noticed that after replication finished zfs would show the backup was mounted but I couldn't view the files without unmounting or exporting, then mounting/importing. That seems like an issue to me.
 
Hi freejlr
Code:
ls -al /backup/zroot/ROOT/default
total 143K
drwxr-xr-x 24 root wheel   29 12/08/24 08:35:38 AM ./
drwxr-xr-x  3 root wheel    3 12/09/24 08:38:37 PM ../
drwxr-xr-x  2 root wheel    2 12/07/24 09:16:14 AM backup/
drwxr-xr-x  2 root wheel   49 12/03/24 12:43:59 PM bin/
drwxr-xr-x 15 root wheel   71 12/03/24 02:46:17 PM boot/
drwxr-xr-x  2 root wheel    2 11/25/24 03:48:56 PM dev/
drwxr-xr-x 30 root wheel  114 12/03/24 12:44:49 PM etc/
drwxr-xr-x  2 root wheel    2 11/25/24 10:22:30 PM files/
drwxr-xr-x  2 root wheel    2 11/25/24 03:48:56 PM home/
drwxr-xr-x  4 root wheel   78 12/03/24 12:44:00 PM lib/
drwxr-xr-x  3 root wheel    5 12/03/24 12:43:55 PM libexec/
drwxr-xr-x  3 root wheel    3 12/03/24 02:37:23 PM media/
drwxr-xr-x  3 root wheel    3 11/25/24 03:53:10 PM mnt/
drwxr-xr-x  2 root wheel    2 05/31/24 03:32:55 AM net/
dr-xr-xr-x  2 root wheel    2 05/31/24 03:32:55 AM proc/
drwxr-xr-x  2 root wheel  150 12/03/24 12:44:00 PM rescue/
drwxr-x---  4 root wheel   11 12/05/24 11:10:09 PM root/
drwxr-xr-x  2 root wheel  150 12/03/24 12:44:01 PM sbin/
drwxr-xr-x  2 root wheel    2 12/08/24 08:35:38 AM tmp/
drwxrwxr-x  2 joe  kodi     2 11/26/24 12:34:59 PM torrents/
drwxr-xr-x 15 root wheel   15 05/31/24 05:08:06 AM usr/
drwxr-xr-x 26 root wheel   26 12/08/24 08:35:38 AM var/
drwxrwxr-x  7 joe  joe      7 11/25/24 10:29:50 PM vm/
drwxr-xr-x  2 root wheel    2 11/25/24 03:48:56 PM zroot/
-rw-r--r--  2 root wheel 1011 05/31/24 04:00:24 AM .cshrc
-rw-r--r--  2 root wheel  495 05/31/24 04:00:06 AM .profile
-r--r--r--  1 root wheel 6.0K 05/31/24 04:39:59 AM COPYRIGHT
-rw-------  1 root wheel 4.0K 12/08/24 08:35:38 AM entropy
lrwxr-xr-x  1 root wheel   11 05/31/24 03:32:57 AM sys -> usr/src/sys
 
Back
Top