Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Jan
Feb 27, 2008

The disruptive powers of excessive national fecundity may have played a greater part in bursting the bonds of convention than either the power of ideas or the errors of autocracy.
About 2 years back, I set up a home media server and gateway using Linux (gentoo). It uses a Gigabyte H77N-Wifi motherboard, which is UEFI compatible. For some long forgotten reason (I think GRUB2 wasn't gentoo recommended yet?), I instead opted to go the BIOS route. Since the drive I'm using is 3TB, I had to partition it using GPT.

Now I'm looking into making the switch to GRUB2 and I need to setup a BIOS boot partition for it.

code:
# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 3E788F2D-42A5-4E51-BF7A-2EF3F34BC83D
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 8-sector boundaries
Total free space is 0 sectors (0 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34          125000   61.0 MiB    0700  primary
   2          125001         4000000   1.8 GiB     8200  primary
   3         4000001      5860533134   2.7 TiB     0700  primary
Partition 1 is /boot, partition 2 is swap, partition 3 is /. Since swap is currently 100% unused (apart from cached mem), I'm thinking the simplest way to set up a new BIOS partition would be to turn swap off, split partition 2 and introduce a small 1MB partition before it and use that as BIOS boot.

Now, as much as I enjoy being "up to date", I don't actually need to do this since GRUB legacy will keep on working just fine. If this isn't safe to do, I'll just can GRUB2 and keep on trucking. Not to mention that if I wanted to be up to date, I should do the full monty and switch to UEFI. But somehow that seems even more risky to do on an existing system.

Can I safely do either of those? Should I stick to legacy?

Adbot
ADBOT LOVES YOU

telcoM
Mar 21, 2009
Fallen Rib

Jan posted:

About 2 years back, I set up a home media server and gateway using Linux (gentoo). It uses a Gigabyte H77N-Wifi motherboard, which is UEFI compatible. For some long forgotten reason (I think GRUB2 wasn't gentoo recommended yet?), I instead opted to go the BIOS route. Since the drive I'm using is 3TB, I had to partition it using GPT.

Now I'm looking into making the switch to GRUB2 and I need to setup a BIOS boot partition for it.

[snip]
Since swap is currently 100% unused (apart from cached mem), I'm thinking the simplest way to set up a new BIOS partition would be to turn swap off, split partition 2 and introduce a small 1MB partition before it and use that as BIOS boot.

Now, as much as I enjoy being "up to date", I don't actually need to do this since GRUB legacy will keep on working just fine. If this isn't safe to do, I'll just can GRUB2 and keep on trucking. Not to mention that if I wanted to be up to date, I should do the full monty and switch to UEFI. But somehow that seems even more risky to do on an existing system.

Can I safely do either of those? Should I stick to legacy?

Changing your bootloader without having an alternate means to boot the system is always risky: make a mistake and you'll end up with an unbootable system.
At the very least, have a tested Live-CD or some other "rescue mode" available that is independent of the bootloader on your hard disk.

With that caveat, I'd say your plan is sound. If this is your hobby system, go for it.
However, if this system has some important production role (like "keeping a non-technical Significant Other happy"), it might not be worth the risk.

GRUB2 is different from GRUB legacy in several important respects, so it's a good thing you want to learn it sooner rather than later. Since there is also an UEFI version of GRUB2, the knowledge you'll gain from this change can serve you later with UEFI too.

Microsoft's modern operating systems are prepared to handle two basic boot setups:
A.) GPT partition table on the system disk and UEFI boot (possibly with Secure Boot), or
B.) MBR partition table on the system disk and BIOS boot.

So it follows that these two options are what the motherboard and BIOS manufacturers mostly test for.
By choosing to use GPT with a BIOS boot, you're already stepped off the beaten path, but since your GRUB legacy works, it proves your BIOS can handle that, and GRUB2 should work just as well.

Switching to UEFI is a thing that is best to do when you have a new system and/or a fresh OS installation you can easily nuke & reinstall if necessary. If you can split about 100 MB off your swap partition, you could make it an EFI system partition (= gdisk partition type code ef00, with a VFAT/FAT32 filesystem) and go full UEFI.

Wait... In fact, since UEFI places no demands to the MBR contents (other than having the dummy MBR partition table in there), you could leave your current GRUB fully in-place while setting up an UEFI bootloader to the EFI system partition, and if it does not work, you'll only need an alternate boot solution that can be used to remove the special type code from the EFI system partition, and you can easily return to what you have now (at least in the viewpoint of BIOS/UEFI firmware).

So it could be said that your system is actually in a configuration that would be easy to convert to full UEFI, if you can accept the 100 MB haircut to your swap partition.
However, UEFI brings a lot of new things to learn, so going one step at a time provide a gentler learning curve.

  • Locked thread