LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-11-2013, 04:31 AM   #1
lupe
Member
 
Registered: Dec 2008
Distribution: Slackware, FreeBSD, NetBSD, Haiku
Posts: 52

Rep: Reputation: 2
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?
 
Old 11-11-2013, 05:22 AM   #2
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
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:

Code:
# sgdisk /dev/sda --attributes=1:show
1:2:1 (legacy BIOS bootable)
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:

Code:
# mkdir -p /boot/extlinux
# extlinux --install /boot/extlinux
# cat /usr/share/syslinux/gptmbr.bin > /dev/sda
(Note: Adjust /dev/sda as is appropriate for your system)

Then all you need is to make a config file. Assuming you wanted a simple boot menu, copy menu.c32 over into the extlinux boot directory as well:

Code:
# cp /usr/share/syslinux/menu.c32 /boot/extlinux/
Finally create a /boot/extlinux/extlinux.conf file along the following lines:

Code:
UI menu.c32
PROMPT 0
MENU TITLE Boot options
TIMEOUT 50
DEFAULT huge

LABEL huge
      MENU LABEL Slackware (Huge) 
      KERNEL /boot/vmlinuz-huge-smp-3.10.17-smp
      APPEND root=/dev/sda1 ro

LABEL generic
      MENU LABEL Slackware (Generic)
      KERNEL /boot/vmlinuz-generic-smp-3.10.17-smp
      APPEND root=/dev/sda1 ro
      INITRD /boot/initrd.gz
(Note: Adjust /dev/sda1 and the kernel entries to whatever you use on your system)

Last edited by ruario; 11-11-2013 at 05:48 AM. Reason: s/Gurb 2/Grub2/
 
1 members found this post helpful.
Old 11-11-2013, 05:29 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 10,750

Rep: Reputation: Disabled
I saw ruario's answer right after posting. The way he proposes is better so just follow it.

Last edited by Didier Spaier; 11-11-2013 at 05:34 AM.
 
Old 11-11-2013, 05:42 AM   #4
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
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:

Code:
# grub-install --modules=part_gpt /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
(Note: Adjust /dev/sda to reflect the partition /boot is actually found)

Be aware however, I have not tested Slackware 14.1 yet, so there might be some reason this does not work.
 
1 members found this post helpful.
Old 11-11-2013, 06:04 AM   #5
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
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 View Post
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.
Taken from: http://www.rodsbooks.com/gdisk/booting.html

Last edited by ruario; 11-11-2013 at 06:07 AM.
 
Old 11-11-2013, 06:09 AM   #6
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
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?
 
Old 11-11-2013, 06:27 AM   #7
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
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:

wiki.archlinux.org/index.php/GUID_Partition_Table#BIOS_systems

Quote:
GRUB Legacy and LILO do not support GPT.
www.ibm.com/developerworks/linux/library/l-gpt/

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

Last edited by ruario; 11-11-2013 at 06:33 AM.
 
Old 11-11-2013, 06:40 AM   #8
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
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.
 
2 members found this post helpful.
Old 11-11-2013, 07:04 AM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by jtsn View Post
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.

Last edited by ruario; 11-11-2013 at 07:13 AM.
 
Old 11-11-2013, 07:15 AM   #10
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
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.)
 
Old 11-11-2013, 07:44 AM   #11
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by jtsn View Post
GRUB Legacy can't support GPT
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 View Post
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
 
Old 11-11-2013, 07:58 AM   #12
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 10,750

Rep: Reputation: Disabled
Quote:
Originally Posted by ruario View Post
By the way last time I looked Syslinux were working on adding UEFI support (but had not yet).
They have. But I didn't try it yet.

Quote:
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
 
2 members found this post helpful.
Old 11-11-2013, 08:46 AM   #13
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
Quote:
Originally Posted by ruario View Post
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.
 
Old 11-12-2013, 06:45 AM   #14
lupe
Member
 
Registered: Dec 2008
Distribution: Slackware, FreeBSD, NetBSD, Haiku
Posts: 52

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by ruario View Post
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:

Code:
# grub-install --modules=part_gpt /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
(Note: Adjust /dev/sda to reflect the partition /boot is actually found)

Be aware however, I have not tested Slackware 14.1 yet, so there might be some reason this does not work.
I created a small BIOS boot partition and proceeded as you suggested. It's working fine now. Thank you very much!
 
Old 11-12-2013, 07:56 AM   #15
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by lupe View Post
I created a small BIOS boot partition and proceeded as you suggested. It's working fine now. Thank you very much!
Cool, glad it worked out!
 
  


Reply

Tags
gpt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error about GPT and EFI during Centos installation roby84 Linux - Server 2 10-09-2013 02:23 AM
How to ensure an SSD drive's compatibility with both GPT-BIOS and EFI motherboards Admetus Linux - Newbie 2 10-16-2012 04:17 AM
EFI main GPT overwritten everytime (when windows 7 runs) - structure of EFI masuch Linux - Newbie 2 07-20-2012 02:49 PM
Distro that can install with GPT/EFI BeaverusIV Linux - Distributions 4 08-22-2011 07:04 AM
how to format an EFI partition on a GPT partitioned HD nfolken Linux - Laptop and Netbook 2 01-28-2010 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration