all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Fwd: Recovering from a bad installation
       [not found] <87shh6xuwp.fsf@elephly.net>
@ 2017-08-05 17:27 ` Ricardo Wurmus
       [not found] ` <87zibee6m5.fsf@gnu.org>
  1 sibling, 0 replies; 2+ messages in thread
From: Ricardo Wurmus @ 2017-08-05 17:27 UTC (permalink / raw)
  To: guix-devel

I previously sent this to guile-devel by accident.

Ricardo Wurmus <rekado@elephly.net> writes:

> Hi Guix,
>
> If you forgot to set the file system label for the root file system to the
> label you specified in the operating system configuration file then you won't
> be able to boot.  Instead you'll end up in a recovery Guile REPL.
>
> Here's what I did when I found myself in this very situation:
>
> --8<---------------cut here---------------start------------->8---
> ,use (ice-9 ftw)
> ,use (srfi srfi-1)
> ,use (gnu build file-systems)
>
> ;; Mount the root file system by device handle
> (mount-file-system '("/dev/sda1" any "/" "ext4" () #f #f) #:root "/")
>
> ;; Oops!  We lost /dev!  Let's find the "mount" tool.
> (filter (lambda (f) (string-contains f "util-linux")) (scandir "/gnu/store"))
>
> ;; … pick out the directory that looks right
>
> ;; Mount /dev
> (system* "/gnu/store/6z06w9zfnq3zcr50vcv2wvzr5wpzvy7l-util-linux-2.29.2/bin/mount" "-t" "devtmpfs" "none" "/dev")
>
> ;; Find e2label
> (filter (lambda (f) (string-contains f "e2fsprogs")) (scandir "/gnu/store"))
>
> ;; … pick out the directory that looks right
>
> ;; Use it to change the label on /dev/sda1
> (system* "/gnu/store/jh49klm0gkns071jsa8f9jr7g3cdlfwz-e2fsprogs-1.43.4/sbin/e2label" "/dev/sda1" "my-root")
>
> ;; reboot!
> --8<---------------cut here---------------end--------------->8---


-- 
Ricardo
  
  GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
  https://elephly.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Recovering from a bad installation
       [not found] ` <87zibee6m5.fsf@gnu.org>
@ 2017-08-05 17:29   ` Ricardo Wurmus
  0 siblings, 0 replies; 2+ messages in thread
From: Ricardo Wurmus @ 2017-08-05 17:29 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel

[- guile-devel, +guix-devel], sorry!

Jan Nieuwenhuizen <janneke@gnu.org> writes:

> Ricardo Wurmus writes:
>
>> If you forgot to set the file system label for the root file system to the
>> label you specified in the operating system configuration file then you won't
>> be able to boot.
>
> What about adding a check if / can be mounted before installing Grub?

Yes, I think it would be good to somehow verify that the system can
actually be initialised as requested.  This might be a little
complicated with mapped devices, however.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-05 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87shh6xuwp.fsf@elephly.net>
2017-08-05 17:27 ` Fwd: Recovering from a bad installation Ricardo Wurmus
     [not found] ` <87zibee6m5.fsf@gnu.org>
2017-08-05 17:29   ` Ricardo Wurmus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.