unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Recovering from a bad installation
@ 2017-08-05  8:48 Ricardo Wurmus
  2017-08-05  8:55 ` Jan Nieuwenhuizen
  2017-08-05 22:19 ` Mark H Weaver
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2017-08-05  8:48 UTC (permalink / raw)
  To: guile-devel

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] 3+ messages in thread

* Re: Recovering from a bad installation
  2017-08-05  8:48 Recovering from a bad installation Ricardo Wurmus
@ 2017-08-05  8:55 ` Jan Nieuwenhuizen
  2017-08-05 22:19 ` Mark H Weaver
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Nieuwenhuizen @ 2017-08-05  8:55 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guile-devel

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?

janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com



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

* Re: Recovering from a bad installation
  2017-08-05  8:48 Recovering from a bad installation Ricardo Wurmus
  2017-08-05  8:55 ` Jan Nieuwenhuizen
@ 2017-08-05 22:19 ` Mark H Weaver
  1 sibling, 0 replies; 3+ messages in thread
From: Mark H Weaver @ 2017-08-05 22:19 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guile-devel

Ricardo Wurmus <rekado@elephly.net> writes:
> Hi Guix,

Wrong mailing list :)

    Mark



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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-05  8:48 Recovering from a bad installation Ricardo Wurmus
2017-08-05  8:55 ` Jan Nieuwenhuizen
2017-08-05 22:19 ` Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).