Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jun 2013 14:10:05 -0300
From:      Andrew Hamilton-Wright <ahamiltonwright@mta.ca>
To:        freebsd-questions@freebsd.org
Cc:        Polytropon <freebsd@edvax.de>
Subject:   Re: Boot hangs in single-user mode
Message-ID:  <B84448FB-3E53-4DA3-998B-37D49ABA29DE@mta.ca>
In-Reply-To: <20130606161824.4c45f579.freebsd@edvax.de>
References:  <D740464A-BDF9-4012-9629-D98383D0FB83@mta.ca> <20130606161824.4c45f579.freebsd@edvax.de>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

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.





Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?B84448FB-3E53-4DA3-998B-37D49ABA29DE>