[SOLVED] Fresh install 64 14.1 with GPT without EFI in a BIOS motherboard
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Fresh install 64 14.1 with GPT without EFI in a BIOS motherboard
I partitioned my disk with GPT to be able to play with some alternative operating systems in my spare time, or just if I want to check something in the web with the fastest distro I can find. This way I'm not confined to three OSes.
The problem now resides in the booting process. Lilo (my favorite) doesn't work with GPT, GRUB legacy doesn't either.
Tried elilo, but it complains that there isn't an /efi partition at the beginning of the disk. GRUB 2 also returns an error. I couldn't also install syslinux, although it would be a first one for me with this boot manager.
So, my question: Do I need to create a /efi partition somehow (what size? 2MB?) or can I use elilo or grub to boot from the GPT partitions? If so, how to do it?
You do not need /efi if you are using GPT with BIOS, rather than UEFI. However, if you are using Grub2 with BIOS and GPT you need a "BIOS boot partition" (partition type EF02 in gdisk). In theory this it can be as small as 30 KiB but the general advice on most websites I looked at seems to be that you should make it 1 MiB because future boot loaders might require more space and many modern disk partitioning tools have 1 MiB partition alignment policies. It doesn't matter where on disk this partition is though.
My understanding with regards to the need for "BIOS boot partition" is that Grub2 has a slight size problem when installing on GPT systems under BIOS, due to the lack of post-MBR embed gap on GPT disks. Grub2 sets the first stage of its bootloader to look for a "BIOS boot partition" where it stores a second, bigger file. This second stage file includes support for a large set of filesystems.
An alternative is to use Extlinux (part of the Syslinux package included with Slackware). It is capable of booting ext2/ext3/ext4/btrfs GPT partitions and doesn't need a "BIOS boot partition". Since it supports fewer filesystems, its first stage is still small enough to include ext2+/btrfs support. Of course it still needs to know which partition is the /boot partition and this is done by marking that partition with a special attribute.
For example, presuming that /boot was on /dev/sda you could issue the following from the shell in the install environment:
Code:
# sgdisk /dev/sda --attributes=1:set:2
You can also use sgdisk to confirm it was indeed set correctly:
Once done, boot your into local Slackware install via the live media (since you haven't setup the bootloader yet). Slackware's live media boot prompt explains how to boot the installed Slackware system, rather than the install environment.
You can then install extlinux as your bootloader as follows:
If you want to use Grub2, make sure you have a "BIOS boot partition" (partition type EF02 in gdisk) somewhere on disk, of at least 1MiB. Boot your into you Slackware install (use the live media to achieve this) and then issue the following:
Just one more thing. I, like you, never got LILO to work with GPT (though I have successfully used Extlinux and Grub2). Nonetheless I have seen volkerdi say the following:
Quote:
Originally Posted by volkerdi
I don't think vanilla GRUB1 supports GPT. LILO does, though.
So presumably it is possible. I'm not sure what you and I are doing wrong though.
EDIT: The following is also interesting
Quote:
Originally Posted by Rod Smith
Information on the old Linux Loader (LILO) and GPT is contradictory. Most sources say the two won't get along, but I've read others who opine that the combination does (or at least should) work fine, since LILO uses sector maps to point to the kernel file. My one attempt at this combination proved inconclusive. LILO was able to load and run the kernel, but the boot then failed with the kernel message mount: could not find filesystem '/dev/root'. This message followed messages that indicated that the computer's LVM configuration was working fine, but somehow handing off to the LVM-based root filesystem was a problem. A GRUB boot of this system worked fine.
LILO works just fine with GPT. I have a installation with GPT/ESP and a LILO in the PMBR to allow booting on legacy systems as a fallback. What's the issue? Error messages?
I note that the Salix Wiki has a page called, "How to install Salix on a GPT hard drive", where the notes (after a description of how to make GPT partitions with parted) states:
Quote:
11. You'll need to install LILO to the boot partition of your hard drive, not the MBR. So you need to format your /boot partition (or the partition that will include /boot) with a filesystem that is compatible with LILO booting from it (don't use XFS)
12. When prompted to install LILO towards the end of the installation process, select the "Expert" installation mode
13. Select "Begin". Provide any additional options for your system if needed. You don't need any specifically for GPT. Select the screen size. When selecting the target for LILO, select the "Root" option instead of the default "MBR" option. Select the default LILO timeout and boot screen in the following dialogs
14. From the main LILO installation menu, select "Linux". The program will not find any partitions, but you can just type in the one that you want to use (for example: /dev/sda1). Select a name for the partition (for example "Salix" or "Linux")
15. From the main LILO installation menu, add any other Linux or Windows partitions in a similar manner (select the "Windows" option for adding a Windows partition). When done, select the "Install" option
16. Finish the installation and reboot
Perhaps this was my problem. Though it was so long ago since I last tried this, I honestly cannot recall. Some other interesting quotes I found whilst searching include:
The still-older Linux Loader (LILO) doesn't explicitly support GPT, but its disk-addressing methods are based on sector locations, so it often does work (in practice).
Arch Wiki is wrong in that respect. LILO does support GPT as much as it does support LVM or every other partitioning scheme compatible with the FIBMAP ioctl. That's one of the advantages of the KISS approach.
But I found the issue the OP had: LILO works, but liloconfig doesn't detect any GPT partitions, at least on 14.0. Therefore it's Slackware's fault, not LILO's fault.
Salix Wiki's instructions seem to be plain wrong, they don't work.
Solution: Just customize the example lilo.conf, put LILO into the PMBR (it won't boot from anywhere else, because there is no active partition). It will boot Slackware just fine and even chainload other OSes from other partitions, if they are on a different disk using the MBR partition scheme.
This is also the only option, if you must boot a 32 bit kernel from a GPT disk.
But I found the issue the OP had: LILO works, but liloconfig doesn't detect any GPT partitions, at least on 14.0. Therefore it's Slackware's fault, not LILO's fault.
Cool, thanks for getting to the bottom of that. I'll have to give it a go some time. Though to be honest I very happy with Extlinux as a bootloader for GPT on BIOS devices (or even just plain old MBR and BIOS).
In fact you can set one of the KERNEL lines in the Syslinux config file to point to the /boot/vmlinuz symlink (e.g. the one for huge, since it does not need an initrd). This means that after a kernel upgrade there is no need to issue the equivalent of "lilo", the system can boot straight to the new kernel. This was supposedly the advantage of Grub legacy but Syslinux/Extlinux doesn't have a horrible config file format. The only minor downside is that /boot must reside on an ext2, 3, 4 or btrfs.
GRUB Legacy can't support GPT, because it requires the no man's land between the MBR and the first partition. This is exactly there the GPT resides (so that "smart" staging concept fired back).
I will look into SYSLINUX/EXTLINUX, it sounds like a great solution. Maybe it's even able to read the kernel normally used by ELILO from the ESP in legacy mode.
That would open an option to streamline the BIOS/UEFI boot process in future Slackware64 releases (As in: Always create a GPT with an ESP, install ELILO and SYSLINUX and then boot Linux with whatever method works on the current system.)
I was talking thinking about BIOS/MBR setups when doing this comparison. As a side note Fedora made a patch to Grub legacy that added GPT support IIRC.
Quote:
Originally Posted by jtsn
I will look into SYSLINUX/EXTLINUX, it sounds like a great solution. Maybe it's even able to read the kernel normally used by ELILO from the ESP in legacy mode.
Extlinux expects an ext2,3,4 (or btrfs) file system (hence the name) but the ESP is fat. Perhaps you could do something with one of the other Syslinux components since they use the same config file format but you would have to have a play around to work this out for yourself.
By the way last time I looked Syslinux were working on adding UEFI support (but had not yet). Perhaps in the future, you could use Syslinux as a single bootloader for all combinations. Granted Grub2 can kinda do this already but it is a Goliath with a horrible config file format.
Last edited by ruario; 11-11-2013 at 07:47 AM.
Reason: added a note about Grub legacy, GPT and Fedora
Perhaps in the future, you could use Syslinux as a single bootloader for all combinations.
That sure will make things simpler, but as far as I can see following what is said on their ML (though I hardly understand 10% of it) we're not quite there.
Last edited by Didier Spaier; 11-11-2013 at 10:14 AM.
Reason: typo corrected
Extlinux expects an ext2,3,4 (or btrfs) file system (hence the name) but the ESP is fat.
Indeed, that's there SYSLINUX comes into play. We already have a FAT partition (the ESP), so why don't use it?
Quote:
By the way last time I looked Syslinux were working on adding UEFI support (but had not yet). Perhaps in the future, you could use Syslinux as a single bootloader for all combinations. Granted Grub2 can kinda do this already but it is a Goliath with a horrible config file format.
I currently have a GRUB2 setup, because it's able to chainload .efi boot loaders and saves the default boot selection. Not only the configuration is horrible, the menu looks ugly too. If could replace that with EXTLINUX/SYSLINUX, that would be great. But stable UEFI support and saving the default selection is a requirement.
If you want to use Grub2, make sure you have a "BIOS boot partition" (partition type EF02 in gdisk) somewhere on disk, of at least 1MiB. Boot your into you Slackware install (use the live media to achieve this) and then issue the following:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.