This is a long and strange process, but it works.
Part One: Creating a BIOS Boot partition.
First problem was that I'm using a GPT partition table. Just because you can install Linux and boot to it somehow doesn't mean that GRUB is working fine. I would assume that if I could boot previously, then things are okay, but that's not exactly the case. Create an unformatted partition with the
bios_boot flag set. The best way to do this is right from the get-go before you install anything on your hard disk, but it'll still work if you need to do it later, albeit you'll have a weird partition at the end of your disk. I like weird things to be at the start of the disk. In any case, here's what you need to do.
Due to the way that GPT is 1,000,000 times more efficient and intelligent (and yet still somehow so much less supported) than MBR, there is no space on the disk for the GRUB installation. Usually, GRUB installs itself at the beginning of the disk in-between partitions due to the fact that the MBR requires a gap after it. Weird? Totally, but that's just the way it is. Let's get started.
First, make sure you've got the right drive. Do not continue until you know that
/dev/sdX is the drive you think it is. Now that you've done your due diligence, do it again. Three times, just to be sure. Ok, let's move on.
# apt-get install parted) and start it up targeting your drive:
$ sudo parted /dev/sdX
If you haven't already, set the boot record label to GPT:
(parted) mklabel gpt
Next, create a partition for the BIOS boot stuff. I'm putting mine at the beginning of the disk, so here's what mine looks like:
(parted) mkpart primary 0MB 1MB
You should change the numbers above to tell parted where you want the partition to start and stop, respectively.
Now, let's set the flag on this partition. You may wish to run the
print command in parted to get the partition number. In my case, it's
1 since it's going to be the first partition, so here's how we set the flag on it:
(parted) set 1 bios_grub on
Okay, now that you're created this partition, we're done with this part. If you'd like, you can create your actual filesystem partition by doing the following:
(parted) mkpart primary 1MB 1TB
Only run the above command if it's what you really want to do and you haven't installed anything yet. If you've got a borked system, don't create another partition.
Part Two: Fixing GRUB
Now, you'll need to fix GRUB and fstab. We'll tackle fstab first. Load up a Live CD and mount your filesystem at
/mnt on the Live CD.
$ sudo mount /dev/sda /mnt
Now, get the UUID for your hard disk by using the
$ sudo blkid /dev/sda1
Grab the UUID and we'll update
/etc/fstab with it. Open up
/etc/fstab and update the UUID with the new one you just got from
blkid. Make sure you also replace
btrfs, now that you've changed your filesystem type. Look for the line that has a
/ in it, this is your root partition, this is the one you want to tweak. Great.
Now, let's update grub.
$ sudo grub-install --root-directory=/mnt /dev/sda
Grub will update and install to the hard drive. Cool. Next step is to update your GRUB configuration files. Let's bind some system partitions into the
$ sudo mount --bind /dev /mnt/dev
$ sudo mount --bind /sys /mnt/sys
$ sudo mount --bind /proc /mnt/proc
Now, let's chroot into your filesystem.
$ sudo chroot /mnt
This will effectively log you into your filesystem as if your computer was running it. Next, update grub.
$ sudo update-grub2
Hopefully, it'll happily churn away and update everything. Cool. Now, get back to your life and backup your changes. Learn from your mistakes.