# Mounting root filesystem via NFS in read/write mode.

## bahadir

Hi,

I am able to mount the root filesystem of a machine via NFS, but it is always read only.

I know that appending "rw" and "no_root_squash" to the entries in /etc/exports file should enable write mode

but it doesn't help. I also have "rw" appended to the nfsroot variable of the kernel commandline on the client side.

I still get the message, something like: VFS: mounting NFS root filesystem read-only.

The root filesystem has rwx bits enabled for the owner part of all files, (the owner of filesystem is root)

Is there anything else that matters?

Thanks,

Bahadir

----------

## JeliJami

 *bahadir wrote:*   

> VFS: mounting NFS root filesystem read-only.

 

that's a message during boot, right?

just ignore it

can you edit/create/touch/remove files on your file system?

----------

## bahadir

Yes that's a boot message. But no I can't touch/modify files.

Thanks,

Bahadir

----------

## JeliJami

 *bahadir wrote:*   

> Hi,
> 
> I am able to mount the root filesystem of a machine via NFS, but it is always read only.
> 
> I know that appending "rw" and "no_root_squash" to the entries in /etc/exports file should enable write mode

 

can you post your /etc/exports file, please?

 *bahadir wrote:*   

> but it doesn't help. I also have "rw" appended to the nfsroot variable of the kernel commandline on the client side.
> 
> I still get the message, something like: VFS: mounting NFS root filesystem read-only.
> 
> The root filesystem has rwx bits enabled for the owner part of all files, (the owner of filesystem is root)
> ...

 

can you post your /etc/fstab file, please?

----------

## emuller

Hi,

I followed the gentoo diskless howto: 

http://www.gentoo.org/doc/en/diskless-howto.xml

And I had the same problem.  I solved it by adding the server IP address to the /diskless/clientname/etc/hosts and removing the /diskless/clientname/etc/mtab file which is copied from the server in the howto via the command (code listing 2.12 there):

```

cp -r /etc /diskless/192.168.1.21/etc

```

I assume this mtab file listed / as already mounted to the server /dev/sdaX device so it didn't remount.  The nfsroot kernel variable ensures however that it mounts the first time.  Try that out.

But now my /usr /opt and /home don't mount.  I'm unclear where to add this "before *"... (code listing 6.3) in /diskless/clientname/etc/init.d/netmount or the server /etc/init.d/netmount? ... and if it's necessary at all for 2006.0 ... the howto says for baselayout version 1.11.* it's not necessary.  What's a baselayout?

Also if you're running amd64 like I am... you have to add 

```

rsync -avz /lib64 /diskless/clientname

```

to code listing 6.1

I added the hack lines:

```

mount /usr

mount /opt

mount /home

```

after the mount -at nofs,etc in my /etc/init.d/localmount which seems to mount everything ok... but then I get a devs issue stating my dev directory is not correct.  I think this is because I added a rw in my pxelinux.cfg/default

```

DEFAULT /bzImage

APPEND ip=dhcp root=/dev/nfs rw nfsroot=192.168.1.1:/diskless/192.168.1.21

```

and therefore /dev/null gets created as a file.  But I have yet to verify this yet.

this is just a hack.  How should /usr /opt and /home be mounted correctly?  In netmount?  netmount should belong to the boot runlevel?  But it doesn't seem to mount soon enough in the init scripts.  Any ideas?

Someone with the same problem:

https://forums.gentoo.org/viewtopic-t-448852-highlight-nfsroot+diskless.html

thanks,

emuller

----------

## Mgiese

could you post also your /etc/fstab ?

----------

