Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Dec 2014 10:23:49 -0700
From:      Ian Lepore <ian@FreeBSD.org>
To:        Luiz Otavio O Souza <lists.br@gmail.com>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: single user mode?
Message-ID:  <1417886629.1064.96.camel@revolution.hippie.lan>
In-Reply-To: <CAB=2f8yRMZc3m18gWUE%2BP-b=moAhEpqEi2sF9DeXokpiExvOUA@mail.gmail.com>
References:  <201412051306.sB5D6otZ007591@mech-as221.men.bris.ac.uk> <CAB=2f8yRMZc3m18gWUE%2BP-b=moAhEpqEi2sF9DeXokpiExvOUA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2014-12-06 at 10:53 -0200, Luiz Otavio O Souza wrote:
> On 5 December 2014 at 11:06, Anton Shterenlikht wrote:
> > Is it possible to enter a single user mode
> > on arm 10.1-release?
> >
> > My disk, well.. the sd card, got corrupted,
> > so wanted to run fsck on it, but cannot
> > enter a single user mode. I ended up putting
> > the sd card into a laptop and running fsck there.
> > This fixed lots of panics, but is it possible
> > to enter the single user mode on arm, and
> > run fsck directly there?
> 
> If you are using RPi with official or crochet images then yes, you can
> force it to boot in single user mode and run fsck, but (and there
> always a but) you can only do that from serial console, the vt
> framebuffer starts too late to allow you to break into loader prompt.
> 
> And as others have said it is not clear if the semi-known bug affects
> armv6 (we can't yet say if is safe to fsck your disk on arm).

We need to not let this fsck problem grow into a bogus myth.

There is ABSOLUTELY NO EVIDENCE that there's anything wrong with fsck on
armv6.  Quite the opposite, I tested it extensively trying to find a
problem, using sdcard, usb thumb drives, SSD drives and hard drives in a
USB dock, and on md(4) filesystems.  I couldn't get a single failure of
any kind on armv6, even when purposely creating filesystem corruption
(such as pulling the usb cable while doing rsync to copy tons of files
to the drive).  fsck always correctly fixed any problems.

The only known problem with fsck on arm happens on armv5, and more
specifically on Marvell Kirkwood/Sheeva chipsets.  Maybe it happens on
other armv4/v5 systems, but I haven't been able to prove that yet.  The
recipe to create that problem is simple and 100% reproducible for me:
   mdconfig -a -t malloc -s64m
   newfs -U /dev/md0
   fsck -tffs /dev/md0
The filesystem is now corrupted.  fsck will report that it is "fixing"
errors on the newly-formatted filesystem, but in fact it corrupts the
clean filesystem.

Please lets not blow this up into 'fsck is broken on armv6' without
actual evidence of that.

BTW, I haven't yet in this thread seen the most straightforward answer
to the original question.  To force a boot to single user mode,
interrupt the boot countdown in ubldr and do

  set boot_single=1
  boot

You can do likewise with boot_verbose=1, and there are similar flags for
the other thing you're using to entering at the boot2 prompt on x86.

-- Ian





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