Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-14-2010, 10:07 PM   #1
LQ Newbie
Registered: Jun 2009
Posts: 22

Rep: Reputation: 0
Recover grub with /boot on a separate partition.

Somehow I broke my boot. Probably after playing with PClinuxOS install which has legacy grub version.
I need help with recovering grub with /boot on a separate partition.
Most tutorials suggest that boot directory is on the same partition with system. But I have boot on the /dev/sda1 and Kubuntu on the /dev/sda5.

I tried to boot from Ubuntu livecd and execute

sudo grub-install --root-directory=/mnt/sda1 /dev/sda
sudo grub-install --root-directory=/mnt/sda5 /dev/sda

But with no result. I always boot in the empty grub console.
Fortunately I have all my boot drive in tar.bz2, so I can experiment.

What should I do to recover my boot?
Old 09-14-2010, 10:35 PM   #2
Registered: Sep 2004
Distribution: FC, ubuntu, OpenSuse
Posts: 112

Rep: Reputation: 16
1. Boot into the live CD

2. from console
~$ sudo apt-get update

3. Now mount the exiting Linux install:
~$ sudo mount /dev/sda5 /mnt/
~$ sudo mount /dev/sda2 /mnt/boot

4. Bind your /dev, /proc and /sysfs and copy over the resolv.conf then chroot into it:
~$ sudo mount –bind /dev /mnt/dev/
~$ sudo mount -t proc proc /mnt/proc/
~$ sudo mount -t sysfs sys /mnt/sys/
~$ sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
~$ sudo chroot /mnt

5. Now install and grub:

~$ apt-get update
~$ apt-get install grub

6. Create the GRUB directory:
~$ mkdir /boot/grub/

7. Copy over the GRUB files to the new grub folder:
~$ cp /usr/lib/grub/x86_64-pc/* /boot/grub/
(Replace x86_64-pc with your architecture if you are using something other than AMD64)

8. Now run grub:
~$ grub
grub> device (hd0) /dev/sda
grub> find /boot/grub/stage1
grub> root (hd0,X)
grub> setup (hd0)

If ‘fine /boot/grub/stage1′ shows something else than 0,0, for example 1,0, then do ‘root (hd1,X) X is the partition number where / is.

9. Now you can create a menu.lst by running:
~$ update-grub
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does a separate boot partition ensure that grub doesn't get deleted easily? samrat_rao Linux - General 1 02-15-2009 02:24 AM
locate grub.conf on a separate /boot partition to edit in an additional kernel ktek Linux - Newbie 6 10-03-2008 08:21 PM
Dual boot, two HDs. Separate /boot partition advisable? mailforbiz Ubuntu 3 06-14-2007 10:15 AM
Grub install with separate boot partition oomfoofoo Slackware - Installation 3 12-29-2006 11:04 AM
[SOLVED] Moving /boot to separate partition and using 'grub' to boot eldiener Linux - General 4 11-28-2006 08:01 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration