From owner-freebsd-questions@FreeBSD.ORG Mon Jun 24 17:10:12 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3BC9954 for ; Mon, 24 Jun 2013 17:10:12 +0000 (UTC) (envelope-from ahamiltonwright@mta.ca) Received: from smtpy.mta.ca (smtpy.mta.ca [138.73.1.143]) by mx1.freebsd.org (Postfix) with ESMTP id 9969A12C7 for ; Mon, 24 Jun 2013 17:10:12 +0000 (UTC) Received: from host-29-237.mta.ca ([138.73.29.237]:52269) by smtpy.mta.ca with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1UrAFK-0001bk-FB; Mon, 24 Jun 2013 14:08:06 -0300 Subject: Re: Boot hangs in single-user mode Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Andrew Hamilton-Wright In-Reply-To: <20130606161824.4c45f579.freebsd@edvax.de> Date: Mon, 24 Jun 2013 14:10:05 -0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20130606161824.4c45f579.freebsd@edvax.de> To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.1085) Cc: Polytropon X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2013 17:10:12 -0000 I have tracked down the issue. Not sure whether this is a PR issue or = not... On 2013-06-06, at 11:18 AM, Polytropon wrote: > On Thu, 6 Jun 2013 10:24:52 -0300, Andrew Hamilton-Wright wrote: >>=20 >> Strangely, it seems that I cannot boot single user, either >> using "boot -s" from the boot loader, or using the boot menu.=20 >> When I get to the point where the root filesystem is mounted, >> it hangs right after printing the message: >> Trying to mount root from ufs:/dev/ada0s1a >=20 > Have you tried hitting the RETURN key several times?=20 [ ... ] > It's important to identify if the system is _really_ hanging, > or if the message "just isn't visible"... This is indeed the crux of the issue. While hammering on the RETURN key = did not produce a prompt, it turns out that there was a prompt... At some time in the relatively distant past, I had configured this = machine to allow display to a serial console (long since disconnected) = by adding these lines to /boot/loader.conf=20 boot_multicons=3D"YES" boot_serial=3D"YES" comconsole_speed=3D"19200" console=3D"comconsole,vidconsole" My notes say "These came from the serial console setup page, and do work = for vt100", however I did not note exactly which man page they came = from, unfortunately. I do not see these lines on syscons(4), sio(4) or = dcons(4). Similar lines are mentioned in the handbook regarding setting up a = serial console (there is no mention of single-user mode here): = http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-se= tup.html The issue, as it relates to single-user mode, is essentially this: if = the system is configured to boot with multi-console options, then when = the single user prompt is printed, it is only printed on the "second" = console (which is also the only valid source of keyboard input) -- in = this case, the configured but unattached serial port. I'm not sure what the best strategy is here. Having only one console = that is accepting input for the single-user shell certainly makes sense. = The question is, which of potentially several consoles should it be? IMO, it would be better/clearer if (for i386/amd64 anyway) the console = was the one associated with the motherboard-based keyboard and video = card. An argument here would be that the [CTRL]-[ALT]-[DEL] sequence is = still valid when associated with this keyboard, so it does seem odd that = other input on that device is ignored. I can see arguments for other setups, also, mostly revolving around the = "why would you _have_ another console configured if you didn't need it, = so the configured console must therefore be the important one" -- though = the FreeBSD user base is certainly willing enough to experiment that I = am sure I am not the only person who set up multi-console for a "fun" = project. Perhaps the best strategy would be to add a message printed on all = consoles (as the rest of the boot information is) just before the prompt = is printed (singly) to let people know that this is happening? I'm not = sure if a way to 100% predict the desired console is possible. Thoughts? If figure I will put a PR in, so that at least this is = tracked, even if we don't change anything. I will reference this thread = in the PR, but if anyone has input as to what to suggest, I would = appreciate it. At the very least, the handbook should get updated to = indicate that this may happen. Andrew.