Bug 74352 - NFSCLIENT and booting to an mfsroot via TFTP are mutually exclusive
Summary: NFSCLIENT and booting to an mfsroot via TFTP are mutually exclusive
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 6.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-25 02:30 UTC by Erik Norgaard
Modified: 2024-10-08 17:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Norgaard 2004-11-25 02:30:23 UTC
I am trying to set up a jumpstart server using dhcp/tftp/ftp and _not_ nfs
to automate installation. There are multiple problems, but they seem related.

In short: The kernel insists on mounting a nfs root device rather than the
provided memory disk.

This happens although:

1) I specify in loader.conf that it should use a memory file system as root
   device (the file is fetched succesfully with tftp).
2) I exclude "option nfs_root" from the kernel configuration file

It does not happen if:

1) I exclude "option nfsclient" from the kernel configuration file. 

BUT: Then the kernel fails to initialise the network device (over which the 
kernel was fetched) even though the network device driver is compiled into the
kernel.

Compiling a kernel with/-out "option BOOTP" does not change the result.

When disabling nfsclient in the kernel, the boot messages does show that the
kernel initialises the second interface vr1, but I cannot manually select it
and I cannot manually configure vr0. There is no problem initializing the
interface when NFSCLIENT is enabled. Also, I have previously had FreeBSD 4.10
installed and both interfaces up working.

The server is running FreeBSD 6.0-CURRENT revision 199506. I have built
the kernel and base system for the client from source, both RELENG_5 (nov 23) 
and -CURRENT (nov 25) as follows:

  make buildworld
  make -DLOADER_TFTP_SUPPORT=YES KERNCONF=PXE buildkernel
  make KERNCONF=PXE DESTDIR=/usr/nclt installkernel
  make DESTDIR=/usr/nclt installworld

More information: I first reported my problems on the freebsd-questions 
mailing list, less structured. All the custom files I have created are 
available with the guide I wrote along the way: www.daemonsecurity.com/pxe/

How-To-Repeat: 
I have described the full process in detail here www.daemonsecurity.com/pxe/. 
Assuming you have the environment setup for pxeboot and no nfsexports:

Update the sources, and build the kernel as described above with the following
options in the kernel configuration file:

   # Filesystems
   options         MD_ROOT         # MD is a potential root device
   options         PSEUDOFS        # Pseudo-filesystem framework

   # Memory pseudo devices
   device          mem             # Memory and kernel memory devices
   device          md              # Memory "disks" needed for root file system

Repeat with/-out:

   options         NFSCLIENT
Comment 1 Erik Norgaard 2004-11-25 10:15:59 UTC
I described to problems, they shouldn't be related and I finally
understood that they are not:

1) NFSCLIENT in the kernel config will override attempts to use a memory
file as root device

2) Disabling NFSCLIENT made the booting interface unavailable after
mounting the memory disk device

Problem 1 is still there - however 2 was a problem with my memory file
system. I created a new bare one just capable of running ifconfig and
both interfaces show up allthough not configured.

Since 2 is not a bug there is a fix to 1, namely disabling NFSCLIENT.

Erik
-- 
Ph: +34.666334818                                  web: www.locolomo.org
S/MIME Certificate: http://www.locolomo.org/crt/2004071206.crt
Subject ID:  A9:76:7A:ED:06:95:2B:8D:48:97:CE:F2:3F:42:C8:F2:22:DE:4C:B9
Fingerprint: 4A:E8:63:38:46:F6:9A:5D:B4:DC:29:41:3F:62:D3:0A:73:25:67:C2
Comment 2 Erik Norgaard 2005-01-16 13:55:49 UTC
Please close this problem-report.

I have come to the conclusion that it was a 42cm error :-) the 
observations may be added to the documentation though.

Thanks, Erik
-- 
Ph: +34.666334818                                  web: www.locolomo.org
S/MIME Certificate: http://www.locolomo.org/crt/2004071206.crt
Subject ID:  A9:76:7A:ED:06:95:2B:8D:48:97:CE:F2:3F:42:C8:F2:22:DE:4C:B9
Fingerprint: 4A:E8:63:38:46:F6:9A:5D:B4:DC:29:41:3F:62:D3:0A:73:25:67:C2
Comment 3 Xin LI freebsd_committer freebsd_triage 2005-01-16 15:12:33 UTC
State Changed
From-To: open->closed

Close on submitter's request 


Comment 4 Xin LI freebsd_committer freebsd_triage 2005-01-16 15:12:33 UTC
Responsible Changed
From-To: freebsd-bugs->delphij

Take so there's someone to be contacted if this is wrong :-)
Comment 5 randyb 2005-02-16 04:34:59 UTC
This problem still exists in that NFSCLIENT and booting to an mfsroot 
via TFTP are mutually exclusive.  I know it's not a common 
configuration; however, if one were to run say a bunch of embedded 
diskless systems in a computational cluster it would be useful.  The 
exact position I find myself in.  The problem is that I need a kernel 
that allows me to load up mfsroot via TFTP and then mount NFS shares 
from servers with data to be processed.

I believe this bug should still be open.  There isn't really any reason 
for NFS/MFS roots to be mutually exclusive.


--Randy


| Randy L Bias  www.kozoru.com   randyb-at-kozoru-dot-com
| Director, Product Management                 913.831.2929x26
| Private:                                    randyb-at-randybias.com
Comment 6 Erik Norgaard 2005-02-17 22:03:12 UTC
OK, sorry about my own confusion, maybe due to the fact that I initially 
reported two problems I thought was related but turned out not to be.

The inclusion of NFSCLIENT should not imply NFS_ROOT and should not 
exclude MD_ROOT. Nor MD_ROOT and NFS_ROOT need be mutually exclusive, 
since in both cases the root device can be specified on boot - but I 
think it's ok only to allow only one.

For the setup in which Randy mentions, I don't think that NFSCLIENT in 
the kernel is strictly required, although without it gets a bit more 
cumbersome.

You can enable nfs mounts by loading the kernel module nfsclient.ko 
which can be conveniently placed on the memory disk - for diskless 
clients, the module is loaded by /etc/rc.d/nfsclient if it is not 
supported by the kernel - I hope this solvess your problem.

However, if NFSCLIENT implies NFS_ROOT then it must be documented.

In short, there is a workaround, so this is not a critical problem.

Cheers, Erik
-- 
Ph: +34.666334818                           web: http://www.locolomo.org
S/MIME Certificate: http://www.locolomo.org/crt/2004071206.crt
Subject ID:  A9:76:7A:ED:06:95:2B:8D:48:97:CE:F2:3F:42:C8:F2:22:DE:4C:B9
Fingerprint: 4A:E8:63:38:46:F6:9A:5D:B4:DC:29:41:3F:62:D3:0A:73:25:67:C2
Comment 7 Xin LI freebsd_committer freebsd_triage 2005-02-18 02:17:11 UTC
State Changed
From-To: closed->open

Reopen, so we won't lose the useful information in audit trial. 


Comment 8 Xin LI freebsd_committer freebsd_triage 2005-02-18 02:17:11 UTC
Responsible Changed
From-To: delphij->freebsd-bugs

Not before I have time to take a deeper look into this.
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2005-10-25 02:59:46 UTC
State Changed
From-To: open->suspended

Re-title this with an appropriate Synopsis.  Submitter (and further 
correspondants) note that even though this is not a common setup, it 
"ought to work". 

Mark as suspended because no solution is known and no-one seems to 
be actively working on this.
Comment 10 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:50:03 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"
Comment 11 Ed Maste freebsd_committer freebsd_triage 2024-10-08 17:26:48 UTC
The earlier reports are specific instances of a general issue, namely that if NFS root fs metadata is provided to the kernel the kernel makes use of it, with no way to override or choose a different root fs.

I've encountered a similar situation where I want to use TFTP/NFS for the loader + kernel, but then use a filesystem on an NVMe device as the root fs.