Search This Blog

Thursday, March 17, 2011

Ubuntu 10.10 using GRUB 2.0 command prompt; Reconfigure GRUB after changing hard drive

When you see the grub splash boot menu press ‘c’ or ‘control-c’ to enter command prompt.

To successfully boot the system when something fails do the following:

grub> root
(to see what partition is to be booted)

grub> set root=(hd0,0)
(to set the root partition)

grub> kernel /vmlinuz root=/dev/sda1 ro Single
(or whatever other options you’d like at the end – these are passed as arguments to the kernel)
(you can use ‘linux’ command alternatively if there is no kernel command)

grub> initrd /initrd.img

grub> boot

 

Reconfigure GRUB after changing hard drive:

GRUB 2.0 config files are kept in: /etc/grub.d/

00_header        05_debian_theme  10_linux         20_linux_xen     20_memtest86+    30_os-prober     40_custom        41_custom        README

and in /etc/default/grub

?> update-grub
(generates grub.cfg from the above files) and updates UUIDs

?> grub-install /dev/sda1

 

Reconfigure GRUB 1.0 after changing hard drive:

run grub (usually in /boot/grub)

grub> root(hd0,0)

grub> setup(hd0)
(generates config from menu.lst)

3 comments:

  1. help. I'm trying to setup a new dual boot system on a new 2TB drive. I've installed windows 7 ultimate and created the four partion's. One for windows reserve, windows main boot system. and two other's that where setup for ubuntu 10.10. I manualy setup the root and swap area. I've been using clonezilla in an attempt to copy my original ubuntu 10.10 to the new drive. It will copy my imag and partion and will boot fine into ubuntu, but the gurb boot record will not show the windows system anymore to select to boot to. keeps writing over the boot record? The windows partion's are still there and I can access them via ubuntu. Is there something like what windows use to transfer to a new computer? I'm able to create a windows 7 image to install on the new drive in windows partion and work's great. I only have to reinstall some programs and I'm back up and running. But trying to do the same for ubuntu 10.10 and keep the same original that I'm transfering is proving some what difficult.

    ReplyDelete
  2. Problem sovled...

    ReplyDelete

If you like this post, please leave a comment :)