Find the answer to your Linux question:
Results 1 to 4 of 4
So I've fried my brain trying to figure this one out. I'm running NFSv4 on gentoo (kernel 3.4.9-gentoo running nfs-utils 1.2.3-r1) and have an /etc/exports of /export 192.168.0.0/24(ro,root_squash,fsid=0,no_subtree_check) /export/qemu_images 192.168.0.109(rw,no_root_squash,subtree_check,fsid ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699

    NFSv4 share with different permissions from root (fsid=0)


    So I've fried my brain trying to figure this one out. I'm running NFSv4 on gentoo (kernel 3.4.9-gentoo running nfs-utils 1.2.3-r1) and have an /etc/exports of

    /export 192.168.0.0/24(ro,root_squash,fsid=0,no_subtree_check)
    /export/qemu_images 192.168.0.109(rw,no_root_squash,subtree_check,fsid =1)

    if it's not obvious, I'm trying to export /export/qemu_images to ip 192.168.0.109 to host a storage pool for VM images.

    No matter what I do, I can't get it to mount on 192.168.0.109 in read/write state. If I get rid of the first line, and make the second be fsid=0, then it all works fine ... but I want all the files in /export to be available RO too.


    Client is running Fedora 17, kernel 3.6.1-1, nfs-utils 1.2.6. I've tried mounting with explicit `mount -t nfs4 /qemu_images /mnt/temp` and can't get it to be in RW mode.

    Any help would be much appreciated.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,738
    On Fedora17 -nfs-server, I tried something like below with freebsd as client.
    Code:
    /home/lg/bre			*(ro,root_squash,no_subtree_check,fsid=0)
    /home/lg/bre/external		*(rw,no_root_squash,subtree_check,fsid=1)
    It works for me.

    Code:
    I can't get it to mount on 192.168.0.109 in read/write state
    mount it self fails ? if so ,can you try with more verbose option? something like
    Code:
    mount -vvv <nfs-server>:/export /mntpt
    EDIT:
    When I mounted the share in Fedora-17 itself.
    It said
    Code:
    $ touch a
    touch: cannot touch `a': Permission denied
    when i did "sudo touch a " Its fine.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    Quote Originally Posted by Lakshmipathi View Post
    On Fedora17 -nfs-server, I tried something like below with freebsd as client.
    Code:
    /home/lg/bre			*(ro,root_squash,no_subtree_check,fsid=0)
    /home/lg/bre/external		*(rw,no_root_squash,subtree_check,fsid=1)
    It works for me.

    Code:
    I can't get it to mount on 192.168.0.109 in read/write state
    mount it self fails ? if so ,can you try with more verbose option? something like
    Code:
    mount -vvv <nfs-server>:/export /mntpt
    EDIT:
    When I mounted the share in Fedora-17 itself.
    It said
    Code:
    $ touch a
    touch: cannot touch `a': Permission denied
    when i did "sudo touch a " Its fine.

    Sorry for delay, I got caught up with a busy work week. Thanks for your suggestions, here's what I got.

    Code:
    # mount -vvv server1:/qemu_images /mnt/temp 
    mount.nfs: timeout set for Fri Nov  2 21:27:56 2012
    mount.nfs: trying text-based options 'vers=4,addr=192.168.0.254,clientaddr=192.168.0.109'
    and it mounted fine. but when I try and write files to it,

    Code:
    # ls /mn/temp/
    ls: cannot open directory /mnt/temp/: Permission denied
    
    # sudo -u qemu ls /mnt/temp
    displays files fine
    
    # sudo -u qemu touch /mnt/temp/testfile
    touch: cannot touch `/mnt/temp/testfile': Read-only file system
    
    # ls -ld /mnt/temp/
    drwx------ 1 qemu qemu 30 Oct 23 20:20 /mnt/temp/
    
    # mount | egrep /mnt/temp
    server1:/qemu_images on /mnt/temp type nfs4 (rw,relatime,vers=4.0,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.0.109,local_lock=none,addr=192.168.0.254)
    I don't see any updates in /var/log/* on either system (and syslog is enabled on both.) The userIDs are the same, and it's allowing me to ls the directory as qemu user, which is a good sign because it's restricted permissions. On the client, it's mounted RW according to `mount`, but it's being denied write permissions.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,738
    Code:
    # ls /mn/temp/
    ls: cannot open directory /mnt/temp/: Permission denied
    okay, that failed because you have 'drwx' only for its owner (qemu).
    Code:
    drwx------ 1 qemu qemu 30 Oct 23 20:20 /mnt/temp/
    On the client,have you tried creating with user qemu and log-in to that account rather than using sudo -u and create a file. Will that work?
    hmm..I'm also not very sure about the issue.Lets see whether we get any hints to solve the issue.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •