unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48172: support split /boot partition
       [not found]     ` <87pmy8u7s3.fsf@yucca>
@ 2021-05-22 21:02       ` Vagrant Cascadian
  2022-06-08 18:46         ` Maxim Cournoyer
  0 siblings, 1 reply; 3+ messages in thread
From: Vagrant Cascadian @ 2021-05-22 21:02 UTC (permalink / raw)
  To: 48172

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

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)

live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

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

* bug#48172: support split /boot partition
  2021-05-22 21:02       ` bug#48172: support split /boot partition Vagrant Cascadian
@ 2022-06-08 18:46         ` Maxim Cournoyer
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2022-06-08 18:46 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: 48172

Hi Vagrant,

Vagrant Cascadian <vagrant@debian.org> 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




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

* bug#48172: support split /boot partition
       [not found]   ` <871raovntj.fsf@yucca>
       [not found]     ` <87pmy8u7s3.fsf@yucca>
@ 2023-06-03 14:25     ` Distopico Vegan
  1 sibling, 0 replies; 3+ messages in thread
From: Distopico Vegan @ 2023-06-03 14:25 UTC (permalink / raw)
  To: 48172

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


Currently I have this similar use case, I have a PCI-E NVMe that is not
detected by BIOS (KGPE-D16 motherboard) so my plan was had a partition
for /boot in my SSD and the root system in the NVMe, so could be great
have support to that user case that I think is pretty common in old
board that doen's have NVMe and you want extend your system.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]

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

end of thread, other threads:[~2023-06-03 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CACw=CXP2rKeVavgZ-UZrRoZRpaoL5zPvjJPorjAiAYY5eKUesQ@mail.gmail.com>
     [not found] ` <875z038851.fsf@dismail.de>
     [not found]   ` <871raovntj.fsf@yucca>
     [not found]     ` <87pmy8u7s3.fsf@yucca>
2021-05-22 21:02       ` bug#48172: support split /boot partition Vagrant Cascadian
2022-06-08 18:46         ` Maxim Cournoyer
2023-06-03 14:25     ` Distopico Vegan

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