grub – Grey Panthers Savannah https://grey-panther.net Just another WordPress site Tue, 12 Apr 2011 15:59:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 206299117 Booting the Linux Kernel from Grub2 https://grey-panther.net/2011/04/booting-the-linux-kernel-from-grub2.html https://grey-panther.net/2011/04/booting-the-linux-kernel-from-grub2.html#respond Tue, 12 Apr 2011 15:59:00 +0000 https://grey-panther.net/?p=65 Recently a good friend of mine managed to uninstall all the kernels from his Ubuntu machine (what can I say – Monday morning and no coffee is a deadly combination). Luckily he had the install CD on hand so we did the following:

  1. Boot from the CD (we had Internet connection)
  2. Mount the Linux partition and chroot into it
  3. sudo su
    cd /media/..
    chroot .
    
  4. Reinstall the kernel with aptitude
  5. Reboot and go into Grub2 command mode
  6. Now do the following (commands need to be adjusted to match your partition – also, tab completion works, so you don’t have to guess)
    insmod part_msdos
    insmod ext2
    set root=(hd0,3)
    linux /boot/vmlinuz-2.6.32.38-generic root=/dev/sda3 ro
    initrd /boot/initrd.img-2.6.38-6-686
    boot

It seems that most of the examples on the ‘net are for Grub 1 and little is out there for Grub 2. I found the following three: How to use Grub2 to boot Linux manually, The Grub 2 Guide, GRUB 2 bootloader – Full tutorial. Also, I didn’t perform steps 4-5 because he just reinstalled Ubuntu (it was a fresh install anyway), but I tried it out separately on my laptop and it works.

HTH

]]>
https://grey-panther.net/2011/04/booting-the-linux-kernel-from-grub2.html/feed 0 65
Booting FreeDOS with GRUB https://grey-panther.net/2008/12/booting-freedos-with-grub.html https://grey-panther.net/2008/12/booting-freedos-with-grub.html#respond Sun, 28 Dec 2008 19:51:00 +0000 https://grey-panther.net/?p=503 To toy around, I decided to install FreeDOS on a real system running Ubuntu. This post will document the process of adding an entry to the GRUB menu loader to boot it. Some small notes:

  • Resizing partitions with GPartEd is somewhat funky (no global progress bar) and can take some serious time (if you are moving data, it first performs a complete test run, thus taking twice as long as the vanilla operation)
  • If you use the XFDISK tool from the FreeDOS CD, you’ll have to restart the system for the installer to continue – this is a limitation of DOS, which can’t dynamically update the list of partitions.
  • By default, the FreeDOS installer doesn’t muck around with the MBR – a wise choice, but one which can make you wonder: how do I boot this thing? Read on an you will find out…
  • Some memory manager configurations presented in the FreeDOS boot menu will not work – if this is the case, try other ones.

To add FreeDOS to your GRUB menu, do the following:

  1. Find out the UUID of the partition you’ve installed FreeDOS on (you coult use the direct addressing, but UUID’s just look more fun :-)). There are several ways presented on the ubuntu forums, from which I like the following the best: ls -la /dev/disk/by-uuid.
  2. Open your menu.lst in a text editor: sudo gedit /boot/grub/menu.lst
  3. Go to the end of the file after the “### END DEBIAN …” part. That part is overwritten every time a kernel update is installed, so it is wise to avoid it, unless you want to repeat these steps frequently 🙂
  4. Add the following lines:

    title    FreeDOS
    uuid     1abf-24ac
    makeactive
    chainloader +1
    boot
    

  5. Some notes: of course you can make the title whatever you want. The UUID must be the UUID of the partition which you’ve determined at step 1. It must be lowercase (otherwise the boot will fail).
  6. Save the file and test the new entry by rebooting, entering the GRUB menu (by pressing ESC during the 3 seconds grace time) and choosing the new entry.

PS. You can read the GRUB manual for more commands, however I found it to be a little outdated (for example it doesn’t mention UUID).

]]>
https://grey-panther.net/2008/12/booting-freedos-with-grub.html/feed 0 503