Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
diskless client not mounting NFS filesystems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Sat Dec 20, 2008 7:34 pm    Post subject: diskless client not mounting NFS filesystems Reply with quote

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 ...
Code:

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.
Code:

/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.
Code:

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.
Code:

# 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.
Code:

# 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
Back to top
View user's profile Send private message
theotherjoe
Guru
Guru


Joined: 22 Nov 2003
Posts: 393

PostPosted: Sun Dec 21, 2008 8:28 am    Post subject: Reply with quote

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

DEFAULT /bzImage
APPEND ip=dhcp root=/dev/nfs rw nfsroot=10.0.0.10:/diskless/10.0.1.1
Back to top
View user's profile Send private message
hpeters
n00b
n00b


Joined: 26 Sep 2003
Posts: 68

PostPosted: Sun Dec 21, 2008 5:04 pm    Post subject: Re: diskless client not mounting NFS filesystems Reply with quote

Wizumwalt wrote:

My pxelinux.cfg node file.
Code:

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.
[code]


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
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23407

PostPosted: Mon Dec 22, 2008 4:52 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Mon Dec 22, 2008 3:45 pm    Post subject: Reply with quote

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

Code:

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.
Back to top
View user's profile Send private message
hpeters
n00b
n00b


Joined: 26 Sep 2003
Posts: 68

PostPosted: Mon Dec 22, 2008 5:13 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Mon Dec 22, 2008 5:44 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
hpeters
n00b
n00b


Joined: 26 Sep 2003
Posts: 68

PostPosted: Mon Dec 22, 2008 6:24 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
theotherjoe
Guru
Guru


Joined: 22 Nov 2003
Posts: 393

PostPosted: Mon Dec 22, 2008 6:56 pm    Post subject: Reply with quote

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:
Code:

DEFAULT /bzImage
APPEND ip=dhcp root=/dev/nfs nfsroot=10.0.0.10:/diskless/10.0.1.1,nolock
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Tue Dec 23, 2008 12:21 am    Post subject: Reply with quote

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

Code:

# 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
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Tue Dec 23, 2008 6:30 am    Post subject: Reply with quote

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!
_________________
Power to the people!
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Tue Dec 23, 2008 4:35 pm    Post subject: Reply with quote

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 ...

Code:

Root-NFS: unknown option: rw
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Wed Dec 24, 2008 5:24 pm    Post subject: Reply with quote

I ran this command on the node ...
Code:

mount -n -o remount /


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

I then did ...
Code:

$ 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.
Back to top
View user's profile Send private message
newtonian
Guru
Guru


Joined: 19 Jan 2005
Posts: 465
Location: Hokkaido Japan

PostPosted: Sun Aug 30, 2009 2:33 pm    Post subject: this worked for me Reply with quote

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

Code:
#               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,
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum