unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: david.larsson@selfhosted.xyz
To: "Svante v. Erichsen" <Svante.v.Erichsen@web.de>
Cc: 33517@debbugs.gnu.org
Subject: bug#33517: Problem booting when using btrfs subvolume for /gnu/store
Date: Sun, 3 Feb 2019 15:41:44 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1902031541340.55299@Librem13v3> (raw)
In-Reply-To: <20190126235945.GP9163@krustig.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2808 bytes --]

I also lack the experience with guile but it sounds very sensible to
me. I can confirm that just fixing the grub-menu entries with the
subvol path works. I have been invoking guix system reconfigure with a
bash script that in the end calls a grubfix function below with the
path to each newly generated grub.cfg:

In my case the subvol is located at /snap2_rw
function grubfix(){
         sudo sed -i "s/linux\ \/gnu/linux\ \/snap2_rw\/gnu/g" "$1"
         sudo sed -i "s/initrd\ \/gnu/initrd\ \/snap2_rw\/gnu/g" "$1"
         sudo sed -i "s/--set\ \/gnu/--set\ \/snap2_rw\/gnu/g" "$1"
}

Your suggestion to do this directly in config.scm sounds great.

Best regads,
David L

On Sun, 27 Jan 2019, Svante v. Erichsen wrote:

> The subvolume and the mount point are independent issues.
>
> For example, I have a subvolume named @ as root volume:
>
> (file-system
>  (device "/dev/mapper/hd")
>  (mount-point "/")
>  (type "btrfs")
>  (options "compress=lzo,ssd,subvol=@"))
>
> It also appears that the subvolume name must be prepended to the path as if it
> just was an ordinary directory (grub.cfg):
>
> …
>  linux /@/gnu/store/…
> …
>
> I could not yet confirm this from documentation, but it works like that for me.
> (I semi-manually edit the generated grub.cfg currently.)
>
> So, additionally to stripping the mount point, the subvolume needs to be
> prepended (grub.scm):
>
>  (let ((kernel (prepend-subvol device-subvol
>                                (strip-mount-point device-mount-point
>                                                   kernel)))
>        (initrd (prepend-subvol device-subvol
>                                (strip-mount-point device-mount-point
>                                                   initrd))))
>    …)
>
> This would mean that the menu-entry structure needs the subvol information.
> However, I wouldn't want to parse this from the options field in the file-system
> entry, so I'd propose allowing a list there, maybe like this:
>
> (file-system
>  (device "/dev/mapper/hd")
>  (mount-point "/")
>  (type "btrfs")
>  (options '(("compress" . "lzo")
>             "ssd"
>             ("subvol" . "@"))))
>
> On the other hand, it might be surprising that declaring the options like this
> would work for subvols, while using a string doesn't, especially when some older
> documentation/blogs/gists is still hanging around on the internet, so maybe it
> would be necessary to parse the options anyway (to this list structure).
>
> I'm lacking experience in guix and guile, so making this work and submit a patch
> will take me some time.
>
> Do you think this is sensible?
>
>
> -- 
> Svante von Erichsen
>
> GPG fingerprint: A78A D4FB 762F A922 A495  57E8 2649 9081 6E61 20DE
>

  reply	other threads:[~2019-02-03 14:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 20:27 bug#33517: Problem booting when using btrfs subvolume for /gnu/store Christopher Baines
2018-11-28 13:21 ` Ludovic Courtès
2018-12-01 17:48   ` Christopher Baines
2019-09-26  8:04     ` Maxim Cournoyer
2019-01-26 23:59 ` Svante v. Erichsen
2019-02-03 14:41   ` david.larsson [this message]
2019-09-06  1:16   ` Maxim Cournoyer
2020-05-20 13:31 ` Maxim Cournoyer
2020-05-20 19:46   ` Christopher Baines
2020-05-21  1:34     ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1902031541340.55299@Librem13v3 \
    --to=david.larsson@selfhosted.xyz \
    --cc=33517@debbugs.gnu.org \
    --cc=Svante.v.Erichsen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

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).