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 05-28-2016, 10:27 AM   #1
gordydawg
Member
 
Registered: Sep 2013
Distribution: slackware
Posts: 41

Rep: Reputation: Disabled
Slackware64-current. Two questions regarding Lilo, lba64 and sgdisk


I have two questions about lilo and gpt formatting.

With slackware current almost at the 14.2 starting gate, If one installs slackware with GPT partioning and formatting on a 1TB HD during install but placed Lilo into the master boot record during installation.

Should you use lba64, instead of the older longblock lba32 option in the lilo.conf file?

Second, would it be a good idea to use sgdisk just after partitioning as well? In this manner:

sgdisk /dev/sda --attributes=1:set:2

It alerts gpt for making room for Bios legacy booting.

This is on a relatively new motherboard set to bios legacy booting instead of the dastardly UEFI

Last edited by gordydawg; 05-28-2016 at 10:33 AM.
 
Old 05-28-2016, 10:39 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 8,994

Rep: Reputation: Disabled
You are just making your life harder refusing to use UEFI in my opinion.

No idea why your call it dastardly, by the way. Would you care to elaborate a bit?

Just my
 
Old 05-28-2016, 02:34 PM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,651

Rep: Reputation: Disabled
Since Lilo knows nothing of GPT, I'd be hesitant to put it in the (protective) MBR of a GPT-partitioned drive.

Normally, the sectors immediately following sector 0 (up to at least sector 62) are free and are commonly used by bootloaders, but on GPT drives these sectors hold the GUID partition table. GRUB is smart enough to look for an alternative location (the "BIOS Boot Partition") to store its second-stage boot loader, but I have no idea what Lilo will do in a scenario like that. Since Lilo is not even slightly GPT-aware, I suspect it'd just trample all over the partition table.

There are probably several ways to install a Lilo to a GPT drive. I once had to come up with a strategy in a hurry, and this is what I ended up doing:
  1. Created a tiny partition for the Lilo bootloader at the very start of the drive, from sector 2048 onwards. I used GPT type 8301 ("Linux reserved"), but I guess ef02 ("BIOS Boot Partition") would have been an even better choice.
  2. Created other partitions as needed (/boot, /, /var, swap etc.). I made sure the entire /boot partition was located below the 4Tb BIOS limit.
  3. Manipulated the protective MBR (fdisk -t dos did the job nicely) and made the protective partition start at sector 2048 rather than at sector 1. Also, I set the bootable flag on the protective partition.
  4. Edited lilo.conf manually (see below) to make Lilo install to /dev/sda1 (which to Lilo means the protective MBR partition since it parses the MBR directly), a partition which starting sector was identical to that of the "Linux reserved" partition I'd created earlier in the GPT table.
  5. Ran lilo -M /dev/sda to install MBR boot code to the drive.
This slightly convoluted procedure means you'll have a GPT partition structure that'll work with bootloaders like Lilo that read the MBR partition table directly.

Lilo will complain slightly about being installed to a partition of type ee (GPT), but it will proceed. If you use GPT tools like gdisk later, they might also display warnings about the protective MBR not starting at sector 1 and having the bootable flag set, but again that's just cosmetic.

As for editing lilo.conf: The Slackware installer does not let you edit the Lilo configuration file directly, but if you use the "Expert" Lilo installation mode, you can edit /var/log/setup/tmp/lilo.conf manually from another console before selecting "install". As long as you make sure "boot" points to /dev/sda1, all should be well.

Note that you can NOT create a "Linux" partition with a valid filesystem in the GPT table and have it overlap with the protective MBR, and then install Lilo to the protective MBR. Lilo will only check the partition type in the MBR, and since the protective MBR has type "ee", Lilo won't even look for a filesystem before installing. Instead it will just overwrite the first sectors of the partition in question, most likely destroying the filesystem in the process (it certainly hoses ext4; I've tried).
 
Old 05-28-2016, 03:47 PM   #4
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Debian, Xubuntu
Posts: 315
Blog Entries: 1

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by Ser Olmy View Post
Since Lilo knows nothing of GPT, I'd be hesitant to put it in the (protective) MBR of a GPT-partitioned drive.
Actually, LILO can be installed into the Protective MBR of a GPT disk just fine. It's what I initially did on my laptop. (I run it in Legacy BIOS mode as well, and I honestly have no idea in what way this "makes my life harder"; I certainly don't feel any hardship caused by the Legacy BIOS plus GPT combination.)

There's one issue, though: Installing LILO on the boot sector of a GPT partition won't work, precisely because LILO knows nothing about GPT. (Well, I guess that's a way in which it does "make my life harder" after all.)

As far as LBA64 vs. LBA32 goes, I wasn't even aware that LILO supported LBA64. I've never used it on a disk that needed greater than LBA32, so I wouldn't really have noticed the difference anyway.

UPDATE: I once experimented with installing LILO on the boot sector of a GPT partition, albeit through an MBR entry that I had manually hacked together. Technically, it worked, although for practical purposes, it was pretty useless.

Last edited by luvr; 05-28-2016 at 04:23 PM.
 
Old 05-28-2016, 04:03 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,651

Rep: Reputation: Disabled
Quote:
Originally Posted by luvr View Post
There's one issue, though: Installing LILO on the boot sector of a GPT partition won't work, precisely because LILO knows nothing about GPT.
It's worse that that, actually. Even if you can somehow tell UEFI to boot from a GPT partition with a LILO boot sector, a LILO boot loader does not constitute valid UEFI boot code. For one thing, it runs in x86 "real" mode, while UEFI typically demands code written for 64-bit Long Mode. (Which, incidentally, is why some UEFI systems are incapable of booting 32-bit operating systems.)

Quote:
Originally Posted by luvr View Post
As far as LBA64 vs. LBA32 goes, I wasn't even aware that LILO supported LBA64.
You probably mean LBA48, and I'm pretty sure LILO doesn't support it.

Last edited by Ser Olmy; 05-28-2016 at 04:07 PM.
 
Old 05-28-2016, 04:16 PM   #6
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Debian, Xubuntu
Posts: 315
Blog Entries: 1

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by Ser Olmy View Post
Even if you can somehow tell UEFI to boot from a GPT partition with a LILO boot sector, a LILO boot loader does not constitute valid UEFI boot code.
Well, of course... But that's not what we're doing here. We're not telling UEFI to boot anything, since we're, in essence, running BIOS. (Even if it's really "Legacy BIOS" mode, which, in the end, does walk, talk, quack, and even boot like a "real" BIOS.)
 
Old 05-28-2016, 04:17 PM   #7
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Debian, Xubuntu
Posts: 315
Blog Entries: 1

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by Ser Olmy View Post
You probably mean LBA48, and I'm pretty sure LILO doesn't support it.
That was my impression, as well.
 
Old 05-28-2016, 04:29 PM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,651

Rep: Reputation: Disabled
Quote:
Originally Posted by luvr View Post
That was my impression, as well.
It should be a breeze to implement it, though, since LBA48 is fully supported by the BIOS function used by LILO to read the kernel/initrd.

And even if LILO is currently limited to 32-bit LBA addresses, it would still be able to access any disk sector below the 2 TiB mark. As long as /boot resides somewhere below 2 TiB, it won't be a problem.
 
Old 05-28-2016, 04:33 PM   #9
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Debian, Xubuntu
Posts: 315
Blog Entries: 1

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by Ser Olmy View Post
Normally, the sectors immediately following sector 0 (up to at least sector 62) are free and are commonly used by bootloaders, but on GPT drives these sectors hold the GUID partition table. GRUB is smart enough to look for an alternative location (the "BIOS Boot Partition") to store its second-stage boot loader, but I have no idea what Lilo will do in a scenario like that. Since Lilo is not even slightly GPT-aware, I suspect it'd just trample all over the partition table.
In fact, LILO doesn't use any of the empty space that ordinarily sits between the MBR and the first partition, and consequently it will not harm the GUID Partition Table of a GPT disk. It uses LBA values to directly address the sectors that it needs to load from the boot partition.
 
Old 05-28-2016, 07:27 PM   #10
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242Reputation: 1242
LILO go nuts when the hardrive is beyond of 2TB. As boot device/harddisk.

Yeah, how our fellow Slackwarians use usually Mega-SSDs of 16 TB and beyond, on their Bulldozer x64 (as in 64 cores) with 512GB RAM, that's really a huge limitation of LILO.

Good look guys and tell me when will appear a Bulldozer x256, maybe I'll buy one.
 
Old 05-28-2016, 07:51 PM   #11
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,651

Rep: Reputation: Disabled
Quote:
Originally Posted by Darth Vader View Post
LILO go nuts when the hardrive is beyond of 2TB. As boot device/harddisk.
Just create a separate /boot partition below the 2 Tb limit, and all should be fine.

Until the Linux kernel gets too large to fit on a 2 Tb partition, of course. Then we're really out of luck.
 
1 members found this post helpful.
Old 05-28-2016, 10:41 PM   #12
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 2,268

Rep: Reputation: 599Reputation: 599Reputation: 599Reputation: 599Reputation: 599Reputation: 599
Quote:
Originally Posted by Didier Spaier View Post
You are just making your life harder refusing to use UEFI in my opinion.
Seconded.
 
Old 05-29-2016, 04:19 PM   #13
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Debian, Xubuntu
Posts: 315
Blog Entries: 1

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by rkelsen View Post
Quote:
Originally Posted by Didier Spaier View Post
You are just making your life harder refusing to use UEFI in my opinion.
Seconded.
Like I said, I honestly have no idea why that should be the case. I'm willing to accept the possibility that it may be so, but in my experience, there's nothing hard about my preference to stick with Legacy BIOS.

It would be different if I wanted to run "That Other OS" (you know--the one from Redmond), but I have no interest in doing so. Also, the pretty involved procedure that Ser Olmy posted, while absolutely correct, is really unnecessary: You can simply install Slackware on a GPT partition under a Legacy BIOS system and let it install LILO onto the (Protective) Master Boot Record without further ado; the GUID Partition Table won't be affected.

The only issue that I encountered so far, is the impossibility to install LILO onto the boot sector of a GPT partition--but that's not what I would call anything like a critical problem.
 
Old 05-29-2016, 04:31 PM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 8,994

Rep: Reputation: Disabled
Well, I didn't make any general statement about using Legacy (aka BIOS) vs UEFI.

I just pointed out that using LiLo with a GUID partition table is not taking the easiest path.

In other words why not use either Lilo + MBR or GPT + UEFI (and another boot loader)?

Last edited by Didier Spaier; 05-29-2016 at 05:06 PM.
 
Old 05-29-2016, 04:53 PM   #15
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Debian, Xubuntu
Posts: 315
Blog Entries: 1

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by Didier Spaier View Post
In other words why not use either Lilo + MBR or GPT + UEFI?
My initial reason to try out GPT was the limit of four (primary) partitions under the MBR scheme, plus my aversion to creating an Extended Partition (which is then used as a sort of "container" for "Logical Partitions"), to overcome the four-partition limit; this Extended / Logical Partition thing was rather brittle, in my experience. A scheme that treated all of its partitions equally, just looked and felt far more elegant to me.

Hence, out of sheer curiosity, I decided to try and see how well (or otherwise, how poorly) GPT would work under Legacy BIOS. Turned out to be perfect, at least for my needs. But, obviously, "Your Mileage May Vary", as they say.
 
  


Reply


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
[SOLVED] Lilo set-up to dual boot Slackware 12.2 with Slackware64 -current? hitest Slackware 19 08-10-2009 05:31 AM
Slackware64-current : can't have lilo updating the boot loader after kernel upgrade Didier Spaier Slackware 3 07-21-2009 08:00 AM
Slackware64-current ATI, and few more proprietary questions dolphin77 Slackware 15 06-10-2009 09:15 AM
Slackware64-current ATI, and few more proprietary questions dolphin77 Linux - Newbie 1 05-22-2009 06:57 PM

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

All times are GMT -5. The time now is 06:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration