From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: bug#22588: root: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY Date: Mon, 08 Feb 2016 08:49:24 -0500 Message-ID: <87twljjorf.fsf@netris.org> References: <874mdk2p40.fsf@netris.org> <87r3gnilmk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSmCb-0003N4-UY for bug-guix@gnu.org; Mon, 08 Feb 2016 08:50:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSmCY-00061d-M3 for bug-guix@gnu.org; Mon, 08 Feb 2016 08:50:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSmCY-00061Y-I2 for bug-guix@gnu.org; Mon, 08 Feb 2016 08:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aSmCY-0001dP-C6 for bug-guix@gnu.org; Mon, 08 Feb 2016 08:50:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87r3gnilmk.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 08 Feb 2016 10:42:27 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 22588@debbugs.gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Mark H Weaver skribis: > >> I've been bitten by this once before, and a user on #guix did as well. >> When there are problems in the root filesystem that fsck doesn't want to >> fix automatically, the user is dumped into a guile prompt where PATH is >> not set, and it's very inconvenient to run fsck manually. > > AFAICS, =E2=80=98PATH=E2=80=99 is set in =E2=80=98base-initrd=E2=80=99 in= (gnu system linux-initrd), and > =E2=80=98check-file-system=E2=80=99 in (gnu build file-systems) indeed ex= pects it to be > set. Ah, good! >> This is what I just suggested that the user type, with apologies: >> >> (use-modules (ice-9 ftw) (srfi srfi-26)) >> (define dirs (scandir "/gnu/store" (cut string-suffix? "e2fsprogs-1.42= .13" <>))) >> (define e2fsck (string-append "/gnu/store/" (car dirs) "/sbin/e2fsck")) >> (system* e2fsck "/dev/XXX") >> >> Is there a better way? > > I think one can run: > > (system* "fsck.ext4" "/foo/bar") Okay, this is much better than I expected. I asked the user to try running "e2fsck", and when it wasn't found in PATH, I incorrectly assumed that PATH wasn't set. > What about changing the message to explicitly mention this command? Sure, that would be helpful. >> Speaking from personal experience, it's very painful to do anything >> non-trivial in that REPL. Even just adding readline would help a lot. > > The statically-linked Guile in the initrd lacks Readline support. We > could maybe work around that, but the initrd would become much larger. Okay, nevermind then. >> We should probably also handle errors from fsck specially. > > Currently there=E2=80=99s no Bash in the initrd. Should we add one? Our > =E2=80=98bash-static=E2=80=99 package takes 1.4 MiB (I don=E2=80=99t thin= k we can make it > smaller.) I'm not sure it would help much without also adding 'coreutils'. Adding busybox might be worth considering, though. > Another idea that comes to mind: what about providing a =E2=80=9Cshell=E2= =80=9D language > in Guile? It would automatically tokenize what the user types in and > convert it to (system* =E2=80=A6), plus it would have a few built-in comm= ands > like =E2=80=98cd=E2=80=99 and =E2=80=98ls=E2=80=99. I like the idea of having something like this in Guile, but I'm not sure we should rush to implement a half-baked solution. When we have something decent along the lines of Scsh, then definitely! IMO, anyway, but I don't feel strongly about it. More thoughts? Thanks! Mark