NFS lose UID - GID once mounted

  • Hello,


    I am a beginer on OMV.


    I am trying to share folder through NFS but once mounted is always owned by anonymous.


    In detail :
    I created a shared folder
    I added it to NFS


    The /etc/exports shows :
    export/Films 192.168.0.10(rw,subtree_check,secure,all_squash,anonuid=1000,anong
    id=1000)


    # NFSv4 - pseudo filesystem root
    /export 192.168.0.10(ro,fsid=0,root_squash,no_subtree_check,hide)



    I mounted the shared directory with :
    ~$ sudo mount -t nfs -o rw 192.168.0.44:/Films /home/olivier/Video_Serveur



    The file owner's UID is 1000 on OMV.


    It is the same UID that is mounting on the client side


    But once mounted the files are belonging to anonymous


    $ ls -l /home/olivier/Video_Serveur/
    total 2368
    -rw-rw-r-- 1 nobody users 83149 févr. 5 2013 Capture du 2013-02-05 21:25:02.png
    drwxrwxr-x 12 nobody 4294967294 4096 mai 3 2012 FilmDVD
    -rw-r--r-- 1 nobody users 2334208 déc. 31 2010 SCN_0013.pdf



    I tried the sale operation with another NFS server (on a ubuntu machine) and the files are showing the correct owner once mounted on the client.


    Could you please help me ?

  • Could you please show the corresponding ls -la on your OpenMediaVault?


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • The FS is mounted under /media on OMV.


    That's the corresponding command you can see the owner is Olivier whose UID is 1000.



    $ ls -la /media
    total 28
    drwxr-xr-x 7 root root 4096 4 août 17:38 .
    drwxr-xr-x 22 root root 4096 1 mars 22:10 ..
    drwx------ 5 Olivier WORKGROUP 4096 2 mars 18:28 0f36defb-07ca-4fbc-8833-ee980e70bf9d


    $ id
    uid=1000(Olivier) gid=100(users) groupes=100(users),0(root),1(daemon),2(bin),3(sys),4(adm),5(tty),6(disk),7(lp),8(mail),9(news),10(uucp),12(man),13(proxy),15(kmem),20 ...

  • Nope. I want to see 'ls -la /media/UUID/sharedfolder/'.


    And add 'stat /media/UUID/sharedfolder/' too.


    Edit: Those permissions you have there are wrong too... the UUID folder does not belong to a specific user but should be root:users instead. But you have it restricted to User only... so this may the cause for that.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • $ ls -la media/0f36defb-07ca-4fbc-8833-ee980e70bf9d/Films
    total 2376
    drwxrwsr-x+ 3 Olivier users 4096 4 août 23:32 .
    drwx------ 5 Olivier WORKGROUP 4096 2 mars 18:28 ..
    -rw-rw-r--+ 1 Olivier users 83149 5 févr. 2013 Capture du 2013-02-05 21:25:02.png
    drwxrwxr-x 12 Olivier WORKGROUP 4096 3 mai 2012 FilmDVD
    -rw-r--r--+ 1 Olivier users 2334208 31 déc. 2010 SCN_0013.pdf


    $ stat /media/0f36defb-07ca-4fbc-8833-ee980e70bf9d/Films
    File: « /media/0f36defb-07ca-4fbc-8833-ee980e70bf9d/Films »
    Size: 4096 Blocks: 8 IO Block: 4096 répertoire
    Device: 801h/2049d Inode: 12 Links: 3
    Access: (2775/drwxrwsr-x) Uid: ( 1000/ Olivier) Gid: ( 100/ users)
    Access: 2014-08-06 01:27:05.886688331 +0200
    Modify: 2014-08-04 23:32:18.769211822 +0200
    Change: 2014-08-04 23:32:18.769211822 +0200


    Thanks for your help.


    I am not really sure I understood your comment. I didn't change any permission. I just selected an existing folder and add it as a share one and then use it for NFS.


    Olivier.

  • The permissions for /media/UUID should be root:users. It just wondered me why it is user specific in your case.


    Code
    root@Chap ~ # ll /media/
    insgesamt 32K
    drwxr-xr-x   7 root root  4,0K Mai  3 17:25 .
    drwxr-xr-x  25 root root  4,0K Mai  9 17:48 ..
    drwxrwsr-x+  7 root users   82 Mai 15 20:29 ca425484-1be3-47f1-b7bb-8f0785c9ea5b
    drwxrwsr-x+ 14 root users 4,0K Mai 15 20:29 d3c21c66-af4b-41d4-b098-462e83fa641d
    root@Chap ~ #


    I only use NFS as read-only, so I would have to check your behaviour in a VM.


    Are there any downsides with your actual behaviour? Can your write files or do you really have permission problems, besides not showing the correct owner and group?


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • I am starting this OMV as a backup machine.


    I may be doing this the wrong way but my objective is to mount the OMV folder on a client machine to run a backup (using lucky backup).


    In a previous test I did many months ago if the owner were wrong the backup messed up and was backuping all the files all the times.


    I didn't go until the test with Luckybackup, since I stopped when I found this situation.


    My previous test were with sshfs but I red that NFS would be better for a continuous connection.


    Olivier

  • Hm... I have to verifiy that in a VM, but I won't have time for that in the next 1-2 days.


    You could try to use CIFS/SMB instead for the time beeing and check wether or not the permissions are correct there. If they are not the root of the problem may be elsewhere.


    If I forget to get back to you just push this thread to remind me in 2 days or so.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • I'll try my best.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Hey David,


    I made some afdditional testing.


    My current situation (permissions not being root - users on the server side) is due to the use of existing disks with existing FS that came with permissions that OMV kept as they were.
    I created a new FS from OMV on an empty partition and everything is set to root - users as expected.


    However mouting throough NFS I still getting root - users on the client side.


    I tested CIFS -Samba
    I have the issue of permissions on the client side (regardless of the protocol used : NFS or Samba).


    So, on the client side I added the user (olivier) to the group users and my backup program is able to run correctly.
    We can consider that I have a solution.
    But I still do not understand why the ANONUID and ANONGID is not working with NFS.


    By the way, Samba it looks like Samba is running better and faster than NFS. Therefore I am getting rid of NFS and switching to CIFS, it's a shame as all my machines are running Linux.


    Thanks again David.

  • Hehe, you're welcome. ;)


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • I am not sure if that helps.


    You should avoid using usernames with upper and lower cases. Oliver is not a good example.


    Unix IS case sensitive and will handle things differently and sometimes unpredictable.


    Also you stated:
    The /etc/exports shows :

    Code
    export/Films 192.168.0.10(rw,subtree_check,secure,all_squash,anonuid=1000,anong
    id=1000)
    
    
    # NFSv4 - pseudo filesystem root
    /export 192.168.0.10(ro,fsid=0,root_squash,no_subtree_check,hide)


    To be honest, I do not really understand that /etc/exports file.


    It should look somehow that way:


    Code
    /media/UUID/Films 192.168.0.10(rw,subtree_check,secure,all_squash,anonuid=1000,anongid=1000)


    Do you get any error messages when you try to export that /etc/exports?

    Everything is possible, sometimes it requires Google to find out how.

  • The /etc/exports file is fine the way it is.


    Code
    # /etc/exports: the access control list for filesystems which may be exported
    #               to NFS clients.  See exports(5).
    /export/Comedy 192.168.178.0/24(ro,subtree_check,secure,async)
    /export/Filme 192.168.178.0/24(ro,subtree_check,secure,async)
    /export/Serien 192.168.178.0/24(ro,subtree_check,secure,async)
    
    
    # NFSv4 - pseudo filesystem root
    /export 192.168.178.0/24(ro,fsid=0,root_squash,no_subtree_check,hide)


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Code
    export/Films 192.168.0.10(rw,subtree_check,secure,all_squash,anonuid=1000,anong
    id=1000)


    There is a leading / missing.


    export/Films will not work


    /export/Films will work

    Everything is possible, sometimes it requires Google to find out how.

  • I have same issue where I tried map tomcat:tomcat NFS share and can't make it work.
    From web UI I can't set user with specific uid and gid. I created user from shell.
    I set /etc/idmapd.conf with mydomain.org and even tried expire cache, but nothing helps it mounting as nobody:nobody
    Also tried anonuid=91,anongid=91 and it didn't worked either.
    If I am trying change permission on client getting error.
    I am using ldap on the system as authentication.


    kernel: NFS: v4 server myhost.mydomain.org does not accept raw uid/gids. Reenabling the idmapper.



    Code
    /export/WebAppData00 10.10.0.0/21(rw,no_root_squash,no_subtree_check,crossmnt,fsid=0)
    # NFSv4 - pseudo filesystem root
    /export 10.10.0.0/21(ro,fsid=0,root_squash,no_subtree_check,hide)
  • chente

    Hat das Thema geschlossen.
  • chente

    Hat das Thema geschlossen.

Jetzt mitmachen!

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