Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Apr 2003 14:28:03 -0500 (CDT)
From:      Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
To:        freebsd-questions@freebsd.org
Subject:   question about diskless
Message-ID:  <20030418123246.W15059@Gina.esfm.ipn.mx>

next in thread | raw e-mail | index | archive | help

Hi list!

I finally made my diskless FreeBSD FreeBSD 5.0-RELEASE work.

I have some questions that you surely can answer.

1. While booting, FreeBSD-5.0 diskless boot scripts try to make
   an fsck on the network file systems that they are mounting.
   The system stops, asking for help and complains about the
   absence of    /usr/sbin/fsck_nfs.   Take a look

------------------------------------------------------------
Starting file system checks:
fsck: exec /usr/sbin/fsck_nfs for 192.168.123.112:/usr/diskless/rootfs: No
such file or directory
fsck: exec /usr/sbin/fsck_nfs for 192.168.123.112:/usr/diskless/rootfs: No
such file or directory
Unknown error; help!
Apr 18 11:52:10 init: /bin/sh on /etc/rc terminated abnormally, going to
single user mode
Enter full pathname of shell or RETURN for /bin/sh:
------------------------------------------------------------

** It must be noticed that /etc/rc.d/fsck is the script that
** tries to make the file system check.

   It makes no sense to me that it must to be done.
   Network file systems [or just directories!] are supposed
   to be working in another computer and I don't see why [and how]
   they have to be checked.   Am I right?

   I made a very simple script that says:

	========== fsck_nfs ==========
   	#!/bin/sh
	echo $0 $*
	exit 0
	==============================

   Of course, it makes nothing but displaying the command
   that was used to make fsck_nfs, its parameters, and
   returning no error.

   With this script I got:

------------------------------------------------------------
/sbin/fsck_nfs -p -F 192.168.123.112:/usr/diskless/rootfs
192.168.123.112:/usr/diskless/rootfs:
DEFER FOR BACKGROUND CHECKING
/sbin/fsck_nfs -p -F 192.168.123.112:/usr/diskless/rootfs/usr
192.168.123.112:/usr/diskless/rootfs/usr: DEFER FOR BACKGROUND CHECKING
/sbin/fsck_nfs -p -F 192.168.123.112:/usr/X11R6
192.168.123.112:/usr/X11R6: DEFER FOR BACKGROUND CHECKING
nfs: can't update /var/db/mounttab for 192.168.123.112:/usr/diskless/rootfs
------------------------------------------------------------

   and the booting process continues.  However, if you notice it,
   this script is located in /sbin not in /usr/sbin.

   The last line is also worth of consideration.  /var is still a
   read-only file system when all of this happens.



2. When the booting process starts, there is another problem if
   /etc/resolv.conf does not exist.  Before we begin we have to make
   some considerations.

   This is my configuration in my DHCP server:

=====================
ddns-update-style none;

subnet 192.168.123.0 netmask 255.255.255.0 {
        option domain-name "mydomain.mine";
        option domain-name-servers 192.168.123.112;
        option routers  192.168.123.254;
        default-lease-time 600;
        max-lease-time 7200;

        host Lucia {
                fixed-address  192.168.123.37;
                hardware ethernet 00:03:47:19:c5:b1;
                option root-path "192.168.123.112:/usr/diskless/rootfs";
                option host-name "Lucia.mydomain.mine";
                filename "/boot/pxeboot";
        }
}
======================

   I could not understand why I have to set explicitly:

		 option host-name "Lucia.mydomain.mine";

   inside the entry of "Lucia".  Ok, I don't care, it is already set.

   Now, suppose that /etc/resolv.conf does not exist in the diskless
   file system.  In /etc/rc.d/initdiskless, lines 129-140:

    130 # if the info is available via dhcp/kenv
    131 # build the resolv.conf
    132 #
    133 if [ ! -e /etc/resolv.conf ]; then
    134         echo domain `kenv dhcp.domain-name` > /etc/resolv.conf
    135
    136         set `kenv dhcp.domain-name-servers`
    137         for ns in `IFS=','; echo $*`; do
    138                 echo nameserver $ns >> /etc/resolv.conf;
    139         done
    140 fi

  line 133 asks if /etc/resolv.conf does not exist.  It is our case.
  Now, line 134 asks for dhcp.domain-name variable and tries to write
  "domain "  and the value of this variable in /etc/resolv.conf

  The problem here is that diskless root file system is still read-only.

===========
kenv: unable to get dhcp.domain-name
/etc/rc.d/initdiskless: cannot create /etc/resolv.conf: Read-only file
system
===========

   Well, as you can see this is not the only problem.  "kenv"  does not
   have "dhcp.domain-name".   Perhaps I am making something wrong in
   my DHCP configuration, if so, please, let me know.

   Of course, the obvious solution is to create /etc/resolv.conf and
   forgive this matter.

   But, if you print the kernel environment variables [kenv], none of them
   begins with  "dhcp."


I hope you can help me.
Thanks in advance.

		Eduardo




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030418123246.W15059>