Access a remote mount folder from terminal

  • Hi,
    I configured a remote mount linked to a smb share exposed by the router.

    In filesystem page I see that is mounted:



    in the home dir I have a symlink to the path where the remote is mounted.

    lrwxrwxrwx 1 pi users 42 May 20 07:56 router_drive -> /srv/4892764a-9c63-4689-83c1-4627bbaa2a84/


    I have a bash script that triggers rsync from a local folder to this mounted drive.

    this is the rsync script:

    rsync -av \

    --delete \

    --no-perms \

    --no-owner \

    --no-group \

    --progress \

    --exclude-from='/home/pi/raspberry-mcg/script/backup/rsync_exclude.txt' \

    --log-file='/var/log/rsync/rsync_router_drive.log' \

    /home/pi/backup_drive/ /home/pi/router_drive/rsync/


    The highlight path is the destination path, a symlink to the remote folder as shown above.

    What happened yesterday is that, instead of copying stuff to the remote, the script wrote in /home/pi/router_drive/rsync/ files (like the usual behaviour) but instead of the remote this files filled up my root partition. Seems that the mount disappeared so rsync created the folder tree into /home/pi/router_drive/rsync/ but now this was a local folder.

    What is the right way to access from ssh a remote mount shared folder?

  • What is the right way to access from ssh a remote mount shared folder?

    I think the remotemount plugin could work for your use case.

    You can mount a remote folder on your local system. then you can work with it with local commands, rsync, or whatever interests you ...


    here you have more information:

    https://wiki.omv-extras.org/do…ote_mount_plugin_for_omv5

    OMV 5, Intel core i3 3225, 8GB RAM, PendriveUSB system, ZFS RaidZ 5xWD Red 4TB, 1x120GB SSD Docker

    I DO NOT SPEAK ENGLISH. I translate with google, sorry if sometimes you don't understand me well:)

    Make a backup now. You don't want to miss it next week !!

    Edited once, last by chente ().

  • I'm using remote mount



    but how I can access di mounted remote share?
    In the picture I put in the first message I showed the filesystem, here I can see that the remote mount is mounted under /srv/xxxxxxxxxxxxx.

    You suggestion is to use that folder?

    Probably I got what happened when I had the full root disk issue: I restarted the router so the remote mount is gone.
    When router restart ended OMV didn't remount the share so as soon as someone tried to write into /srv/xxxxxx (accessing the folder via symlink but I think isn't a problem) in fact is writing on the local file system not the remote one.

    Could be possible?

  • after mounting the remote share, did you create a shared folder pointing to that share?

    OMV 5, Intel core i3 3225, 8GB RAM, PendriveUSB system, ZFS RaidZ 5xWD Red 4TB, 1x120GB SSD Docker

    I DO NOT SPEAK ENGLISH. I translate with google, sorry if sometimes you don't understand me well:)

    Make a backup now. You don't want to miss it next week !!

  • The folder is automatically mounted in / srv / xxxxxxx (numbers ...), but you must handle it with the shared folder name that you created.

    If I have not misunderstood, you want to do rsync work to that folder. You don't need a script. You can configure any rsync job from GUI. It only works with the Router_usb_drive folder as if it were a local folder.


    I edit. Sorry. I just reread your first post. I don't think I got it right. What is the reason to do this from CLI with a scrypt? You can do any rsync work in the GUI. Doesn't that seem easier to you?

    Anyway what you've done should work, you access the correct folder with a symbolic link.

    OMV 5, Intel core i3 3225, 8GB RAM, PendriveUSB system, ZFS RaidZ 5xWD Red 4TB, 1x120GB SSD Docker

    I DO NOT SPEAK ENGLISH. I translate with google, sorry if sometimes you don't understand me well:)

    Make a backup now. You don't want to miss it next week !!

    Edited once, last by chente ().

  • Thanks for your feedback.

    I did it via script to "learn" how rsync is used.
    I know that there is OMV gui to use rsync but I want to understand it before using the gui.


    The folder is automatically mounted in / srv / xxxxxxx (numbers ...), but you must handle it with the shared folder name that you created.

    Where in the filesystem I can find the folder with "Shared folder" as name?
    I mean accessing filesystem via terminal?


    I edit. Sorry. I just reread your first post. I don't think I got it right. What is the reason to do this from CLI with a scrypt? You can do any rsync work in the GUI. Doesn't that seem easier to you?

    Anyway what you've done should work, you access the correct folder with a symbolic link.

    The issue I had (root fs filled by files sync done by rsync) happened because I reboot the router, so the remote mount gone away. When the router was again up&running OMV didn't remounted the remote smb share so /srv/xxxxxx become a "local folder" and rsync started putting files there.

    There is a way to make OMV remount/re-attach a "Remote mount" as soon as it come back?

Participate now!

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