Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Feb 2005 15:22:37 +0100
From:      cpghost@cordula.ws
To:        freebsd-questions@freebsd.org
Subject:   Diskless NFS mounts weirdness
Message-ID:  <20050215142237.GC56849@fw.farid-hajji.net>

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

I've set up a pool of diskless workstations loosely following
the instructions in

  http://www.onlamp.com/pub/a/bsd/2004/09/30/diskless_clients.html

Everything runs just fine, except for one weirdness with mount and
/var:

% mount
192.168.122.1:/var/diskless_ro on / (nfs, read-only)
devfs on /dev (devfs, local)
192.168.122.1:/pool/diskless_rw/192.168.122.11/etc on /etc (nfs)
/dev/md0 on /var (ufs, local, soft-updates)
192.168.122.1:/pool/diskless_rw/192.168.122.11/tmp on /tmp (nfs)
192.168.122.1:/pool/diskless_rw/home on /home (nfs)

1. /var *is* actually mounted on 
   192.168.122.1:/pool/diskless_rw/192.168.122.11/var
   but it is not listed in mount(8)s output. Why?

2. Which part of the system created /dev/md0 and mounted that
   on /var? I don't need that and would like to save some RAM
   anyway.

It is possible to manually mount /var after booting the workstation,
though it doesn't seem to be necessary. All this does is add one line
to mount's output:

# mount /var
% mount
192.168.122.1:/var/diskless_ro on / (nfs, read-only)
devfs on /dev (devfs, local)
192.168.122.1:/pool/diskless_rw/192.168.122.11/etc on /etc (nfs)
/dev/md0 on /var (ufs, local, soft-updates)
192.168.122.1:/pool/diskless_rw/192.168.122.11/tmp on /tmp (nfs)
192.168.122.1:/pool/diskless_rw/home on /home (nfs)
192.168.122.1:/pool/diskless_rw/192.168.122.11/var on /var (nfs)

More details:
-------------

The first rc script to run is:

----------------------------------------
server# cat /var/diskless_ro/etc/rc
#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin; export PATH

boot_ip=`kenv boot.netif.ip`
mount -t nfs 192.168.122.1:/pool/diskless_rw/${boot_ip}/var /var
mount -t nfs 192.168.122.1:/pool/diskless_rw/${boot_ip}/etc /etc
mount -t nfs 192.168.122.1:/pool/diskless_rw/${boot_ip}/tmp /tmp
mount -t nfs 192.168.122.1:/pool/diskless_rw/home /home

. /etc/rc2

exit 0
----------------------------------------

We see that /var is (or should be) mounted from the NFS server.

This is then followed by rc2, which is nothing more than a copy
of the regular /etc/rc, adapted for every single diskless client.

Every client has its own fstab, e.g.:

server# cat /pool/diskless_rw/192.168.122.11/etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
192.168.122.1:/var/diskless_ro  /               nfs     ro              0       
0
192.168.122.1:/pool/diskless_rw/192.168.122.11/etc     /etc    nfs     rw      
0       0
192.168.122.1:/pool/diskless_rw/192.168.122.11/var     /var    nfs     rw      
0       0
192.168.122.1:/pool/diskless_rw/192.168.122.11/tmp     /tmp    nfs     rw      
0       0
192.168.122.1:/pool/diskless_rw/home   /home   nfs     rw      0       0

All this is not terribly important (as said, everything works just
fine), but if someone has already experimented with diskless
workstations... :)

Thanks,
-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/



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