Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2016 08:14:03 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        BERTRAND =?ISO-8859-1?Q?Jo=EBl?= <joel.bertrand@systella.fr>, freebsd-hackers@freebsd.org
Subject:   Re: Diskless workstation and some minor issues
Message-ID:  <1461075243.1232.9.camel@freebsd.org>
In-Reply-To: <57163991.4000100@systella.fr>
References:  <57163991.4000100@systella.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2016-04-19 at 15:58 +0200, BERTRAND Joël wrote:
> 	> Hello,
> 
> 	> I have installed a diskless workstation (10.2-RELEASE-p14) that mounts 
> its rootfs from a NetBSD nfs server. My fstab is :
> 
> root@pythagore:~ # cat /etc/fstab
> # Device        Mountpoint      FStype  Options Dump    Pass#
> 192.168.10.128:/srv/pythagore   /       nfs     nfsv3,tcp,soft,intr,rw 
> 0      0
> ...
> 192.168.10.128:/home            /home   nfs     nfsv3,tcp,soft,intr,rw 
> 0      0
> root@pythagore:~ #
> 
> 	> First question. I have installed this diskless workstation with an USB 
> stick. Now, FreeBSD kernel mounts rootfs over NFS. But in a first time, 
> it tries to mount usbus0 (!) :
> 
> Apr  9 10:48:00 pythagore kernel: Root mount waiting for: usbus2 usbus1 
> usbus0
> Apr  9 10:48:00 pythagore kernel: uhub0: 2 ports with 2 removable, self 
> powered
> Apr  9 10:48:00 pythagore kernel: uhub2: 2 ports with 2 removable, self 
> powered
> Apr  9 10:48:00 pythagore kernel: uhub1: 21 ports with 21 removable, 
> self powered
> Apr  9 10:48:00 pythagore kernel: Root mount waiting for: usbus2 usbus1 
> usbus0
> Apr  9 10:48:00 pythagore kernel: ugen0.2:  at usbus0
> Apr  9 10:48:00 pythagore kernel: ugen2.2:  at usbus2
> Apr  9 10:48:00 pythagore kernel: uhub3: 
> class 9/0, rev 2.00/0.00, addr 2> on usbus2
> Apr  9 10:48:00 pythagore kernel: ugen1.2:  at usbus1
> Apr  9 10:48:01 pythagore kernel: uhub4: 
> class 9/0, rev 2.00/0.00, addr 2> on usbus1
> Apr  9 10:48:01 pythagore kernel: Root mount waiting for: usbus2 usbus1 
> usbus0
> Apr  9 10:48:01 pythagore kernel: uhub4: 6 ports with 6 removable, self 
> powered
> Apr  9 10:48:01 pythagore kernel: uhub3: 8 ports with 8 removable, self 
> powered
> Apr  9 10:48:01 pythagore kernel: ugen0.3:  at usbus0
> Apr  9 10:48:01 pythagore kernel: ukbd0: 
> 0/0, rev 1.10/1.12, addr 2> on usbus0
> Apr  9 10:48:01 pythagore kernel: kbd2 at ukbd0
> Apr  9 10:48:01 pythagore kernel: Root mount waiting for: usbus0
> Apr  9 10:48:01 pythagore kernel: usbd_setup_device_desc: getting device 
> descriptor at addr 3 failed, USB_ERR_IOERROR
> Apr  9 10:48:01 pythagore kernel: Root mount waiting for: usbus0
> Apr  9 10:48:01 pythagore kernel: usbd_setup_device_desc: getting device 
> descriptor at addr 3 failed, USB_ERR_IOERROR
> Apr  9 10:48:01 pythagore kernel: Root mount waiting for: usbus0
> Apr  9 10:48:01 pythagore kernel: Root mount waiting for: usbus0
> Apr  9 10:48:01 pythagore kernel: usbd_setup_device_desc: getting device 
> descriptor at addr 3 failed, USB_ERR_IOERROR
> Apr  9 10:48:02 pythagore kernel: Root mount waiting for: usbus0
> Apr  9 10:48:02 pythagore kernel: usbd_setup_device_desc: getting device 
> descriptor at addr 3 failed, USB_ERR_IOERROR
> Apr  9 10:48:02 pythagore kernel: Root mount waiting for: usbus0
> Apr  9 10:48:02 pythagore kernel: Root mount waiting for: usbus0
> Apr  9 10:48:02 pythagore kernel: usbd_setup_device_desc: getting device 
> descriptor at addr 3 failed, USB_ERR_IOERROR
> Apr  9 10:48:02 pythagore kernel: ugen0.4:  at usbus0 
> (disconnected)
> Apr  9 10:48:02 pythagore kernel: uhub_reattach_port: could not allocate 
> new device
> Apr  9 10:48:02 pythagore kernel: Trying to mount root from 
> nfs:192.168.10.128:/srv/pythagore [nfsv3,tcp,soft,intr,rw]...
> Apr  9 10:48:02 pythagore kernel: NFS ROOT: 192.168.10.128:/srv/pythagore
> 
> 	> I don't understand why kernel tries to mount an USB rootfs... And I 
> haven't found how fix this trouble.
> 

At this point during booting, the system doesn't know what physical
device may hold the rootfs, so it waits until it has enumerated all the
devices on all the USB busses, in case one of them is required to mount
root (even in the NFS case, it could require a USB network device).

To disable this wait, put hw.usb.no_boot_wait=1 in loader.conf.

> 	Second trouble. /var/log/message contains a lot of :
> Apr  9 10:50:00 pythagore atrun[862]: cannot lock /var/at/jobs/: 
> Permission denied
> 
> 	> Of course, lockd and statd are running on nfs server. Permission on 
> /var/at are :
> 
> root@pythagore:/var/at # ls -al
> total 8
> drwxr-xr-x   4 root    wheel  512 Aug 12  2015 .
> drwxr-xr-x  28 root    wheel  512 Apr 15 09:14 ..
> drwxr-xr-x   2 daemon  wheel  512 Aug 12  2015 jobs
> drwxr-xr-x   2 daemon  wheel  512 Aug 12  2015 spool
> root@pythagore:/var/at #
> 
> 	> I don't understand where is the mistake.
> 

This is a more serious problem.  I have found it to be impossible to
run a diskless workstation with a persistant /var mounted via NFS
(either by itself or as a directory within the nfs rootfs).  It's been
this way for several years.  You can add varmfs=yes to your rc.conf to
get a working system, but then you have a non-persistant /var which
really isn't very useful.

Hmm, but the problems I usually have are with /var/run and pidfiles. 
 I've never noticed this /var/at problem (maybe just because I gave up
trying to run with an nfs-mounted /var before I noticed them).

> 	An third trouble, this workstation runs cupsd. When I send a job to 
> printer, cupsd run as expected but aborts after job is completed. In 
> /var/log/cups/error_log, I have :
> 
> E [19/Apr/2016:12:44:34 +0200] Unable to create 
> "/usr/local/etc/cups/printers.conf.N": Operation not permitted
> E [19/Apr/2016:12:45:12 +0200] Unable to create 
> "/var/cache/cups/job.cache.N": Operation not permitted
> E [19/Apr/2016:12:45:12 +0200] Unable to create 
> "/var/spool/cups/c00032.N": Operation not permitted
> 
> 	> I have checked permissions on directories (and config file) without any 
> result, but I have seen that permissions on /var/spool/cups are 
> overwrittem by cups (to drwx--x---).
> 

This one I can't help with at all, because I gave up on trying to get
printers to work on freebsd about 10 years ago and haven't had the
energy to ever try again. :(

-- Ian




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