You are not logged in.

#1 2012-08-04 14:22:30

ralle
Member
From: Hannover
Registered: 2009-04-25
Posts: 20

Uncertainty with grub-bios, grub-install when installing Arch

Hi guys.

I decided to reeinstall Arch on my T400 laptop since I threw in a new SSD and some 8GB of RAM and given the fact the old install (which btw is running just fine) was on GRUB legacy.

There is one thing I'm not sure of and I hope somebody could clarify on this matter. The GRUB(2) wiki page has three ways of configuring the MBR (https://wiki.archlinux.org/index.php/GR … ode_region). It seems that neither the official installation guide, nor in the beginners guide seem to clarify if this step is mandatory during the installation via pacstrap. Maybe even pacstrap deals with this during the installation process? I really don't get it. I watched some Arch install vids on youtube, and nobody seems to pay this step any attention...

Before I forget here comes my partitioning scheme:

gdisk-configured GPD

1 partition --> 2 MiB partition --> no file-system
2 partition --> rest of the disk -->ext4 (discard, noatime, that kinda stuff in /etc/fstab)

So, what is the deal with that three steps described in the GRUB wiki post?

Many thanks in advance

ralle

Offline

#2 2012-08-04 14:47:01

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: Uncertainty with grub-bios, grub-install when installing Arch

This is something that does need to be clarified in the wiki. I ran into it last night while helping a friend do an install. Ended up going with syslinux, which is no big deal.


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#3 2012-08-04 15:38:03

ralle
Member
From: Hannover
Registered: 2009-04-25
Posts: 20

Re: Uncertainty with grub-bios, grub-install when installing Arch

Hey lifeafter2am,

thanks for the quick reply. I think in the meantime I'm going to have a quick look at syslinux...

Cheers

ralle

Offline

#4 2012-08-04 16:11:09

zero_one
Member
Registered: 2010-07-07
Posts: 104

Re: Uncertainty with grub-bios, grub-install when installing Arch

Are you trying to use a Bios GPT setup? i didnt see it specified. If so, make sure that your boot partition type is EF02. I had no problem switching all my devices from MBR to GPT, and reinstalling grub.

Last edited by zero_one (2012-08-04 16:17:26)

Offline

#5 2012-08-04 16:31:30

ralle
Member
From: Hannover
Registered: 2009-04-25
Posts: 20

Re: Uncertainty with grub-bios, grub-install when installing Arch

zero_one wrote:

Are you trying to use a Bios GPT setup? i didnt see it specified. If so, make sure that your boot partition type is EF02. I had no problem switching all my devices from MBR to GPT, and reinstalling grub.

...yes, that is exactly what I did. Sorry for not pointing that out. And it seems to work fine by the way! Being a fresh install on a newly purchased SSD, I didn't even have to convert from MBR to GPT...I did it right upfront. The question is more of a "do I need to perform these things from the GRUB2-post"? And if not mandatory, like it appears to be, what is the use case when I need to perform one of those three steps?

Offline

#6 2012-08-04 20:28:13

zero_one
Member
Registered: 2010-07-07
Posts: 104

Re: Uncertainty with grub-bios, grub-install when installing Arch

Sorry I'm not too sure which 3 steps you are refering to? originally I thought you had a issue installing on bios-GPT.

Offline

#7 2012-08-04 20:41:54

ralle
Member
From: Hannover
Registered: 2009-04-25
Posts: 20

Re: Uncertainty with grub-bios, grub-install when installing Arch

zero_one wrote:

Sorry I'm not too sure which 3 steps you are refering to? originally I thought you had a issue installing on bios-GPT.

...when you click on the link I added in my original post and scroll up just a few lines, you see this:

Install grub-bios boot files
There are 3 ways to install GRUB(2) boot files in BIOS booting:
#Install_to_440-byte_MBR_boot_code_region (recommended) ,
#Install_to_Partition_or_Partitionless_Disk (not recommended),
#Generate_core.img_alone (safest method, but requires another BIOS bootloader like grub-legacy or syslinux to be installed to chainload /boot/grub/i386-pc/core.img).

This is the part I don't quite understand. Do I need to perform one of these steps when I do a fresh install as I did? Is this step somewhere implicitly performed during the installation (by pacstrap perhaps)?


Hope I was able to clarify...

Thanks

Offline

#8 2012-08-04 20:48:56

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: Uncertainty with grub-bios, grub-install when installing Arch

ralle wrote:
zero_one wrote:

Sorry I'm not too sure which 3 steps you are refering to? originally I thought you had a issue installing on bios-GPT.

...when you click on the link I added in my original post and scroll up just a few lines, you see this:

Install grub-bios boot files
There are 3 ways to install GRUB(2) boot files in BIOS booting:
#Install_to_440-byte_MBR_boot_code_region (recommended) ,
#Install_to_Partition_or_Partitionless_Disk (not recommended),
#Generate_core.img_alone (safest method, but requires another BIOS bootloader like grub-legacy or syslinux to be installed to chainload /boot/grub/i386-pc/core.img).

This is the part I don't quite understand. Do I need to perform one of these steps when I do a fresh install as I did? Is this step somewhere implicitly performed during the installation (by pacstrap perhaps)?


Hope I was able to clarify...

Thanks

Yeah I agree. The way the page was written it sounded a lot like these instructions were for upgrading from grub-legacy to grub2 (i.e. it is under the instructions that talk about backing up your current grub setup).

BTW: Love Ninja Tunes zero_one. smile


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#9 2012-08-04 21:04:35

zero_one
Member
Registered: 2010-07-07
Posts: 104

Re: Uncertainty with grub-bios, grub-install when installing Arch

Gotcha!

Im a bit daft. When I tested the new install media, I manually installed grub as per my configuration. I don't think pacstrap would/should even attempt that, but then again i havent looked at the script calls. You're right though, after looking at the new install guide. It does seem vague as to the necessity of a bootloader.

Offline

#10 2012-08-04 21:19:48

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

Re: Uncertainty with grub-bios, grub-install when installing Arch

ralle wrote:

...when you click on the link I added in my original post and scroll up just a few lines, you see this:

Install grub-bios boot files
There are 3 ways to install GRUB(2) boot files in BIOS booting:
#Install_to_440-byte_MBR_boot_code_region (recommended) ,
#Install_to_Partition_or_Partitionless_Disk (not recommended),
#Generate_core.img_alone (safest method, but requires another BIOS bootloader like grub-legacy or syslinux to be installed to chainload /boot/grub/i386-pc/core.img).

This is the part I don't quite understand. Do I need to perform one of these steps when I do a fresh install as I did? Is this step somewhere implicitly performed during the installation (by pacstrap perhaps)?


Hope I was able to clarify...

Thanks

It is little tricky to understand. Install to 440 byte MBR boot code region means that you need the first 2048 sectors to store grub's information. It does not mean you need to make a 2 MB partition . For example if your hard disk have 100000 sectors then you need to make the partitions from 2048th sector[leaving first 2048 sectors(0-2047) alone] which means you have 97952 sectors left. By default when you partition using "fdisk" it automatically leaves the first 2MB and start form 2048th sector.

Edit reason: typo

Last edited by illusionist (2012-08-04 21:21:10)


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#11 2012-08-04 22:40:02

ralle
Member
From: Hannover
Registered: 2009-04-25
Posts: 20

Re: Uncertainty with grub-bios, grub-install when installing Arch

illusionist wrote:
ralle wrote:

...when you click on the link I added in my original post and scroll up just a few lines, you see this:

Install grub-bios boot files
There are 3 ways to install GRUB(2) boot files in BIOS booting:
#Install_to_440-byte_MBR_boot_code_region (recommended) ,
#Install_to_Partition_or_Partitionless_Disk (not recommended),
#Generate_core.img_alone (safest method, but requires another BIOS bootloader like grub-legacy or syslinux to be installed to chainload /boot/grub/i386-pc/core.img).

This is the part I don't quite understand. Do I need to perform one of these steps when I do a fresh install as I did? Is this step somewhere implicitly performed during the installation (by pacstrap perhaps)?


Hope I was able to clarify...

Thanks

It is little tricky to understand. Install to 440 byte MBR boot code region means that you need the first 2048 sectors to store grub's information. It does not mean you need to make a 2 MB partition . For example if your hard disk have 100000 sectors then you need to make the partitions from 2048th sector[leaving first 2048 sectors(0-2047) alone] which means you have 97952 sectors left. By default when you partition using "fdisk" it automatically leaves the first 2MB and start form 2048th sector.

Edit reason: typo


...well I don't quite know about the last statement. From where I'm standing I understand that post [https://wiki.archlinux.org/index.php/GR … structions] as to create a dedicated partition with a EF02 flag. That leaves you with a minimum of 2 partitions (1 filesystemless + 1 root) plus the 2 MiB gap in the very front of the drive.

I think zero_one's first reply kinda confirms that. But then again, I might be wrong all along...

Cheers
ralle

Offline

#12 2012-08-04 22:46:17

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Uncertainty with grub-bios, grub-install when installing Arch

Two things:

1) Sectors are 512 bytes, so the default fdisk config creates a 1MB gap, not 2MB.

2) Forget grub, just go with syslinux. Unless you have an EFI machine, in which case forget any bootloader, go with efi_stub and rEFInd.

Offline

#13 2012-08-04 23:21:41

ralle
Member
From: Hannover
Registered: 2009-04-25
Posts: 20

Re: Uncertainty with grub-bios, grub-install when installing Arch

Second time I hear that I should use Syslinux... Damn, maybe I should! But nevertheless, clarification on this matter would be helpful to others who want to stick to GRUB2.

Anyway, thanks for the contributions up to this point. Maybe someone will enlighten me.

Cheers

Offline

#14 2012-08-05 19:44:08

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

Re: Uncertainty with grub-bios, grub-install when installing Arch

Gusar wrote:

Two things:

1) Sectors are 512 bytes, so the default fdisk config creates a 1MB gap, not 2MB.

in my case when i tried the new installation media in VB, fdisk automatically started form the 2048th sector but that maybe just me.

@ralle those are gpt specific instructions and i was talking about MBR. If you have confusion just go with syslinux, it is as easy as grub-legacy.

I don't understand why it is so important for some people to switch to grub2 or replace grub-legacy if it is working fine, i mean it is just a bootloader what else would you like it to do for you besides booting your computer.

Last edited by illusionist (2012-08-05 19:47:50)


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#15 2012-08-05 19:57:29

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Uncertainty with grub-bios, grub-install when installing Arch

illusionist wrote:
Gusar wrote:

Two things:

1) Sectors are 512 bytes, so the default fdisk config creates a 1MB gap, not 2MB.

in my case when i tried the new installation media in VB, fdisk automatically started form the 2048th sector but that maybe just me.

Yes, fdisk starts at sector 2048 by default. One sector is 512 bytes. Now do the math. And notice your fail smile

Offline

#16 2012-08-05 20:11:25

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

Re: Uncertainty with grub-bios, grub-install when installing Arch

man.... you really like finding errors don't you ?
yes that was my mistake i didn't noticed that (may be too much caffeine) . I thought is was KB. tongue


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#17 2012-08-05 21:16:30

ralle
Member
From: Hannover
Registered: 2009-04-25
Posts: 20

Re: Uncertainty with grub-bios, grub-install when installing Arch

illusionist wrote:
Gusar wrote:

Two things:

1) Sectors are 512 bytes, so the default fdisk config creates a 1MB gap, not 2MB.

in my case when i tried the new installation media in VB, fdisk automatically started form the 2048th sector but that maybe just me.

@ralle those are gpt specific instructions and i was talking about MBR. If you have confusion just go with syslinux, it is as easy as grub-legacy.

I don't understand why it is so important for some people to switch to grub2 or replace grub-legacy if it is working fine, i mean it is just a bootloader what else would you like it to do for you besides booting your computer.

Illusionist maybe you haven't read my original post. I bought a new SSD and some RAM. Thought I reinstall Arch on my notebook. Now, I treated GRUB like any other other piece of software which was bumped up a version. GRUB2 became the thing to go with, GRUB1 became legacy. I agree that the bootloader isn't something all to spectacular and I have absolutely no problem switching back to GRUB legacy or Syslinux. BUT for instance if I ask about a feature regarding Postgres, I don't think the right answer would be, use Oracle or NoSQL. Apparently I'm not the only one who feels that that post can use some makeover in some paragraphs. On a different note, if this post helps making the wiki a bit clearer, I think it's a win for all of us.

Nevertheless, thanks for your effort.

ralle

Offline

#18 2012-08-06 17:15:33

ralle
Member
From: Hannover
Registered: 2009-04-25
Posts: 20

Re: Uncertainty with grub-bios, grub-install when installing Arch

...okay guys, let's wrap this thing up. Of course I couldn't let it go and I searched some more. When it comes down to it here's what threw me off:

I followed the official installation guide until the point >Install GRUB for BIOS. This still leaves me with an unconfigured bootloader. Here's where I looked further and basically followed the beginners guide which tells you to do a #grub-install /dev/sd[X] followed by an optional command in case one wants to prevent some error. In the GRUB2 wiki post the first and recommended method to configure the bootloader is pretty much what I did following the beginners guide, exept for some additional commands:

# modprobe dm-mod
# grub-install --target=i386-pc --recheck --debug /dev/sd[X]
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo

So let me refine my original question!

1. Is the loading of that module needed in the first place? Just invoking #grub-install /dev/sd[X] seemed to work fine...
2. Are those switches after grub-install needed? Or are they maybe the default behaviour when you just invoke #grub-install /dev/sd[X]


Cheers

ralle

Offline

Board footer

Powered by FluxBB