# diskless client not mounting NFS filesystems

## Wizumwalt

I have a diskless node being booted from a master, and it boots w/ errors. The errors I believe are mostly due from the masters fs's not being exported properly. The / fs on the slave is completely read only.

On the diskless node, I run dmesg and see ...

```

VFS: Mounted root (nfs filesystem) readonly.

Freeing unused kernel memory: 436k freed

udev: renamed network interface eth1 to eth3

```

Had some ethernet errors when booting, but I think because all the filesystems aren't mounted correctly.

This is my /etc/exports file on the master.

```

/diskless/10.0.1.1      10.0.1.1(sync,rw,subtree_check,no_root_squash,no_all_squash)

/opt    10.0.0.0/16(sync,rw,subtree_check,no_root_squash,no_all_squash)

/usr    10.0.0.0/16(sync,ro,subtree_check,no_root_squash,no_all_squash)

/home   10.0.0.0/16(sync,rw,subtree_check,no_root_squash,no_all_squash)

/var/log 10.0.0.0/16(sync,rw,subtree_check,no_root_squash,no_all_squash)

```

My pxelinux.cfg node file.

```

DEFAULT /bzImage

APPEND ip=dhcp root=/dev/nfs nfsroot=10.0.0.10:/diskless/10.0.1.1

```

This is run from my diskless node.

```

# mount

10.0.0.10:/diskless/10.0.1.1 on / type nfs (rw,sync,remount,hard,intr,nolock,rsize=8192,wsize=8192,addr=10.0.0.10)

proc on /proc type proc (rw)

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

udev on /dev type tmpfs (rw,nosuid, size=10240k, mode=755)

devpts on /devpts type devpts (rw,nosuid,noexec,gid=5,mode=620)

usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid)

```

Here's the mount from the master.

```

# mount

/dev/sda3 on / type jfs (rw)

proc on /proc type proc (rw,nosuid,nodev,noexec)

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

udev on /dev type tmpfs (rw,nosuid,size=10240k,mode=755)

devpts on /dev/pts type devpts (rw,nosuid,noexec,gid=5,mode=620)

/dev/sda5 on /home type jfs (rw)

/dev/sda6 on /usr type jfs (rw)

/dev/sda7 on /var type jfs (rw)

/dev/sda8 on /opt type jfs (rw)

/dev/sda9 on /diskless type jfs (rw)

/dev/sda10 on /tmp type jfs (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)

nfsd on /proc/fs/nfs type nfsd (rw,noexec,nosuid,nodev)

```

Any ideas?Last edited by Wizumwalt on Tue Dec 23, 2008 4:54 pm; edited 2 times in total

----------

## theotherjoe

try to add rw flag to your pxelinux.cfg file, see if that changes anything:

```

DEFAULT /bzImage 

APPEND ip=dhcp root=/dev/nfs rw nfsroot=10.0.0.10:/diskless/10.0.1.1 

```

----------

## hpeters

 *Wizumwalt wrote:*   

> 
> 
> My pxelinux.cfg node file.
> 
> ```
> ...

 

Try

DEFAULT /bzImage

APPEND ip=dhcp rw root=/dev/nfs nfsroot=10.0.0.10:/diskless/10.0.1.1

in your pxelinux.cfg

Not sure that is exactly right as I haven't done it in a while.

Read write access needs to set at the kernel command line.

The rw option in the nfs mount options is ignored on root.

You should also set all your nfs mount options here for root as well. The

one's in fstab are ignored. 

Harley

----------

## Hu

What are the errors?  As best I can tell, you have not shown anything which is clearly wrong.

Also, if you believe / is mounted read-only, it is better to nl /proc/mounts than to mount, since mount may display stale data when / is read-only.

----------

## Wizumwalt

So I added the 'rw' in the pxelinux.cfg file .

```

DEFAULT /bzImage

APPEND ip=dhcp root=/dev/nfs rw nfsroot=10.0.0.10:/diskless/10.0.1.1

```

But I'm still seeing the same problems. My other file systems like /usr, /var, /opt, etc... aren't being mounted and their directories are empty. One thing I've noticed when the node boots is that it's (root fs) still being mounted read-only.

I must have something wrong.

----------

## hpeters

This works for me.

MASTER:

/etc/exports

# Diskless exports.

/mnt/diskless/htpc 192.168.1.50(sec=sys,rw,sync,no_subtree_check,no_root_squash)

pxelinux.cfg

DEFAULT /htpc/boot/bzImage

APPEND ip=dhcp rw rootfstype=nfs root=/dev/nfs nfsroot=192.168.1.100:/mnt/diskless/htpc,rsize=32768,wsize=32768,intr,nolock,nfsvers=3,acregmin=2,acregmax=3,acdirmin=3,acdirmax=3,tcp

Slave:

fstab

192.168.1.100:/mnt/diskless/htpc        /                                       nfs             sec=sys,hard,intr,rw,nolock,rsize=32768,wsize=32768,nfsvers=3,actimeo=1,tcp             0 0

I just tested this and worked fine.

Harley

----------

## Wizumwalt

I gave that a try (and it's all very comparable to what I currently have), but I'm still getting the same problems. Only the / fs is being mounted, and mounted read only.

My filesystem is of type JFS on the master.

----------

## hpeters

 *Wizumwalt wrote:*   

> I gave that a try (and it's all very comparable to what I currently have), but I'm still getting the same problems. Only the / fs is being mounted, and mounted read only.
> 
> My filesystem is of type JFS on the master.

 

Can you give us the ouput of cat /proc/mounts.

Harley

----------

## theotherjoe

this guy talks about similar behaviour wrt to root filesystem

http://therowes.net/~greg/2007/07/31/debian-and-nfs-root-filesystems/

maybe it helps...

edit:

```

DEFAULT /bzImage 

APPEND ip=dhcp root=/dev/nfs nfsroot=10.0.0.10:/diskless/10.0.1.1,nolock

```

----------

## Wizumwalt

Here's a 'cat /proc/mounts' from the node.

```

# cat /proc/mounts

rootfs / rootfs rw 0 0

/dev/root / nfs ro,vers=2,rsize=4096,wsize=4096,namlen=255,hard,nointr,nolock,proto=udp,timeo=11,retrans=2,sec=sys,mountproto=udp,addr=10.0.0.10 0 0

proc /proc proc rw,nosuid,nodev,noexec 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0

udev /dev tmpfs rw,nosuid,size=10240k,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0

usbfs /proc/bus/usb usbfs rw,nosuid,noexec 0 0

```

----------

## nativemad

https://forums.gentoo.org/viewtopic-t-719501-highlight-.html

It seems to be a bug in /etc/init.d/checkroot....

just remove the ro-remount at the beginning of it!  :Wink: 

Cheers!

----------

## Wizumwalt

I changed the /etc/init.d/checkroot file to use a mount 'rw' option instead of the 'ro' as shown in that bug report and some of the msgs of read-only went away when the node booted. But if I try a 'touch afile' on the / fs, it still tells me it's read only.

I think the biggest problem I have right now is that /usr, var/, /opt, etc... (all separate partitions) aren't being mounted at all. Does anyone have an idea on what to try to get all my filesystems mounted on the node via NFS. The /etc/exports and other files I've posted. I can't tell what could be wrong.

Towards the very end of my nodes dmesg output, there's a line like ...

```

Root-NFS: unknown option: rw

```

----------

## Wizumwalt

I ran this command on the node ...

```

mount -n -o remount /

```

And / is now rw as I can do a 'touch filename' in / and it writes.

I then did ...

```

$ mount 10.0.0.10:/usr /usr

mount.nfs; rpc.statd is not running but is required for remote locking.

mount.nfs: Either use '-o nolock' ot keep locks local, or start statd.

```

But I was able to mount the partitions w/ 'mount /usr'. 

But I still can't figure out why they're not mounting automatically when booted.

----------

## newtonian

I had the same problem when I upgraded the kernel.

2.6.26-gentoo-r4 booted without any problems but linux-2.6.30-gentoo-r4 fails when it tries to mount the nfs root filesystem as read/write.

I had to make the following change in /etc/init.d/checkroot

```
#               mount -n -o remount,rw / &> /dev/null

                mount -n -o remount,rw master:/diskless/myclientroot /
```

where myclientroot is the folder that contains the root for my diskless client.

Now my diskless client mounts its root filesystem automatically on boot.

Hope this helps.

Cheers,

----------

