SFTP Plugin and ZFS

    • OMV 4.x
    • SFTP Plugin and ZFS

      So I have been banging my head on this for a while. Basically I have moved my entire 20TB ext4 pool to a backup server and then started the process of moving everything into a new 20TB ZFS Pool. Crazy thing is that after hours and hours of trying to figure out why 2 of my ZFS datasets disappear I uninstalled SFTP. Once I restarted the ZFS unmounted and mounted as normal. Apparently SFTP does something using tmpfs and it conflicts with the mounts that ZFS uses. Aside from just uninstalling the SFTP plugin are there any ideas on how to get this working or any alternatives. If alternatives are suggested they must be encrypted links.

      Thank You, ALL!
    • takiyon wrote:

      Apparently SFTP does something using tmpfs and it conflicts with the mounts that ZFS uses.
      Nope. It bind mounts (no tmpfs) to paths in order to limit access for users but that shouldn't affect zfs. I would run a second sftp server in a docker. There are a lot of them on docker hub.
      omv 5.0.14 usul | 64 bit | 5.0 proxmox kernel | omvextrasorg 5.1.5
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • if SFTP binds mounts then that makes sense. Here is what happens...

      Source Code

      1. zfs list
      2. NAME USED AVAIL REFER MOUNTPOINT
      3. StorPoolMmbr01 12.5T 2.79T 363K /StorPoolMmbr01
      4. StorPoolMmbr01/ApplicationServerFS 465G 2.79T 465G /StorPoolMmbr01/ApplicationServerFS
      5. StorPoolMmbr01/BackupDataFS 672G 2.79T 672G /StorPoolMmbr01/BackupDataFS
      6. StorPoolMmbr01/DownloadsFS 192G 2.79T 192G /StorPoolMmbr01/DownloadsFS
      7. StorPoolMmbr01/MediaAlbumsFS 386G 2.79T 386G /StorPoolMmbr01/MediaAlbumsFS
      8. StorPoolMmbr01/MediaCollectionFS 9.56T 2.79T 9.56T /StorPoolMmbr01/MediaCollectionFS
      9. StorPoolMmbr01/SoftwareFS 1.04T 2.79T 1.04T /StorPoolMmbr01/SoftwareFS
      10. StorPoolMmbr01/UserDataFS 197G 2.79T 197G /StorPoolMmbr01/UserDataFS


      I broke up everything into different datasets

      when I see the root file system this is what I see...

      Source Code

      1. rwxr-xr-x 4 root root 4096 Sep 30 21:11 sftp
      2. drwxr-xr-x 24 root root 4096 Oct 1 08:06 sharedfolders
      3. drwxr-xr-x 4 root root 4096 Oct 1 07:12 srv
      4. drwxr-xr-x 9 root root 9 Sep 28 08:01 StorPoolMmbr01
      5. dr-xr-xr-x 13 root root 0 Oct 1 12:49 sys
      6. drwxrwxrwt 9 root root 180 Oct 1 14:50 tmp
      7. drwxr-xr-x 11 root root 4096 Apr 4 2018 usr
      8. drwxr-xr-x 13 root root 4096 Jun 19 2018 var
      9. lrwxrwxrwx 1 root root 27 Sep 23 07:36 vmlinuz -> boot/vmlinuz-4.15.18-20-pve
      10. lrwxrwxrwx 1 root root 27 Sep 23 07:36 vmlinuz.old -> boot/vmlinuz-4.15.18-20-pve
      11. -rw-r--r-- 1 root root 932 Oct 1 08:36 webmin-setup.out
      Display All
      As you can see StorPoolMmbr01 is the mount point of my ZFS pool.

      These are the folders under StorPoolMmbr01.

      Source Code

      1. drwxr-xr-x 4 root root 4 Sep 28 01:49 ApplicationServerFS
      2. drwxr-xr-x 7 root root 7 Sep 28 02:10 BackupDataFS
      3. drwxr-xr-x 5 root root 5 Sep 30 08:47 DownloadsFS
      4. drwxr-xr-x 4 root root 4 Sep 28 02:18 MediaAlbumsFS
      5. drwxr-xr-x 10 root root 10 Sep 28 02:19 MediaCollectionFS
      6. drwxr-xr-x 3 root root 3 Sep 28 02:19 SoftwareFS
      7. drwxr-xr-x 5 root root 5 Oct 1 08:06 UserDataFS
      The problem is that when the machine is restarted the folders underneath UserDataFS and MediaCollectionFS are never empty on startup. When ZFS tries to mount the volume and all the datasets it fails on those two. I think this is because SFTP somehow puts folders under those that I have to delete. If those folders are left there bound then that makes sense, and would cause ZFS to fail to mount UserDataFS and MediaCollectionFS on startup. How would I know if SFTP is cleaning up during system shutdown? Perhaps there is something I can do to try and workaround. I don't want to start complicating things by using docker containers.

      The post was edited 1 time, last by takiyon: grammatical errors ().

    • takiyon wrote:

      How would I know if SFTP is cleaning up during system shutdown?
      The plugin creates bind mounts in /etc/fstab. systemd *should* do the right thing.


      takiyon wrote:

      I don't want to start complicating things by using docker containers.
      How does that complicate things? You create an sftp docker on a port with one folder shared with the container. It achieves the separation very well. I use sftp and will probably switch to docker soon.
      omv 5.0.14 usul | 64 bit | 5.0 proxmox kernel | omvextrasorg 5.1.5
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      takiyon wrote:

      How would I know if SFTP is cleaning up during system shutdown?
      The plugin creates bind mounts in /etc/fstab. systemd *should* do the right thing.

      takiyon wrote:

      I don't want to start complicating things by using docker containers.
      How does that complicate things? You create an sftp docker on a port with one folder shared with the container. It achieves the separation very well. I use sftp and will probably switch to docker soon.
      You are correct. It SFTP created two entries in the fstab that point to the folders on the ZFS mount. Somehow ZFS does not like it because it will not mount folders on restart that SFTP put in the fstab. I will probably move over to docker I am just not very familiar with how docker works and when I have tried to use it in the past it was just a pain. I get the concept of containers but updating them was a PITA in the past.
    • takiyon wrote:

      updating them was a PITA in the past.
      Look up watchtower

      takiyon wrote:

      Also which docker image do you use for SFTP? I don't see it in the list.
      I haven't switched. What list are you looking at? I see no shortage of images here - hub.docker.com/search?q=sftp&type=image
      omv 5.0.14 usul | 64 bit | 5.0 proxmox kernel | omvextrasorg 5.1.5
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • takiyon wrote:

      I am just using the docker images repo tab in the OMV ui.
      I would use that after you find a good image at hub.docker.com
      omv 5.0.14 usul | 64 bit | 5.0 proxmox kernel | omvextrasorg 5.1.5
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      takiyon wrote:

      updating them was a PITA in the past.
      Look up watchtower

      takiyon wrote:

      Also which docker image do you use for SFTP? I don't see it in the list.
      I haven't switched. What list are you looking at? I see no shortage of images here - hub.docker.com/search?q=sftp&type=image
      do you know if those docker images offer the same features? i.e:
      -access to different shares for different users
      -easy to define (web UI?) users/shares ?

      Thank you
    • moreje wrote:

      do you know if those docker images offer the same features? i.e:
      -access to different shares for different users
      -easy to define (web UI?) users/shares ?
      Didn't try it, huh? I would imagine that some of the images can give different users access to different shares. The web ui would be OMV and portainer. I still haven't switched to using a container although I'm not using the plugin either.
      omv 5.0.14 usul | 64 bit | 5.0 proxmox kernel | omvextrasorg 5.1.5
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!