Chris Murphy posted on Sat, 11 Jan 2014 16:03:20 -0700 as excerpted: > On Jan 11, 2014, at 11:48 AM, Szalma László <dblaci@xxxxxxxxx> wrote: > >> but the grub itself has to be on a standard bios bootable partition (as >> far as I know) > > Negative. GRUB2 has support for pretty much everything out there: ZFS, > Btrfs, LVM, LUKS, md raid 0, 1, 10, 5, 6. It will boot Btrfs multiple > devices, single, raid1, raid0, and raid10, and zlib or lzo. > > The proper modules are baked into core.img during grub-install which > determines the requirements for finding grub's root (which is typically > /boot/grub). Core.img is embedded in the MBR gap (or into grubx64.efi). > And that core.img is all that's needed to locate /boot/grub/ where even > more modules can be arbitrarily loaded, as well as grub.cfg. At this > point the kernel and initramfs could be anywhere, located, and booted. Correct, but omitting one critical bit, GPT on legacy BIOS, with a BIOS- reserved partition grub can install its core image into. Recommended BIOS-reserved partition size is 1-2 MiB and grub can often work with as little as 32 KiB, often the gap size if it has to install to the gap, so 1-2 MiB should be plenty. However, in ordered to align partitions properly, as my smallest partition, I generally start the BIOS reserved partition at 1 MiB and make it 3 MiB in size, so all further partitions are 4 MiB aligned. With a full 3 MiB to work with grub-install can do a pretty fat core.img, including a bunch of modules it wouldn't otherwise have room for. Actually, looking on /boot, the entire grub/i386-pc subdir with ALL modules is only 1886013 bytes according to du, so a full grub core with all modules (for i386-pc anyway) builtin should be less than 2 MiB, and it shouldn't need the modules installed on /boot at all, tho I'm not sure whether it takes advantage of all that room to install everything in the core image since the room is available to do so, or only includes what it detects it needs, regardless. Completing my under-1-gig layout is a 124 MiB efi-reserved partition, unused ATM but there to prevent a forced re-gdisk in case I need it later (leaving further partitions 128 MiB aligned), a 256 MiB /boot, and a 640 MiB /var/log. That's the first 1 GiB and all further partitions are whole-GiBs in size, leaving all partitions beyond 1 GiB, full-GiB aligned. -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
