implement workaround for shadowing descendant mountpoints after replication
#325 opened on Jan 13, 2019
Description
I am relatively new to ZFS on Linux (long time BTRFS user), but I am running into a weird bug. I don’t think it is user error, but feel free to tell me I’m wrong.
I’m using Ubuntu 18.04 with ZFS on root, using the standard ZFS packages provided by Ubuntu, and I’m using the instructions from here. I bring this up because some of the datasets created for ZFS on root are a little nonstandard, and that may be effecting this.
What’s happening is that I’m replicating my root dataset (pool) to a local array of hard disks (array) using Syncoid. I’m using the following command:
/usr/local/bin/syncoid -r --quiet --exclude=rpool/docker --exclude=rpool/lxd --exclude=rpool/var/tmp --exclude=rpool/swap --exclude=rpool/var/cache --exclude=rpool/home/michael/Temp rpool array/Root_Backup > /dev/null
If I reboot the system and then go to /mnt/array/Root_Backup (the place where the replicated dataset is supposed to be mounted), I see the full dataset just like I would expect to. However, if I run the above syncoid command, and then go to the mount point, nothing is there.
If I run mount | grep zfs, it looks like the datasets are mounted, as in I get the below:
array/Root_Backup on /mnt/array/Root_Backup type zfs (rw,xattr,noacl)
array/Root_Backup/ROOT on /mnt/array/Root_Backup/ROOT type zfs (rw,xattr,noacl)
array/Root_Backup/ROOT/ubuntu on /mnt/array/Root_Backup/ROOT/ubuntu type zfs (rw,xattr,noacl)
array/Root_Backup/home on /mnt/array/Root_Backup/home type zfs (rw,xattr,noacl)
array/Root_Backup/home/michael on /mnt/array/Root_Backup/home/michael type zfs (rw,xattr,noacl)
array/Root_Backup/home/root on /mnt/array/Root_Backup/home/root type zfs (rw,xattr,noacl)
array/Root_Backup/images on /mnt/array/Root_Backup/images type zfs (rw,xattr,noacl)
array/Root_Backup/images/qemu on /mnt/array/Root_Backup/images/qemu type zfs (rw,xattr,noacl)
array/Root_Backup/srv on /mnt/array/Root_Backup/srv type zfs (rw,xattr,noacl)
array/Root_Backup/var on /mnt/array/Root_Backup/var type zfs (rw,xattr,noacl)
array/Root_Backup/var/cache on /mnt/array/Root_Backup/var/cache type zfs (rw,xattr,noacl)
array/Root_Backup/var/games on /mnt/array/Root_Backup/var/games type zfs (rw,xattr,noacl)
array/Root_Backup/var/log on /mnt/array/Root_Backup/var/log type zfs (rw,xattr,noacl)
array/Root_Backup/var/mail on /mnt/array/Root_Backup/var/mail type zfs (rw,xattr,noacl)
array/Root_Backup/var/nfs on /mnt/array/Root_Backup/var/nfs type zfs (rw,xattr,noacl)
array/Root_Backup/var/spool on /mnt/array/Root_Backup/var/spool type zfs (rw,xattr,noacl)
Which are the datasets that I’m replicating at the points that I think they are supposed to be. Yet, I can’t see them (or cd directly to them). In order to see the datasets, I have to run:
sudo sh -c "zfs list -rH -o name array/Root_Backup | xargs -L 1 zfs mount -o remount"
Then all of the datasets appear as expected. So, it seems like something is happening during syncoid that messes up the remounting process. However, I am at the limits of my debugging skills with ZFS, though I’m happy to test whatever if given directions.
Any thoughts on what might be causing this?
Thanks!