[SOVLED] SFTP have to recreate shares after reboot

  • Hi everyone,

    I have encountered a problem with the sftp plugin. I use zfs with encryption. The pool gets mounted after the boot by using a script. This works fine with my configuration of services. Only the sftp-plugin makes some trouble.


    I have to recreate the sftp shares (ServicesàSTFPàShares) after each reboot or I just get an empty folder after login using sftp. I’m not sure if the problem is related to my encryption or if it is completely unrelated. Does anybody have an idea how to fix the problem?

  • viper2035

    Changed the title of the thread from “SFTP have to recreate share after reboot” to “SFTP have to recreate shares after reboot”.
    • Official Post

    This isn't the plugin's fault. It creates bind mounts and these bind mounts are mounted. Because your storage is not ready at that time, you don't have files in those mounts as you found. You need to remount each sftp bind mount in /etc/fstab. This one liner should fix it (needs to be run on each boot):


    grep '/sftp.*bind' /etc/fstab | awk '{print $2}' | while read -r mount; do sudo umount "$mount" && sudo mount "$mount"; done

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I'm completely aware that my configuration is somehow “special” and that the sftp plugin is fine.


    Thank you for providing your help, your solution works perfectly. I integrated it into my mount script and know everything works.

  • viper2035

    Changed the title of the thread from “SFTP have to recreate shares after reboot” to “[SOVLED] SFTP have to recreate shares after reboot”.
    • Official Post

    I'm completely aware that my configuration is somehow “special” and that the sftp plugin is fine.

    You aren't the only one. Anyone who encrypts their data drives will have the same issue. I just don't have a good idea for having the mounts wait until the data drives are unlocked. Glad it works. Not sure if it would be helpful for others if you shared your script?

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • ryecoaaron

    Added the Label resolved
  • I can share the script but I'm 100% sure, that it is complete code garbage. It works fine for me. But feel free the change everything. I run the script with a “Scheduled Tasks” @reboot. (OMVàSYSTEMàScheduled Tasks)


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!