# nfs mounts read-only in spite of fstab rw directive

## JeroenV

Hi,

on one particular machine, after every reboot, the distfiles directory (that is mounted over nfs, obviously) is not writable, although it appears as such

```

# mount

...

maple:/usr/portage/distfiles on /usr/portage/distfiles type nfs (rw,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

...

```

after I do

```

# mount -o remount,rw /usr/portage/distfiles/

```

everything works ok.

It should be working without this, however, since my fstab reads:

```

...

maple:/usr/portage/distfiles    /usr/portage/distfiles  nfs     auto,rw,soft,rsize=8192,wsize=8192

```

tia   :Cool: 

----------

## erik258

ah yes, i've had the exact same problem implementing a shared portage tree as well.  For me, experimenting with removing some of the mount options in fstab helped a lot -- in my case, it was tcp in particular that was the problem.

----------

## JeroenV

The funny thing is, however, that on another machine I have the exact same setup (also pointing to the same server), without any problems.

 :Rolling Eyes:   :Rolling Eyes: 

Just got a brainwave: there is a difference between the two:

the box with the problem didn't have the /usr/portage/distfiles mountpoint on the local disk, but only on the remotely mounted /usr/portage. 

Fixing this, however, still didn't solve the problem   :Crying or Very sad: 

To add some info: /usr/portage is mounted read only, and then distfiles is mounted rw over it:

```

maple:/usr/portage on /usr/portage type nfs (ro,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

maple:/usr/portage/distfiles on /usr/portage/distfiles type nfs (rw,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

```

but as said, the same setup on another box works perfectly...

Any more ideas  :Question: 

----------

## erik258

I think I would like to see, for both the working and the not working host, 

- /etc/fstab

- output of mount

and for NFS server

- /etc/exports

----------

## JeroenV

ok, on the working host:

```

$ mount

/dev/sda5 on / type reiserfs (rw,noatime)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)

udev on /dev type tmpfs (rw,nosuid)

devpts on /dev/pts type devpts (rw,nosuid,noexec)

/dev/sda6 on /usr/local type reiserfs (rw,noatime)

/dev/sdb1 on /home type reiserfs (rw,noatime)

/dev/sda7 on /share type ext3 (rw,noatime)

shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)

usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)

nfsd on /proc/fs/nfs type nfsd (rw)

rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

maple:/home on /mnt/maple/home type nfs (rw,noexec,nosuid,nodev,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

maple:/home/oxian on /home/oxian type nfs (rw,noexec,nosuid,nodev,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

maple:/usr/portage on /usr/portage type nfs (ro,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

maple:/usr/portage/distfiles on /usr/portage/distfiles type nfs (rw,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

maple:/var/www/localhost/htdocs on /mnt/maple/htdocs type nfs (rw,noexec,nosuid,nodev,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

```

on the non-working host (after fresh reboot)

```

$ mount 

/dev/hda3 on / type reiserfs (rw,noatime)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)

udev on /dev type tmpfs (rw,nosuid)

devpts on /dev/pts type devpts (rw,nosuid,noexec)

/dev/hda4 on /home type ext3 (rw)

shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)

usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)

maple:/usr/portage on /usr/portage type nfs (ro,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

maple:/usr/portage/distfiles on /usr/portage/distfiles type nfs (rw,soft,rsize=8192,wsize=8192,addr=192.168.178.20)

```

after doing

```
# mount -o remount,rw /usr/portage/distfiles/
```

 on this host, the output is exactly the same, but now /usr/portage/distfiles is writable.

/etc/exports on the server:

```

# /etc/exports: NFS file systems being exported.  See exports(5).

/home                   192.168.178.0/24(rw,no_root_squash,async)

/home/oxian             192.168.178.0/24(rw,root_squash,async)

/usr/portage            192.168.178.0/24(ro,no_root_squash,async)

/usr/portage/distfiles  192.168.178.0/24(rw,no_root_squash,async)

/usr/portage/packages   192.168.178.0/24(rw,no_root_squash,async)

/mnt/cdrom              192.168.178.0/24(ro,no_root_squash,async)

/var/www/localhost/htdocs 192.168.178.28(rw,no_root_squash,async)

```

----------

## erik258

have you played around with removing or perhaps changing the order of mount options in fstab yet?  Btw, what does fstab look like on the two clients?

----------

## JeroenV

you're fast   :Very Happy: 

both posted fstabs are of the clients, the working one and the not-working one respectively

I've not played with the order of the options yet, but I don't see how that should make a difference?

----------

## erik258

 *Quote:*   

> you're fast 

 

i have the day off, so I'm just messing about with my computers right now.  The forums give me valuable experience with problems to which i would otherwise be unexposed.  

 *Quote:*   

> both posted fstabs are of the clients, the working one and the not-working one respectively 

 

ok, i saw the output of `mount`, and also I saw

```
maple:/usr/portage/distfiles    /usr/portage/distfiles  nfs     auto,rw,soft,rsize=8192,wsize=8192 
```

from your first post, and since i didn't see any other fstab postings, i will assume until corrected that you're feffering to the above-codequoted text.  

 *Quote:*   

> I've not played with the order of the options yet, but I don't see how that should make a difference?

 

neither do i.  But how about removing the word 'auto' from fstab?  I don't think it's strictly necessary, since any entries lacking noauto should be mounted automatically.   Or how about adding 'defaults' to the beginning of the options list?  

The wierd thing is taht the exact same configuration works on one box, but fails to work on the other until it is remounted.  Which is very odd.  I wish I would have put more effort into paying attention to what I did to fix the problem, but I noticed that I did end up changing my settings to 'defaults' and left it at that.  Perhaps I'll play around with it a little today and see if i can't reproduce your error.

----------

## erik258

I couldn't reproduce this problem.  Sorry.  Keep me posted as to what you figure out, if anything.  In particular I recommend removing the rsize and wsize settings temporarly and seeing if that helps; i haven't been able to achieve a noticable performance increase with these being set in various ways, so i'm not sure how much it matters anyways, although i'm aware that's the first place to turn for better performance.  I use 100mb/sec still so performance for me is limited anyways.

----------

## JeroenV

I tried many variants of the options in fstab without luck....

it remains a question   :Confused: 

Thanks anyway for the efforts  :Exclamation: 

----------

## erik258

if nothing else, i recommend putting your remount command in /etc/conf.d/local.start as a temporary (? hopefully!) workaround.  i also meant to ask whether the nfs utilities on the malfunctioning client were older (or newer!) than on the one that works?

----------

