Pages

Showing posts with label grub2. Show all posts
Showing posts with label grub2. Show all posts

December 10, 2013

I messed up my EFI boot

I have Debian installed on /dev/sda4 and it’s using EFI. I installed Arch Linux to another partition, /dev/sda5 the other day and it created a new GRUB2 menu during boot. Unfortunately, I somehow messed up the installation and when I chose to boot Arch from GRUB2, I get an error:

error: no such device: d4103fa-d940-47ca-...
Loading Linux core repo kernel...
error: no such partition.
Loading initial ramdisk...
unaligned pointer 0x22
Aborted. Press any key to exit.

Once I pressed any key, the Debian GRUB2 menu was displayed (giving me the idea that 2 GRUB2 menus have been installed to the EFI boot partition) and I was able to boot into Debian.

Since Arch didn’t want to start, I reformatted /dev/sda5 to remove it and went to remove it from the EFI boot parition. I searched the web on how to do this and came across this post which basically says that GRUB2 isn’t needed to boot Linux in EFI; EFI stub can be used. Thinking it would work, I reformatted /dev/sda1, where my EFI boot partition is, and followed the instructions.

Reboot…computer is stuck with a black screen with a blinking cursor on the top-left corner. Not a good sign. Waited a full 5 minutes to see if it would boot up. Nothing. Rebooted 10 times more. Nothing.

I knew I messed up my EFI boot.

After doing a lot of reading, I felt that it would take too much time (4chan was waiting…LOLs) to get my boot loader back up without GRUB2. So I decided to reinstall GRUB2 via a chroot environment using Mint 16 live USB (booted in UEFI).

Inside Mint, opened a Terminal and

(mint)$ sudo mount /dev/sda4 /mnt
(mint)$ sudo mount /dev/sda1 /mnt/boot/efi
(mint)$ for i in /dev /dev/pts /proc /sys; do sudo mount $i /mnt$i; done
(mint)$ sudo chroot /mnt

(chroot)# apt-get --reinstall install grub-efi-amd64
(chroot)# exit

(mint)$ for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done
(mint)$ sudo umount /mnt/boot/efi
(mint)$ sudo umount /mnt
(mint)$ sudo reboot

After POST, the Debian’s GRUB2 menu showed and I’m once again able to boot into the computer.

December 27, 2010

Clean Up the GRUB2 Menu

I'm on my Christmas break and so I get to use my personal computer most of the time. I am currently using an Ubuntu run netbook and lately I did a kernel upgrade as per advice of the update manager.

I noticed that the Grub menu at the boot screen is presenting me with way too many choices of the different kernels installed and it looks messy (for me). So today, since I am on vacay and I don't have much to do, I decided to try and clean up the Grub menu. This will not only make the Grub menu look cleaner, it will also remove the unused kernels and recover some disk space.

First up, I had to make sure which is the latest kernel installed so I don't accidentally remove that one. So I went to the command line, issued an command and got a result of the latest kernel installed.

ric@ubuntu-nb:~$ uname -r
2.6.32-27-generic

July 11, 2010

How I Got PC-BSD Into The GRUB2 Menu of Ubuntu

Long story short -- I followed a guide for this; CLICK ME and I will take you there.

Long story long, this is how I did it personally.

I went into Terminal and typed:

riclags@nix:~$ sudo fdisk -l
[sudo] password for riclags:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00095910

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2432    19530752   83  Linux
/dev/sda2            2432       15076   101561345    5  Extended
/dev/sda3           15076       19458    35195737+  a5  FreeBSD
Partition 3 does not end on cylinder boundary.
/dev/sda5            2432       14590    97654784   83  Linux
/dev/sda6           14590       15076     3905536   82  Linux swap / Solaris

I took note that FreeBSD, the base of PC-BSD, is in /dev/sda3 device.

Ubuntu 10.04 LTS comes installed with GRUB2 so doing changes to the menu is a bit different.