Openhab backup command unable to write files to NFS directory on Linux

  • I've got a folder on my OMV, shared with NFS:



    On another Linux machine, I've got openHAB running. And I want to have that system store backup files on my NAS.


    At first I tried the system native command on a non-mounted folder, which worked. But when I mount the folder, it doesn't work...

    This first worked:

    Code
    erik@MinipcLG2:~$ sudo /usr/bin/openhab-cli backup /home/erik/Openhab-backups/openhab-$(date +%A).zip



    Then I did this:

    Code
    erik@MinipcLG2:/$ sudo mount -t nfs 192.168.1.10:/openHAB-backup /home/erik/Openhab-backups/
    erik@MinipcLG2:/$ sudo /usr/bin/openhab-cli backup /home/erik/Openhab-backups/openhab-$(date +%A).zip
    
    Using '/etc/openhab' as conf folder...
    Using '/var/lib/openhab' as userdata folder...
    Using '/usr/share/openhab/runtime' as runtime folder...
    Unable to locate specified directory '/home/erik/Openhab-backups'

    Here you can see the permissions:



    Does anyone have a clue what the problem is here?


  • Code
    erik@MinipcLG2:/$ sudo mount -t nfs 192.168.1.10:/openHAB-backup /home/erik/Openhab-backups/
    erik@MinipcLG2:/$ sudo /usr/bin/openhab-cli backup /home/erik/Openhab-backups/openhab-$(date +%A).zip
    
    Using '/etc/openhab' as conf folder...
    Using '/var/lib/openhab' as userdata folder...
    Using '/usr/share/openhab/runtime' as runtime folder...
    Unable to locate specified directory '/home/erik/Openhab-backups'


    Does anyone have a clue what the problem is here?


    Use

    Code
    sudo mount -t nfs 192.168.1.10:/openHAB-backup /home/erik/Openhab-backups
  • Use

    Code
    sudo mount -t nfs 192.168.1.10:/openHAB-backup /home/erik/Openhab-backups

    I'll try that later today.


    I forgot to add that writing to the mounted directory is possible.


    I tested that: I copied a file manually, both via the GUI as via command line. I then checked whether these files are visible through the SMB connection to my Windows laptop, which was the case.

  • Change the NFS extra options to include "no_root_squash"

    I read the same suggestion on the openHAB forum tonight, so I was certain this would do the trick.


    Alas:


    Or do I need to reboot my OMV server?

  • You can check if "root" on Minipc can write to your nfs mount with:


    sudo touch /home/erik/Openhab-backups/

    sudo ls -l /home/erik/Openhab-backups/

    sudo rm touch /home/erik/Openhab-backups/

    That was possible...


    But I went about it another way: I installed a rsync job (using this help: RE: Rsync pull - Host key verification failed, thanks RonO & Itookmyprozac!).


    So although the actual problem isn't solved, my 'needs' are met.


    Thanks everyone to chime in!

  • The check showed OMV NFS share was figured correctly to allow "root" to write to it. As I know nothing about "openhab-cli" I don't why it was throwing errors. Can't a non-root user invoke openhab-cli? Anyway, you decided on using rsync instead.

  • @EirkDB This is not an OMV problem. You have an NFS share that "root" can right to, openhab-cli appears to only run as "root". But where does openhab-cli write to by default? That's a question best answered on a openhad forum.

  • ErikDB

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!