Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
unable to mount root via NFSv4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
srd
n00b
n00b


Joined: 13 Apr 2010
Posts: 38

PostPosted: Fri Mar 06, 2015 8:45 pm    Post subject: unable to mount root via NFSv4 Reply with quote

I've been setting up a diskless node and though the console output flys too quickly during it's booting to where I am unable to see the error messages, I believe it's unable to mount the root fs via nfs. I think this because functions I see in the stack trace are:
mount_block_root
mount_root
prepare_namespace
kernel_init

The /diskless fs which resides on the master node (like the rest of the file systems on the master node) all reside over LMV2. So I'm wondering if I need to change anything because of this since it appears to not be able to mount root or find the block device correctly.

The /diskless/pxelinux.cfg file:
Code:

DEFAULT /gentoo-x86_64/boot/kernel-3.14.14-gentoo

APPEND ip=dhcp ro rootfstype=nfs root=/dev/nfs nfsroot=10.0.50.111:/diskless/gentoo-x86_64 init=/linuxrc


The /diskless/gentoo-x86_64/etc/fstab:
Code:

10.0.50.111:/diskless/gentoo-x86_64 / nfs sync,hard,intr,ro   0 0
10.0.50.111:/opt      /opt        nfs sync,hard,intr,rw   0 0
10.0.50.111:/home     /home       nfs sync,hard,intr,rw   0 0
10.0.50.111:/root     /root       nfs sync,hard,intr,rw   0 0


The masters /etc/fstab:
Code:

/dev/sda1       /boot       vfat        noauto,noatime  0 2
/dev/mapper/vg0-root    /       ext4        noatime     0 1
/dev/mapper/vg0-swap    none        swap        sw      0 0
/dev/mapper/vg0-home    /home       ext4        noatime     0 0
/dev/mapper/vg0-var /var        ext4        noatime     0 0
/dev/mapper/vg0-diskless /diskless  ext4        noatime     0 0
/dev/mapper/vg0-opt /opt        ext4        noatime     0 0
/dev/mapper/vg0-tmp /tmp        ext4        noatime     0 0
/dev/cdrom      /mnt/cdrom  auto        noauto,ro   0 0
/dev/fd0        /mnt/floppy auto        noauto      0 0


The masters /etc/exports file:
Code:

/diskless/gentoo-x86_64 10.0.0.0/16(sync,ro,no_subtree_check,no_root_squash,no_all_squash)
/opt    10.0.0.0/16(sync,rw,no_subtree_check,no_root_squash,no_all_squash)
/home   10.0.0.0/16(sync,rw,no_subtree_check,no_root_squash,no_all_squash)
/root   10.0.0.0/16(sync,rw,no_subtree_check,no_root_squash,no_all_squash)


Any help much appreciated.


Last edited by srd on Tue Mar 10, 2015 6:55 pm; edited 2 times in total
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Sat Mar 07, 2015 12:48 pm    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic-p-7592928.html#7592928
try adding the nfs version info
Back to top
View user's profile Send private message
srd
n00b
n00b


Joined: 13 Apr 2010
Posts: 38

PostPosted: Mon Mar 09, 2015 10:42 pm    Post subject: Reply with quote

I added vers=4 to the pxelinux.cfg/default boot arg, but still no good. Here's a bit more info on what I've done.

While trying to boot diskless nodes, the console output flies by too quickly, but here is the stack trace of what is left.
Code:

? panic
? panic
mount_block_root
mount_root
prepare_namespace
kernel_init_freeable
? do_early_param
? rest_init
kernel_init
ret_from_fork
? rest_init


I am thinking the problem is that it can't open or is unable to open the root file system via NFS. Here's what I've done for NFSv4. NFS client and server (vers 4+) support built into kernels.

pxelinux.cfg/default
Code:

DEFAULT /gentoo-x86_64/boot/kernel-3.14.14-gentoo

APPEND ip=dhcp ro rootfstype=nfs root=/dev/nfs rootdelay=10 nfsroot=10.0.0.11:/exports/gentoo-x86_64,vers=4,_netdev rootfstype=nfs init=/linuxrc


Virtual root directories on server.
Code:

mkdir /export
mkdir /export/gentoo-x86_64
mkdir /export/home
mkdir /export/opt
mkdir /export/root


Server /etc/fstab, added the following:
Code:

/home           /export/home    none        bind        0 0
/root           /export/root    none        bind        0 0
/opt            /export/opt none        bind        0 0
/diskless/gentoo-x86_64 /export/gentoo-x86_64 none  bind        0 0


Client /etc/fstab, added the following:
Code:

10.0.0.11:/diskless/gentoo-x86_64 /     nfs     rw,_netdev,auto         0 0
10.0.0.11:/opt          /opt            nfs     rw,_netdev,auto         0 0
10.0.0.11:/home         /home           nfs     rw,_netdev,auto         0 0
10.0.0.11:/root         /root           nfs     rw,_netdev,auto         0 0


Server /etc/exports
Code:

/export            10.0.0.0/16(rw,fsid=0,no_subtree_check)
/export/gentoo-x86_64   10.0.0.0/16(ro,no_subtree_check)
/export/opt        10.0.0.0/16(rw,nohide,insecure,no_subtree_check)
/export/home           10.0.0.0/16(rw,nohide,insecure,no_subtree_check)
/export/root           10.0.0.0/16(rw,nohide,insecure,no_subtree_check)


Server /etc/conf.d/nfs, edited the following line:
Code:

OPTS_RPC_NFSD="100 -V 4.2 -V 4.1 -V 4 -N 3 -N 2"


Server showmount command
Code:

$ sudo showmount -e myhost
Export list for myhost:
/export/root          10.0.0.0/16
/export/home          10.0.0.0/16
/export/opt           10.0.0.0/16
/export/gentoo-x86_64 10.0.0.0/16
/export               10.0.0.0/16


However, after all of this, I am still unable to see the diskless node boot, and believe it's failing while trying to mount the root file system via NFS.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13855

PostPosted: Tue Mar 10, 2015 12:06 am    Post subject: Reply with quote

Does the server receive any network traffic from the diskless client? Can you modify the diskless initramfs to drop to a shell on failure so that you can explore?
Back to top
View user's profile Send private message
srd
n00b
n00b


Joined: 13 Apr 2010
Posts: 38

PostPosted: Tue Mar 10, 2015 1:22 am    Post subject: Reply with quote

I'm pretty certain at this point that things haven't even entered the initramfs yet. One of the bootargs is "init=/linuxrc" and that script hasn't been started at this point, unless I'm interpreting the stack trace incorrectly, and I think its saying that it hasn't mounted the root fs. The only traffic that's happened so far is PXE booting to where the kernel has been tftp'd to the node and it's now 3 seconds into the boot and the kernel panics. I've got a pic of the stack trace around here somewhere's.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13855

PostPosted: Tue Mar 10, 2015 2:04 am    Post subject: Reply with quote

When an initramfs is used, that is always mounted and if a valid init is found, it is executed instead of mounting root. Usually, an initramfs will mount the real root filesystem and then switch_root to it.
Back to top
View user's profile Send private message
srd
n00b
n00b


Joined: 13 Apr 2010
Posts: 38

PostPosted: Tue Mar 10, 2015 6:38 pm    Post subject: Reply with quote

Ok, on second thought, I'm now editing this post as I don't think the initramfs is what I need.

DHCP tells the slave nodes where to get the initial file system. In this case, the kernel, then it downloads it, and then it boots the kernel. Normally an initramfs could tell the kernel what to mount, but in the case of mounting diskless nodes, I think NFS is how the rootfs gets mounted. I also have a boot arg for the init script where I do alot of other temp fs mounting. The Gentoo Diskless Wiki's don't use initram's in their configs, they mount via NFS. The pxelinux.cfg/default file is what I'm using to give the location of the linuxrc script (which by itself I didn't consider an initramfs). But now that I look at it more closely, even this doesn't mount root. Seems root is supposed to be mounted via NFS which my master exports (configs above). The more I think about it, I'm think my problem comes down to NFSv4 being the problem, can't seem to get it to work right.

I did add an initrams just like I have on the master node, and it did boot further (I didn't make enough changes), so even though that worked, I still don't think I need an initramfs on the slave node, so I removed it. Or maybe I do, but just not so complete as the master. Anyways, I'm thinking that mounting root via NFS is the prob.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13855

PostPosted: Wed Mar 11, 2015 1:26 am    Post subject: Reply with quote

Root on NFS can be done without an initramfs. If you choose to do it that way, then you must not have an initramfs (either embedded or from the bootloader), since having the initramfs causes the kernel to skip automatically mounting a separate root filesystem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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