The immutable flag on /boot/grub/i386-pc/core.img needs to be set only if GRUB is installed to a partition boot sector or a partitionless disk, not in case of installation to MBR or simple generation of core.img without embedding any bootsector (mentioned above). The workaround for this is to set the immutable flag on /boot/grub/i386-pc/core.img (using chattr command as mentioned above) so that the sector locations of the core.img file in the disk is not altered. The sector locations of core.img may change whenever the file system in the partition is being altered (files copied, deleted etc.). The reason why grub-setup does not by default allow this is because in case of partition or a partitionless disk is that GRUB relies on embedded blocklists in the partition bootsector to locate the /boot/grub/i386-pc/core.img file and the prefix directory /boot/grub. sbin/grub-setup: error: will not proceed with blocklists Without -force you may get the below error and grub-setup will not setup its boot code in the partition boot sector: However, blocklists are UNRELIABLE and their use is discouraged. GRUB can only be installed in this setup by using blocklists. sbin/grub-setup: warn: Embedding is not possible.
#Grub theme file example install#
sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. Grub-install will give out warnings like which should give you the idea of what might go wrong with this approach: You need to use the -force option to allow usage of blocklists and should not use -grub-setup=/bin/true (which is similar to simply generating core.img). It is recommended to always use this option to remove ambiguity in grub-install. -target=i386-pc instructs grub-install to install for BIOS systems only.Install to partition or partitionless disk To have grub write its EFI image to esp/EFI/BOOT/BOOTX64.efi, which the boot firmware will be able to find without any UEFI boot entry, use -removable when you run grub-install. # cp /etc/default/grub /mnt/usb/etc/default Optionally backup configuration files of grub.cfg: # grub-mkconfig -o /mnt/usb/boot/grub/grub.cfg # grub-install -target=i386-pc -debug -boot-directory=/mnt/usb/boot /dev/sdy
#Grub theme file example manual#
10 Manual configuration of core image for early bootĪlternative installation methods Install to external USB stick BIOSĪssume your USB stick's first partition is FAT32 and its partition is /dev/sdy1.7 Combining the use of UUIDs and basic scripting.6 Hide GRUB unless the Shift key is held down.5.1 Password protection of GRUB edit and console options only.4 Booting ISO9660 image file directly via GRUB.1.2 Install to partition or partitionless disk.