2

I had my laptop's HDD separated in 3 partitions:

  1. NTFS - Win XP install (primary)
  2. NTFS - common space (extended)
  3. ext4 - Ubuntu 10.10 (extended)

Running out of space, I deleted my 2nd partition, and formated it to ext4, planning to merge it to my 3rd partition.
The problem is that after restart I realized that grub was installed on partition #2.

Using grub (GNU GRUB 0.97) an Ubuntu 11.04 live CD, I tried:

grub> root (hd0,4)

grub> setup (hd0,4)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no

Error 15: File not found

grub> 

Also, for setup (hd0) I get the same result.

Right now I have:

  1. /dev/sda1 aka (hd0,0) - Win XP (NTFS)
  2. /dev/sda7 aka (hd0,6) - the free space (ext4)
  3. /dev/sda5 aka (hd0,4) - my previous install of Ubuntu (ext4)

How can I repair it?

2 Answers 2

4

This page documents installing GRUB from the live CD:

http://help.ubuntu.com/community/Grub2#METHOD%203%20-%20CHROOT

1

Ubuntu has moved to grub2 since 9.10, so you need to reinstall grub2, not grub-legacy. Boot from the livecd and:

sudo -s
mount -t ext4 /dev/sda5 /mnt
grub-install --root=directory=/mnt /dev/sda

Also you can't have an sda7 without an sda6, so check your partition numbers there. Since you want to merge that space into the other partition, then you should use gparted to delete the unused partition and expand the other one to use that space first, THEN reinstall grub.

2
  • 3
    It's better to chroot rather than using --root-directory (this guarantees that all the versions of GRUB code match up). help.ubuntu.com/community/Grub2#METHOD%203%20-%20CHROOT May 11, 2011 at 16:01
  • @Colin Watson since your remark worked flawlessly, if you turn your comment into an answer I'd be more than happy to set it as the accepted one! May 11, 2011 at 18:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .