From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 03 09:42:21 2019 Received: (at 33517) by debbugs.gnu.org; 3 Feb 2019 14:42:21 +0000 Received: from localhost ([127.0.0.1]:56808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqIyS-00035X-Lj for submit@debbugs.gnu.org; Sun, 03 Feb 2019 09:42:21 -0500 Received: from server0.selfhosted.xyz ([185.147.237.19]:49526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqIyQ-00035I-Ky for 33517@debbugs.gnu.org; Sun, 03 Feb 2019 09:42:19 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=selfhosted.xyz; s=dkim; t=1549204929; bh=sWZVwJj/Md6FxI4T0S6b/TjdJRf6wUuxglisaUc9Chw=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=s80A6kaCQT5ci4yQPvU+SyJsiAvj3nXIEhCC8ToF3duK9GlpLTq56nE2CwgmEWMVu Lu5+u7n+S2ZvBJefy7PTnyNeB6wqsUavuzCAeGbAz128UR2rIc5eldqEy0WzyuciHi XmKRCiKtle49+zszSse3aoU9+pKg5wPoe9iYYSS2XT+PxOwjisHPXyH9F3uWuHyj6N 0OxK71EuE6R/r13drpR1gzJYabmxQzXj05teqdBIQzP82R4vRnrkOFmgDbR1BGwXIY CsgCqcUYrcrnCaXsoZkRhykiBHdF+Bns9X98ji9qpKVIfIaLeSPnFDes0J23Na3AsJ nifwiBssvkmeA== X-Fuglu-Suspect: f8a8a181931b4f58a3e4cbd7691b9299 X-Fuglu-Spamstatus: NO Received: from [127.0.0.1] (localhost [127.0.0.1]) Date: Sun, 3 Feb 2019 15:41:44 +0100 (CET) From: david.larsson@selfhosted.xyz To: "Svante v. Erichsen" Subject: Re: bug#33517: Problem booting when using btrfs subvolume for /gnu/store In-Reply-To: <20190126235945.GP9163@krustig.localdomain> Message-ID: References: <87mupva8j5.fsf@cbaines.net> <20190126235945.GP9163@krustig.localdomain> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1463766527-488047257-1549204917=:55299" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 33517 Cc: 33517@debbugs.gnu.org, bug-guix@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463766527-488047257-1549204917=:55299 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT 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 > ---1463766527-488047257-1549204917=:55299--