help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Force location of GRUB's boot and core images ?


From: Andrei Borzenkov
Subject: Re: Force location of GRUB's boot and core images ?
Date: Mon, 10 Apr 2017 06:08:18 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

09.04.2017 23:32, Pascal Hambourg пишет:
>>>
>>> Yes. IME, grub-install refuses embedding on a partition with an
>>> unknown format, e.g. an empty partition. And I need embedding.
>>
>> Can you tell me what your use case is, out of interest?
> 
> My current use case is to install a new GNU/Linux system entirely in an
> encrypted (LUKS) partition on a disk which already contains an existing
> GNU/Linux system. The existing boot loader is installed in the MBR and
> must be left untouched. However it cannot boot the new system because
> even /boot is encrypted. So I need to install GRUB with encryption
> support as a secondary boot loader. Its boot and core images cannot be
> installed in the encrypted partition.
> 

Must /boot/grub be encrypted as well?

> A more general use case is to install multiple instances of GRUB as
> independent secondary boot loaders, and not store the core image as a
> standard file using blocklists because it is not reliable.
> 

You need to point some master bootloader to this partition, right? What
is your master bootloader? If this is grub, you can create small grub
image which just loads grub from your encrypted partition and have
master grub load it.

>> Of course perhaps your partition is very small and you have no intended
>> use for the partition.
> 
> The only intended use for the partition is to install GRUB, and I want
> it as small as possible. Boot image + core image take less than 100 kB
> and I'd rather avoid allocating a multi-GB btrfs partition for this.
> 

If /boot/grub can remain unencrypted (after all, it does not really
contain anything core.img cannot) you can simply install it as

mount /dev/sda5 /mnt
grub-install --boot-directory=/mnt /dev/sda5

using something like ext2 or FAT.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]