From mboxrd@z Thu Jan 1 00:00:00 1970 From: david.larsson@selfhosted.xyz Subject: bug#33517: Problem booting when using btrfs subvolume for /gnu/store Date: Sun, 3 Feb 2019 15:41:44 +0100 (CET) Message-ID: References: <87mupva8j5.fsf@cbaines.net> <20190126235945.GP9163@krustig.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="-1463766527-488047257-1549204917=:55299" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:37645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqIz9-0000ov-M3 for bug-guix@gnu.org; Sun, 03 Feb 2019 09:43:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqIz8-0004ga-P9 for bug-guix@gnu.org; Sun, 03 Feb 2019 09:43:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57530) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqIz8-0004gF-HM for bug-guix@gnu.org; Sun, 03 Feb 2019 09:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gqIz8-00036p-BH for bug-guix@gnu.org; Sun, 03 Feb 2019 09:43:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:37470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqIym-0000lk-4G for bug-guix@gnu.org; Sun, 03 Feb 2019 09:42:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqIyc-00049n-IC for bug-guix@gnu.org; Sun, 03 Feb 2019 09:42:35 -0500 Received: from server0.selfhosted.xyz ([185.147.237.19]:60448) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gqIyW-0003hi-Al for bug-guix@gnu.org; Sun, 03 Feb 2019 09:42:25 -0500 In-Reply-To: <20190126235945.GP9163@krustig.localdomain> 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" To: "Svante v. Erichsen" Cc: 33517@debbugs.gnu.org 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: quoted-printable 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=3Dlzo,ssd,subvol=3D@")) > > It also appears that the subvolume name must be prepended to the path a= s if it > just was an ordinary directory (grub.cfg): > > =E2=80=A6 > linux /@/gnu/store/=E2=80=A6 > =E2=80=A6 > > 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 b= e > 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)))) > =E2=80=A6) > > This would mean that the menu-entry structure needs the subvol informat= ion. > However, I wouldn't want to parse this from the options field in the fi= le-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 li= ke this > would work for subvols, while using a string doesn't, especially when s= ome older > documentation/blogs/gists is still hanging around on the internet, so m= aybe 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 submi= t a patch > will take me some time. > > Do you think this is sensible? > > > --=20 > Svante von Erichsen > > GPG fingerprint: A78A D4FB 762F A922 A495 57E8 2649 9081 6E61 20DE > ---1463766527-488047257-1549204917=:55299--