How I recovered my Archbox after deleting /boot

After 2 years of running arch, It started to feel a little clunky. Kde is giving me sound problems, dolphin is taking 10 seconds to load, etc..

I decided to give openSUSE a try. I installed it on my second drive, but after setting up grub, I accidentally overwrote the mbr on my arch drive. Ok, so now I lost access to my data. No problem, I thought. I’ll just add a menu entry to grub to boot into arch and everything will be OK!

I screwed that up. Here’s what happened: I screwed the MBR. Now I have no access to SUSE or ARCH. I quickly downloaded the latest arch live cd and shoved it into the DVD ROM. Somehow I end up deleting /boot, haha! so now I have no grub and no linux kernel. After hours of figuring out which partition table to use… mbr.. gpt.. wtf? and which boot option to set up.. efi, bios?  I ended up trying every possible combination and went with the MBR-BIOS combo.

Then, I spent the rest of the day figuring out the grub configuration and compiling linux-ck kernel. Luckily, I had an old menu.lst file that I could use for reference and I had sufficient experience compiling linux-ck: yaourt -S linux-ck

So now, I have my old arch box up and running. I feel like I’ve been on a long trip and just got back home. The things I hated about suse is how difficult it is to find software, add repositories and do all that shit. I  don’t think I will ever leave arch, now.

Here’s the list of wikis and forum posts, and linux kernel that helped get my system running again:

So, Here’s the list of mistakes I made trying to fix my system:

  • Attempting to install grub to the mbr using 
    # grub-install --target=x86_64-efi --recheck --debug /dev/sdb

    Obviously, that target is for an EFI setup. You have to specify –target=i386-pc even on 64 bit systems.

  • Getting error you need to load the linux kernel first. This means the root value of your grub.cfg file is wrong. Example:
    menuentry "Arch Linux" {
    set root=(hd0,5)
    linux /vmlinuz26 root=/dev/disk/by-uuid/69a3679e-f730-4ccc-8977-c0ef89bdea8a ro
    initrd /kernel26.img
    }
  • Getting grub “device not found”, that means the other root value is invalid. Example:
    menuentry "Arch Linux" {
    set root=(hd0,5)
    linux /vmlinuz26 root=/dev/disk/by-uuid/69a3679e-f730-4ccc-8977-c0ef89bdea8a ro
    initrd /kernel26.img
    }

That’s it. Hope this post helped someone.

Cheers! I am the one who knocks!