Article 5K4J6 PXE nfsroot ignoring "%s"

PXE nfsroot ignoring "%s"

by
ThePulsar
from LinuxQuestions.org on (#5K4J6)
Hello all,

I have an issue with PXE boot when it comes to handling several clients.

I can get it working -no problem- if I share the same NFS folder for all clients that I set in read-only to avoid concurrency issues. However, this generates a lot of errors and warning by the OS. Fortunately, according to the documentation nfsroot.txt it should be possible to include "%s" in the directory name to have it substituted by the client IP address:

Quote:
nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
If the `nfsroot' parameter is NOT given on the command line, the default
"/tftpboot/%s" will be used.
<server-ip>Specifies the IP address of the NFS server. If this field
is not given, the default address as determined by the
`ip' variable (see below) is used. One use of this
parameter is for example to allow using different servers
for RARP and NFS. Usually you can leave this blank.
<root-dir>Name of the directory on the server to mount as root. If
there is a "%s" token in the string, the token will be
replaced by the ASCII-representation of the client's IP
address.
so I tried:

Code:APPEND root=/dev/nfs initrd=initrd.img-4.19.0-10-amd64 nfsroot=10.0.0.1:/tftpdboot/%s,rw ip=dhcp rwI also tried adding a trailing / and using \%s but without success. I get an error that the NFS drive does not exist and when I look journalctl I see that %s is never substituted but appears as-is. I checked nfsroot.c and I see no conditional branching that would suggest some env flags would be required for the substitution to occur.

Does anybody have experience in using %s with nfsroot ? Any suggestion ?

I'm running debian 4.19.0-10 (AMD64) on both the client & server. They are inside VirtualBox at the moment. Note again that the PXE boot itself is working, I just have issue when I try to use the %s option.

Final note: documentation also says that if no nfsroot parameter is given, default is /tftpdboot/%s. However, when I omit it I get an error that no nfsroot parameter is given and it does not work either.latest?d=yIl2AUoC8zA latest?i=tjCITmtwS9k:Zzvn_63ZmoU:F7zBnMy latest?i=tjCITmtwS9k:Zzvn_63ZmoU:V_sGLiP latest?d=qj6IDK7rITs latest?i=tjCITmtwS9k:Zzvn_63ZmoU:gIN9vFwtjCITmtwS9k
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments