This question may be simple but I couldn't figure out and was stuck here for the whole day already. Any suggestions are appreciated.
I have two boxes, one as the server and other one running as the client.
Server running Ubuntu 11.04, root fs on LVM2 logical volume, static IP 192.168.2.20. After installing the clean system I copied the complete root partition to another LV, say /dev/data/root. All files are under /nfsroot folder on that LV. I made two snapshot of /dev/data/root (with lvcreate -s) as /dev/data/master and /dev/data/node1. I mounted these two LVs on the server as /mnt/{master,node1} and created both /mnt/master/nfsroot/master and /mnt/node1/nfsroot/node1 files so I won't get lost. Then I shared both two mounts via NFS (nfs-kernel-server) as
/mnt/master/nfsroot 192.168.2.0/24(rw,no_root_squash,async,insecure,no_subtree_check)
/mnt/node1/nfsroot 192.168.2.0/24(rw,no_root_squash,async,insecure,no_subtree_check)
I mounted these NFS shares and saw the right files in the right place.
I then installed other components for networking boot following Diskless Ubuntu Howto https://help.ubuntu.com/community/DisklessUbuntuHowto. My PXElinux config for box 2 is
DEFAULT linux
LABEL linux
KERNEL vmlinuz-2.6.38-8-server
APPEND root=/dev/nfs initrd=initrd.img-2.6.38-8-server nfsroot=192.168.2.20:/mnt/node1/nfsroot ip=dhcp rw
Box 2 was boot successfully but when I looked at / I saw /master file. I checked /proc/cmdline and nfsroot was
nfsroot=192.168.2.20:/mnt/node1/nfsroot
and mount | grep ' / '
also shows 192.168.2.20:/mnt/node1/nfsroot
I then mount both shared on box 2 under /mnt/{master,node1}. Even when mounting different server shares, two filesystems appears to be mapped to the same (master) share on the server.
Any one have any ideas why?
For a image of screen shot describing the problem please see http://ww3.sinaimg.cn/large/64b3c41egw1do3ftklgshj.jpg
Best Answer
In case anyone come for an answer, I would like to put my fix here.
I got around this problem by changing from nfs-kernel-server to unfsd. Without changing anything in the PXE configuration or on the client the problem disappeared.
Didn't try Fox's fix for fsid though.