Have a new pct created with the gui:
Have a nested subvol mounted on the rootfs:
It's mounted, the host can read it:
When I start the container, it's not visible:
However, if I mount the fs when the container is running, it works fine.
I'm trying to make sure the subvol is mounted before startup because the media server will empty the database if all the media is missing.
This is a problem if it autostarts from boot.
I was trying to write a hook script that made sure it was mounted on boot or aborts when the key is not present.
I'm using:
This is very repeatable behaviour. I can start and shutdown but always have this problem.
It looks like a bug to me. Am I mistaken, or should I file a bug report?
What workaround can I try?
INI:
arch: amd64
cores: 1
hostname: testct
memory: 2048
nameserver: 192.168.1.1
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:C6:DA:75,link_down=1,type=veth
ostype: debian
rootfs: zfs16Tr10:subvol-112-disk-0,replicate=0,size=12G
searchdomain: jammed-with-love.com
swap: 2048
unprivileged: 1
Have a nested subvol mounted on the rootfs:
Code:
# zfs create \
-o aclinherit=discard \
-o canmount=noauto \
-o devices=off \
-o compression=on \
-o dnodesize=auto \
-o encryption=on \
-o keyformat=passphrase \
-o keylocation='file:///root/zfs10-pool-subvol-112-disk-1-storage.password' \
-o mountpoint='/zfs10-pool/subvol-112-disk-0/srv/nested/storage' \
'zfs10-pool/subvol-112-disk-0/subvol-112-disk-1'
It's mounted, the host can read it:
Code:
# zfs mount -l zfs10-pool/subvol-112-disk-0/subvol-112-disk-1
# zfs list -Ho mounted "zfs10-pool/subvol-112-disk-0/subvol-112-disk-1"
yes
# ls /zfs10-pool/subvol-112-disk-0/srv/nested/storage
test1 test2 test3 test4
When I start the container, it's not visible:
Code:
# pct start 112
# pct enter 112
root@testct:/# df
Filesystem 1K-blocks Used Available Use% Mounted on
zfs10-pool/subvol-112-disk-0 12582912 352000 12230912 3% /
none 492 4 488 1% /dev
udev 53297284 0 53297284 0% /dev/tty
tmpfs 65913848 0 65913848 0% /dev/shm
tmpfs 26365540 44 26365496 1% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 1024 0 1024 0% /run/credentials/systemd-sysctl.service
tmpfs 1024 0 1024 0% /run/credentials/systemd-sysusers.service
tmpfs 1024 0 1024 0% /run/credentials/systemd-tmpfiles-setup-dev.service
tmpfs 1024 0 1024 0% /run/credentials/systemd-tmpfiles-setup.service
root@testct:/# ls -l /srv/nested/storage/
total 0
However, if I mount the fs when the container is running, it works fine.
Code:
# pct start 112
# zfs mount -l zfs10-pool/subvol-112-disk-0/subvol-112-disk-1
# zfs list -Ho mounted "zfs10-pool/subvol-112-disk-0/subvol-112-disk-1"
yes
# ls /zfs10-pool/subvol-112-disk-0/srv/nested/storage
test1 test2 test3 test4
# pct enter 112
root@testct:/# df
Filesystem 1K-blocks Used Available Use% Mounted on
zfs10-pool/subvol-112-disk-0 12582912 352000 12230912 3% /
none 492 4 488 1% /dev
udev 53297284 0 53297284 0% /dev/tty
tmpfs 65913848 0 65913848 0% /dev/shm
tmpfs 26365540 44 26365496 1% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 1024 0 1024 0% /run/credentials/systemd-sysctl.service
tmpfs 1024 0 1024 0% /run/credentials/systemd-sysusers.service
tmpfs 1024 0 1024 0% /run/credentials/systemd-tmpfiles-setup-dev.service
tmpfs 1024 0 1024 0% /run/credentials/systemd-tmpfiles-setup.service
zfs10-pool/subvol-112-disk-0/subvol-112-disk-1 24040025728 384 24040025344 1% /srv/nested/storage
root@testct:/# ls -l /srv/nested/storage/
total 36
drwxr-xr-x 2 root root 3 Apr 8 03:30 test1
drwxr-xr-x 2 root root 3 Apr 8 03:30 test2
drwxr-xr-x 2 root root 3 Apr 8 03:31 test3
drwxr-xr-x 2 root root 3 Apr 8 03:31 test4
I'm trying to make sure the subvol is mounted before startup because the media server will empty the database if all the media is missing.
This is a problem if it autostarts from boot.
I was trying to write a hook script that made sure it was mounted on boot or aborts when the key is not present.
I'm using:
Code:
# zfs --version
zfs-2.2.7-pve2
zfs-kmod-2.2.7-pve2
# pveversion
pve-manager/8.3.5/dac3aa88bac3f300 (running kernel: 6.8.12-9-pve)
kernel
proxmox-kernel-6.8.12-9-pve-signed 6.8.12-9 amd64 Proxmox Kernel Image (signed)
It looks like a bug to me. Am I mistaken, or should I file a bug report?
What workaround can I try?