• PHP
  • Ruby on Rails
  • MySQL
  • Linux
    • SELINUX
    • Fedora
    • debian
  • Apache
  • nginx
  • AJAX
Albertech.net

Tag Archives: Grub

Debian: Broken grub after Lenny upgrade

May 1, 2009 5:49 am / Albertech.net

I’ve done multiple Debian upgrades from Etch to Lenny and have noticed there are some issues with grub breaking. The upgrade somehow puts the wrong hard drive information in the default grub file.

Here’s some recommendations on how to perform the Lenny upgrade:

The safest way (before upgrading) is to look at the grub file:
nano /boot/grub/menu.lst

Look at the “default:” section and note which partition it uses to boot up. For instance look at the areas in red below:
root (hd1,1)
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/sda2 ro

In my situation, those two partitions were incorrect after performing the upgrade.  This leads to ALL the items in the grub menu breaking, which can be scary at first. You can however mount the hard drive on a working copy of Debian to get the correct partition or use the emergency CD to get into a working shell.

Here’s a guide on how to upgrade from Etch
http://www.debianadmin.com/howto-upgrade-from-debian-etch-40-to-lenny-50.html

If your grub is broken after the upgrade and you didn’t look at the partition info:
There is still hope! When grub loads up, press the “e” key to edit the grub menu file.

If grub doesn’t even load Linux properly, you will need to edit this:
1) Select the line with root(XXX,XXX). Press the “e” key to edit the line
2) This will be a guessing game, but most likely changing the hd1 to hd0 can fit it. E.g. (hd0,1)
3) After making the change, press “b” to boot
4) If it works, go into /boot/grub/menu.lst to edit the file and make the change in the default section.

If grub loads Linux, but it hangs on loading root partition, you will need to edit this line:
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/sda2 ro
1) Press the “e” key to edit this line
2) Change the /dev/XXX to the correct partition. Again, this might be another guessing game
but you can try changing the root= to /dev/sda1 or /dev/sda2
3) After making the change, press the “b” key to boot
4)  If it works, go into /boot/grub/menu.lst to edit the file and make the change in the default section.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Linux / Tagged: debian, grub, lenny upgrade

Categories

  • AJAX
  • Android
  • Apache
  • Canon Cameras
  • Cloud
  • CMS
  • Computer Mods
  • Conferences
  • Deals
  • debian
  • Fedora
  • Flash
  • Frameworks
  • git
  • Hardware
  • HTML
  • IDE
  • iPhone
  • iPhone App Review
  • jQuery
  • Linux
  • Mac OS X
  • MySQL
  • nginx
  • PHP
  • portfolio
  • Puppet
  • Ruby on Rails
  • Script Reviews
  • SELINUX
  • Software
  • Software Review
  • SQL Server
  • statistics
  • Tech
  • Tomcat
  • Uncategorized
  • VMWARE
  • VPS
  • Windows
  • wordpress
  • Zend Framework

Blogroll

  • DragonAl Flickr
  • Dropbox – Free 2GB Account
  • James' Blog
  • Javascript Compressor
  • PHP Builder Community
  • PHP-Princess.net
  • Rubular – Regular Expression Validator
  • The Scale-Out Blog
  • Tiny MCE

Tags

activation AJAX android antec Apache AWS awstats canon coda codeigniter debian enclosure external free G1 install vmware tools Internet Explorer iphone 5 jquery Linux mx-1 MySQL office 2007 OSX photoshop PHP plugin plugins portfolio redesigned website review rewrite script security SELinux ssh tinymce tutorial upgrade VMWARE vmware server wordpress wordpress mu XSS zend framework
© Copyright 2013 Albertech.net
Infinity Theme by DesignCoral / WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.