From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 08 14:46:40 2022 Received: (at 48172) by debbugs.gnu.org; 8 Jun 2022 18:46:40 +0000 Received: from localhost ([127.0.0.1]:44294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nz0hU-0001oY-5M for submit@debbugs.gnu.org; Wed, 08 Jun 2022 14:46:40 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:37755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nz0hQ-0001oK-Kt for 48172@debbugs.gnu.org; Wed, 08 Jun 2022 14:46:39 -0400 Received: by mail-qt1-f178.google.com with SMTP id y15so15576437qtx.4 for <48172@debbugs.gnu.org>; Wed, 08 Jun 2022 11:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2GCbg3v3YKj5O+AAxD2swCMtTyUO+SdbWSfiJ7q/yfU=; b=Pk3v7pi3jFpUHw3Rw1Pz2UndyXiwRsLDW1FZASkks50qwiiEKQ3B1hiSLokLMp1WWc sHmTM1zWsH/DbqTpJIKUJFRdcgFHUJMr+ywUYlvPshn7P9lsmpzTNoYzD1TsntddEvI6 c8bT8nT3nsUQ0nrLEElMZkqlW56FkmMUPX9A3afuviy8vhyVmxMxtv8jKzl2mvX2dcPs QRf8flIAgGLYnvH32wRdZ5DGpSK7JdR9KTl8hQH+kkR58JizSEVS2hjIl3A4jA8fEKyk EJSSdJztBOeXT/LAlmYdpNofbVMmLVA/wPCsMPAmqZ9QmDA4hvRahy+WY9gjYVg3VYW7 GVsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=2GCbg3v3YKj5O+AAxD2swCMtTyUO+SdbWSfiJ7q/yfU=; b=1k9c4qXJnRqGDdryK2uvKVmnFr4O12IyAOotkHkhlsgSpNDDbSTU3330GvYhKy2egv O1EuELICIy6fygYJigupezATHuIGNCVAdOJ4pGCSWugHGqSPKSWLuK14jcxJzR6RSsYb 3FuPm7E/Jd+yeRzVcOIZIYB9sZyn6Q1JdYZM8mE292JhQ6VipIc/av+6HtVcoI3cFBKQ G749TDODn5MBEx6hOJ5HlsmKtZ6n8DQhAfw4Oj2XY9cJq5dVSzwEBOE2P2ah/YvRXkG3 ymGs5NaZBqit70+qsnkNpJi3n09wQl0ZaTgpB2biXvi6nmSB06xIsogl/gc0yRIXo9EQ yM/A== X-Gm-Message-State: AOAM532lj6DWy4EzqA4gNQy1cTP/hOE6lf+qVBN2QBVPqbdzJkB67Jj/ NbSn8dM51USiOPsP8UuPAY/VmtresUlANg== X-Google-Smtp-Source: ABdhPJxVy0WTCnJg7/7wcJsnMOUPxNcqHy/FDgzGjJtmD59TAznG4wRjAEVPk2bW/BstqEmTJigbwg== X-Received: by 2002:ac8:5c94:0:b0:305:20d:afab with SMTP id r20-20020ac85c94000000b00305020dafabmr3070474qta.262.1654713990135; Wed, 08 Jun 2022 11:46:30 -0700 (PDT) Received: from hurd (dsl-151-172.b2b2c.ca. [66.158.151.172]) by smtp.gmail.com with ESMTPSA id f15-20020ac86ecf000000b00304edcfa109sm6123221qtv.33.2022.06.08.11.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 11:46:28 -0700 (PDT) From: Maxim Cournoyer To: Vagrant Cascadian Subject: Re: bug#48172: support split /boot partition References: <875z038851.fsf@dismail.de> <871raovntj.fsf@yucca> <87pmy8u7s3.fsf@yucca> <87zgwmlbxl.fsf@yucca> Date: Wed, 08 Jun 2022 14:46:23 -0400 In-Reply-To: <87zgwmlbxl.fsf@yucca> (Vagrant Cascadian's message of "Sat, 22 May 2021 14:02:14 -0700") Message-ID: <87r13zj8n4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 48172 Cc: 48172@debbugs.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.0 (-) Hi Vagrant, Vagrant Cascadian writes: > On 2021-05-02, Vagrant Cascadian wrote: >> Unfortunately, guix doesn't currently support booting off of a separate >> /boot partition, since the kernel and initrd are in /gnu/store; your >> bootloader needs to be able to mount the partition that /gnu/store is >> located on. >> >> The workaround would be to manually copy all files mentioned in grub.cfg >> (kernel, initrd, possibly others) into a partition somewhere on boot >> media, and tweak the grub.cfg appropriately... >> >> >> There are several cases where this sort of thing would be desireable: >> >> * The above scenario; the system does not expose an NVMe drive from EFI >> or BIOS. >> >> * Using u-boot and you want root on lvm, raid, encryption, etc. which >> u-boot does not support > > * Using luks1 format for /boot and luks2 format for / (unless grub2 > learns how to read luks2 already/soon) On top of the above use cases, I'll add one I found recently, after upgrading my disk array to 2.5 TiB on my aging BIOS desktop: * Keep boot files under the maximum 2 TiB addressable sector on BIOS (non-UEFI) systems using > 2 TiB drives. The problem would manifest itself by this cryptic GRUB error: "error: attempt to read or write outside of disk `proc'" The solution was to have a separate *and* standalone boot partition. The separate part is easy; just create a new partition and mount it as /boot in your config file system definitions. The second "standalone" part is not taken care by Guix System yet; with the help of Tobias I devised the following script that copies the minimum (init RAM disks and kernel images) to /boot and strips the prefixes on these paths, if any (I use Btrfs subvolumes): --8<---------------cut here---------------start------------->8--- #!/usr/bin/env bash set -e # Copy kernel and initrd images to /boot images=$(grep -E '^ (linux|initrd) ' /boot/grub/grub.cfg \ | awk '{ print $2 }' | sed 's|.*/gnu|/gnu|g' | sort | uniq) for image in $images; do mkdir -p /boot$(dirname $image) if [ ! -e /boot$image ] || ! cmp -s $image /boot$image; then echo copying cp $image to /boot$image... > /dev/error cp $image /boot$image fi done # Adjust /boot/grub/grub.cfg. sed -E -e 's/.*search.*--set.*//' \ -e 's/^insmod luks.*//' \ -e 's/^cryptomount.*//' \ -e 's,^( (linux|initrd) )[^ ]*(/gnu/[^ ]* ?),\1\3,' \ -i.bak /boot/grub/grub.cfg --8<---------------cut here---------------end--------------->8--- It's on my TODO to address this properly in Guix when I'll have the bandwidth. I hope that helps, Thanks! Maxim