mount zfs drive into container?

xokia

Member
Apr 8, 2023
96
9
8
I created a zfs drive inside proxmox

1682122093284.png

I then created a VM and installed TrueNAS. I then passed the drive through to TrueNAS using
qm set 101 -scsi1 /dev/disk/by-id/ata-ST2000VX007-2AY102
1682129424452.png
Startup TrueNAS and import pool which I called pool0. TrueNAS can use this pool just fine.
1682129146132.png

I can setup SMB server in TrueNAS and connect to it just fine through windows

1682128690983.png

I then add pool0 to mount point in LXC probably should have called the MP in LXC pool0 will fix this later
1682128749783.png

I can access /media, under /media is a dataset called media in the lxc (need to fix /media to /pool0 so less confusing)

1682128946000.png

It is as if these are 2 entirely different directories when I "think" they should be the same. What am I doing wrong here?

I am using TrueNAS because the performance of the SMB server is decent. I tried using SMB server directly in the container and the write speeds sucked. I tried doing all the performance improvements and none of them would fix the super slow write performance.
 

Attachments

  • 1682128602607.png
    1682128602607.png
    106.3 KB · Views: 15
Last edited:
  • Like
Reactions: semanticbeeng
I created a zfs drive inside proxmox

1682122093284.png


I then created a VM and installed TrueNAS. I then passed the drive through to TrueNAS using
qm set 102 -scsi1 /dev/disk/by-id/ata-ST2000VX007-2AY102
Thats bad because PVE will mount it. You can't mount a filesystem in two OSs or you will corrupt the data on it. Either mount it in PVE OR pass it through into a VM.

I now want to also pass that same drive into a LXC by mounting the drive and then using the mount point in the LXC.
Will not work, as you would need to mount it on the PVE host to be able to bind-mount it into a LXC.
I don't know if this is the correct way of going about this. I tried running Samba in the container directly but write performance sucks. Read/write of TrueNAS SMB server is fairly decent.
Thats not how it works. Correct way would be to...
a.) drop the idea of a TrueNAS VM, use the ZFS pool on PVE and install and set up a SMB server directly on PVE using the CLI.
b.) don't mount the disk in PVE. Pass the empty disk through into the TrueNAS VM, let TrueNAS format it with ZFS, let TrueNAS share it using NFS/SMB. Then either use privileged LXCs and mount that SMB/NFS share inside that LXC. Or in case you want to use unprivileged LXC (because more secure) which don't allow to mount SMB/NFS shares inside a LXC, you would need to mount that SMB/NFS share on the PVE host and then use a bind-mount to bring that mountpoint of the SMB/NFS share into the unprivileged LXC.
 
Thats not how it works. Correct way would be to...
a.) drop the idea of a TrueNAS VM, use the ZFS pool on PVE and install and set up a SMB server directly on PVE using the CLI.
b.) don't mount the disk in PVE. Pass the empty disk through into the TrueNAS VM, let TrueNAS format it with ZFS, let TrueNAS share it using NFS/SMB. Then either use privileged LXCs and mount that SMB/NFS share inside that LXC. Or in case you want to use unprivileged LXC (because more secure) which don't allow to mount SMB/NFS shares inside a LXC, you would need to mount that SMB/NFS share on the PVE host and then use a bind-mount to bring that mountpoint of the SMB/NFS share into the unprivileged LXC.
Changed my post on you sorry about that. But your suggestions are still relevant.

a. Did that, SMB server write performance was terrible. Read from samba was great. Write through samba was terrible tried all the performance hacks none improved the problem. Also cmd line mgmt of samba not impossible but much easier in a GUI (not a breaking point just annoyance). The performance is what was killing it for me. I was getting 30MB/s write speeds

b.Tried your first suggestion I think that would cause a lot of unnecessary thrash on the network.
Client makes request to plex for video
plex makes request to samba for video
samba returns video to plex
Plex sends video to client -> Video transmit would also be limited to SMB speeds