Remote mount SMB/CIFS folder from router - folders owned by root

  • Hi all,
    I configured e remote mount for a folder exposed by my router (with usb hdd attached).


    Code
    credentials=/home/pi/.cifscredentials-xase-7d0d-34ff-8a3b-asdf22vg44672,_netdev,iocharset=utf8,vers=1.0,nofail,user_xattr,sec=ntlmv2,domain=HOME


    The issue I'm facing is when I use rsync to backup stuff on this folder.
    Source is:


    Code
    pi@raspberrypi:~/local_drive/tmp/test$ ll
    total 4.0K
    drwxr-sr-x 2 pi users 4.0K May 13 23:26 file1.txt

    File owned by pi of group users.

    Destination becomes:


    Code
    pi@raspberrypi:~/router_hdd/rsync/tmp/test$ ll
    total 0
    drwxrwxrwx 1 root root 0 May 14 12:56 file1.txt

    owned by root.


    What happens if that each time I execute rsync it always perform data transfer because source and dest file are not considered equal.

    Rsync script:

    Code
    cd /home/pi/raspberry-mcg/script/backup/;
    ./solo -port=9999 rsync -avz \
    --delete \
    --progress \
    --exclude-from='/home/pi/raspberry-mcg/script/backup/rsync_exclude.txt' \
    --log-file='/home/pi/router_hdd/rsync/tmp/sync_router_hdd_small.log' \
    /home/pi/local_drive/tmp/test /home/pi/router_hdd/rsync/tmp


    Also if I move into folder of this "remote mount" shared folder and I (user pi) create a file it ends up owned by root.


    What is my error?

  • Maybe you need the same user accounts on both sides?

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

  • The issue is that router hasn't a "smart" interface for handling this shared device.
    Very basic configuration: add device, protect with password, quota.

    I had also some trouble to find out that I should use "vers=1.0" in connection string :(

  • Hi all,
    coming back to this topic.
    I still have the same issue: "Remte Mount" + "Shared folder" make directories in the file system that are owned by root.
    I want to use the remote mounted drive (usb drive attached to router) for backup and I don't want that backup files are owned by root.

    How can I change ownership for folder inside the "Remote Mount"?

  • mcgyver83

    Hat das Label von OMV 4.x auf OMV 5.x geändert.
  • mcgyver83

    Hat den Titel des Themas von „Remote mount SMB/CIFS folder from router“ zu „Remote mount SMB/CIFS folder from router - folders owned by root“ geändert.
  • Thanks I will try.

    But How can I mount a shared SMB drive (exposed by the router) on a local folder owned by a specific user?
    My issue is that /srv/xxxxxx is owned by root:root. I can browse folders but cannot create any file

    • Offizieller Beitrag

    My issue is that /srv/xxxxxx is owned by root:root. I can browse folders but cannot create any file

    While it's a guess, "Others" is probably set to "read" which allows browsing but no edits.

    Here's a direct link to the section of the document that explains the settings in extra options. -> Link (It would still be best to read through the doc.)

    • Offizieller Beitrag

    In the proposed link there is no mention to extra-options

    ???

    Quote:

    ______________________________________________________________________________________


    In Extra options, note the additional commands added:


    These commands are necessary due to the origin of the files. Files and folders are being pulled from a “foreign volume” where the root account and the users group are different from the same accounts and user group, with the same names, on the local machine. When files and folders are imported from a foreign source, the default “create mask” is applied which is root:root - 0755 for folders and 0644 for files (depending on the create location).



    It's necessary to change ownership (chown) to the local root account and the local users group, and to modify access permissions (chmod). In this case –chmod=0775 and –chown=root:users was used. This is the equivalent of:



    Owner – root Read/Write/Execute


    Group – users Read/Write/Execute


    Others – Read/Execute




    See Further Notes on Permission commands, for setting the appropriate permissions for imported files.

    fetch.php?w=600&tok=1d8d00&media=remotemount10.jpg

  • Ok now I got it.
    Not Extra options from remote mount configuration but in the SMB Share configuration.

    I was referring to the filesystem folder used as mounting point (/srv/485245asadasdsa).

    I sometimes forget that OMV is dedicate to configure a nas, so is not supposed you access its real filesystem via ssh or similar :(

    • Offizieller Beitrag

    Look at the label in the pic,, it's in the rsync job's options. You NEED to read the document. No one can help you if you won't.


    I sometimes forget that OMV is dedicate to configure a nas, so is not supposed you access its real filesystem via ssh or similar


    If you look at the New User Guide, you'll find all kinds of tips on "viewing" OMV's file system. Specifically, look for the sections on Midnight Commander and WinSCP.

    • Offizieller Beitrag

    How can I change ownership for folder inside the "Remote Mount"?

    If this is what you're trying to do, the answer is:
    Permissions to the remote file system are limited to the username + password used to mount the filesystem. The remote server "owns" the files. Permissions for the username + password used for the remote mount, are set at the remote server.

Jetzt mitmachen!

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