Possible Duplicate:
How to Repair Grub while dual booting ( win7 / ubuntu 11.10)

I had installed Lubuntu on a PC with Windows XP and used dual boot for some time with no problems.

Since I had almost abandoned Windows (kept it for printing...) I decided to resize its ntfs partition and add the free space to my Ubuntu space.

Tried that with a gparted stick and a live cd but would not work due to an issue related to the ntfs partition: gparted signaled with a red exclamation point that there was a problem with that partition. I read that a checkdisk might solve it but in the end used EaseUS in Windows to shrink (resize) the ntfs partition and create a new one (ext3) from the space left.

All seemed ok with that procedure: but resizing the partition and moving the data might have affected the grub file: or whatever the following message means, which I get when trying to start my pc:

error: file not found
grub rescue>

Booting from a live cd I see, beside the shrinked windows partition and my old linux one, the newly created partition, containing a directory called lost+found that I cannot open.

Can I fix the grub file and recover both my XP and Lubuntu installations?


Short answer is yes. Use the LiveCD for that. Here is one description on how to repair lost grub.

Another way of doing it is this:

  1. Boot into LiveCD ("try out Ubuntu"). Open a terminal and type

    sudo -i

    Now you are root.

  2. Mount the system already installed on the hard drive. We pretend that the hard drive of your computer is /dev/sda, and that your Ubuntu is installed on the partition /dev/sda3 (that is, /dev/sda3 would normally get mounted to /). You can find that out by typing fdisk -l.

    mkdir -p /mnt
    mount /dev/sda3 /mnt
    mount -t proc none /proc /mnt/proc
    mount -o bind /dev /mnt/dev
  3. Now you will chroot into the system that is installed on your hard drive and run update-grub to restore your grub settings.

    chroot /mnt /bin/bash
| improve this answer | |