LXC antlet access to external zpool and dataset on USB HD via mount --bind

3 replies
nadigo
5 posts

Based on the below, you can bind a ZFS dataset to an LXC antlet.

I added an external HD with a 'backup' zpool and 2 datasets (backup/Images, backup/Data) and I would like to have a permanent bind of these datasets to the antlet. The below seems to work but breaks from time to time after a reboot and I need to re-bind them, any advice?

mount --bind /backup/Data /antlets/NAS/backup/Data 

mount --bind /backup/Images /antlets/NAS/backup/Images 

Thanks

https://docs.antsle.com/system/access-your-hdd-or-ssd-add-on

daniel.luckStaff
551 posts

Hi nadigo:

Can you let us know if the external zpool is still mounted after reboot?

Or is it just the bind that needs to be executed again?

nadigo
5 postsedited

After reboot, both the pool and zfs datasets for the external USB drives are mounted fine.

The bind mount didn't execute after reboot even after I added it to Antman fstab  (see below)

root@nadigo:~ # cat /etc/fstab 

#

# /etc/fstab

# Created by anaconda on Thu Jun 17 10:04:31 2021

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

UUID=b40f8224-f5df-4cb4-9bcc-4406d9c04865 /                       xfs     defaults        0 0

UUID=8047b59f-131d-4cd2-b5ab-9969c0e635c7 /boot                   xfs     defaults        0 0

/swapfile none swap sw 0 0

#

#

#/backup/Images /antlets/NAS/backup/Images none rw,bind 0 0

#/backup/Data /antlets/NAS/backup/Data none rw,bind 0 0

#/media/Music /antlets/NAS/media/Music none rw,bind 0 0

#/media/Movies /antlets/NAS/media/Movies none rw,bind 0 0

From what I read, there used to be a bug in systemd when auto moving fstab binds mounts to systemd.

Added this to my systemd to see if this resolves the issue

** learned I need to keep the file name based on the directory structure (antlets-NAS-backup-Images.mount)

root@nadigo:systemd/system # cat antlets-NAS-backup-Images.mount

[Unit]

Description= nas bind

#Requires=

After=antman.service

[Mount]

What=/backup/Images

Where=/antlets/NAS/backup/Images

Options=bind

Type=none

[Install]

WantedBy=multi-user.target

daniel.luckStaff
551 posts

Hi nadigo:

That's a great idea using systemd.

I was going to recommend using scheduling a crontab to execute the command, but systemd may be a better way to go.

Log in to reply. New here? It takes a minute.