LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 01-01-2020, 03:50 PM   #1
davecan
Member
 
Registered: Nov 2019
Posts: 45

Rep: Reputation: Disabled
LFS 9.0 systemd: Does the LFS partition need to be a GPT or can it be msdos?


I completed LFS 9.0 sysvinit version up to chapter 7 then started over with LFS 9.0 systemd version. Host is Arch 2019.05 in a VM. I'm doing this strictly for learning purposes.

Although I understand the concept this is the first time I've dealt directly with bootloaders so if I misunderstand something below please feel free to correct me.

Section 2.4 states:

Quote:
If the boot disk has been partitioned with a GUID Partition Table (GPT), then a small, typically 1 MB, partition must be created if it does not already exist. This partition is not formatted, but must be available for GRUB to use during installation of the boot loader.
and then

Quote:
The Grub Bios partition must be on the drive that the BIOS uses to boot the system. This is not necessarily the same drive where the LFS root partition is located. Disks on a system may use different partition table types. The requirement for this partition depends only on the partition table type of the boot disk.
This implied to me that if we do not use a GPT partition then we don't need to bother with GRUB.

Meanwhile section 6.60 installs GRUB and then 8.4 is all about using GRUB to set up the boot process. It does state using GRUB is optional but then states the fallback is to use GRUB-Legacy or GRUB2 -- ?? We installed GRUB2 in 6.60 so 8.4 presumably is configuring GRUB2 so I don't see how it is a fallback option if we want to skip 8.4. The only realistic alternative to GRUB2 (that I'm aware of) is GRUB Legacy (isn't LILO very old?) and it isn't clear if both versions of GRUB would require that partition or not. (I would assume so)

I also see this article which basically says GRUB doesn't naturally run on a GPT partition so it takes some adjustments. http://www.wensley.org.uk/gpt

In my case I initially selected dos as the partition type to avoid dealing with the GPT GRUB dependency. This was because I was focusing on the simplest possible way to get to a bootable LFS. But since I now see it referenced later on I'm not sure if this is shooting myself in the foot. The decision to go with the dos partition type was based on reading some articles online about Linux partitioning and was made when I first started down the LFS journey, so I may have misunderstood a few things when I made that decision.

I'm only up to chapter 4 on this round so I'm completely fine with starting over (for the *sixth time*) and creating the partition using a GPT since the steps to this point aren't very time consuming.

I just want to know if going back to repartition to a GPT is what I should do, or if pressing forward with the dos partition will cause me any issues later on.

Thanks!

Last edited by davecan; 01-01-2020 at 05:02 PM.
 
Old 01-01-2020, 08:12 PM   #2
arch-linq
Member
 
Registered: Sep 2018
Location: Midwest, USA
Distribution: Arch,LFS,BLFS
Posts: 110

Rep: Reputation: Disabled
Hey dave.
Quote:
I just want to know if going back to repartition to a GPT is what I should do, or if pressing forward with the dos partition will cause me any issues later on.
It's important to understand the differences between mbr and uefi BEFORE you start building LFS or installing any distro or OS. Also to know why or in what circumstances one is the best choice. It's a stated user knowledge requirement by the book authors in the grub section. There's a few pages dedicated to grub bios mbr and uefi in the Arch wiki. That's required reading prior to building LFS imo. Users try to shortcut that by asking here or irc. I say sry ya gotta learn it. I did.

You wrote "Host is Arch 2019.05 in a VM." That right there should tell you which way to go imo. I always use mbr(dos) in VM's for simplicity/reliability. WHY? Because I'm not going to need more than the 4 primary partition limit mbr imposes nor am I using uefi in a VM. Bare metal is another story.

Last edited by arch-linq; 01-01-2020 at 08:42 PM.
 
Old 01-01-2020, 10:03 PM   #3
davecan
Member
 
Registered: Nov 2019
Posts: 45

Original Poster
Rep: Reputation: Disabled
Thanks. I know there are differences and used to deal with this stuff a lot more but stopped building my own systems almost two decades ago (before UEFI existed) so this project is just me rolling my sleeves up again. I'm also not an Arch user by any stretch, I only started using it to get a clean setup environment for this project but it does seem to be a nice distro. My current objective has nothing to do with learning Arch however, so I've only spent minimal time on the Arch site. It's just a means to an end.

Now that I know there is good info on this topic in an Arch wiki I found this on it:

Quote:
On a BIOS/MBR setup, GRUB uses the post-MBR gap for the embedding the core.img.
which is exactly what I needed to know but couldn't find on my own, hence my question.

You state that this is "stated user knowledge" but if knowledge of this is required prior to beginning LFS then it should be stated in their prereq section yet it is not. I made sure I met all their prereqs and read all of the links they provided before beginning.

Thanks again. I'll press on.

Last edited by davecan; 01-02-2020 at 10:33 AM.
 
Old 01-08-2020, 12:14 PM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,298
Blog Entries: 21

Rep: Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800
It's simple. GRUB2 has two parts. The first part, which goes into the MBR, is just a stub that launches the much larger second part. On a traditional DOS disk, this second stage of GRUB goes into the gap between the MBR (the first sector) and the first partition.

However on a GPT disk, the MBR is just a dummy and the sectors immediately following it contain the real partition table and must not be overwritten. So you need partition 1 to be a special "BIOS boot" partition, where the second stage of GRUB can go.
 
  


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
Rebuild UEFI windows 7 or 10, dual boot, mint17 Linux, GPT vs msdos partition table rtoney5 Linux - General 2 07-14-2017 10:03 AM
[SOLVED] 3TB partition with msdos partition table - how is this possible ? stoorky Linux - Hardware 2 09-01-2015 11:00 AM
Migration from MSDOS partition table to GPT davepi Linux - General 4 09-30-2012 11:30 PM
MSDOS and GPT partitioning in 1 Hard Disk vikrang Linux - Newbie 3 03-09-2011 09:37 AM
Restore an ext2 partition from a msdos partition zerotyler Linux - Newbie 4 10-02-2009 07:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 06:26 PM.

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