Manual Kernel Loading in Ubuntu
24 Sep 2010
Last week, when I updated my ubuntu dev box, the GRUB loader suddenly stopped working. I get the GRUB shell whenever I select Ubuntu from the OS menu when starting my laptop. I experienced this before and it took me some time to make it work.
Since it's happening again, I figured it would help someone if I share how I make the kernel load.
I really don't remember where I got the lines below but what I do remember is that it's a forum (not much help eh). Anyway, just type the following lines in the GRUB shell.
>> insmod ntfs >> set root=(hd0,1) >> loopback loop0 /ubuntu/disks/root.disk >> set root=(loop0) >> linux /boot/vmlinuz-X.X.XX-XX-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro >> initrd /boot/initrd.img-X.X.XX-XX-generic >> boot
Don't forget to change X.X.XX-XX with the kernel version available to your system.
But this won't do because I don't want to remember, or type for that matter, all those lines everytime I boot up my machine. So what I did was place all the lines in a file which I called booter and place it in my home directory. So instead of typing all those lines, I only get to type
>> . /home/jim/booter
This would've have worked, in theory. But I don't know why the hell it didn't :p So I tried removing the lines one by one and ended up with
>> . /home/jim/booter >> initrd /boot/initrd.img-X.X.XX-XX-generic >> boot
Which means that the file only contains the 5 lines of the code. Hope this helps someone :)