I had Xubuntu installed on my laptop on harddrive /dev/sda on partition /dev/sda1.
Something bad happened and when I restarted my laptop black screen appeared with "kernel panic" message.

So I decided to install Lubuntu from live CD. I installed it on /dev/sda5 (it has 6 GB size). It was initially swap partition, but I decided that I don't need to have swap partition because I have 2 GB RAM.
So, I installed Lubuntu without problems. After restart a black screen with the following message appeared:

no such partition
grub rescue>

So I booted again from live CD and changed in fdisk the boot partition to /dev/sda5. After restart I only can see grub command line.

fdisk -l shows

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c212c

Device Boot Start End Blocks Id System
/dev/sda1 1 18706 150253568 83 Linux
/dev/sda2 18706 19458 6034433 5 Extended
/dev/sda5 * 18706 19458 6034432 83 Linux

Could you advise me how to repair Grub to be able to boot to /dev/sda5 with Lubuntu?

thank you


If you are able to see Grub menu coming up during boot, you can interupt it with a key press. Then select your Lubuntu entry, press (e) and check root, kernel showing all to sda5

Grub use another naming scheme internaly, so sda5 would be hd(0,4)

Then (b) to boot that entry.

If you only see the Grub rescue screen, you can try the following to boot into your Lubuntu on sda5:

root hd(0,4)
kernel /path/to/vmlinux root=/dev/sda5

Once booted check with Grub commands that you boot into Lubuntu each time.

  • I'm not sure what I can see after restart. It's not Grub menu and it's not rescue screen. It's grub command line now. OK, I will try the commands you advise in grub command line. Could you tell me what is /path/to/vmlinux? thank you
    – xralf
    Mar 26 '11 at 19:43
  • It's the path to the kernel boot file. Should normaly be in /boot/.
    – derchris
    Mar 26 '11 at 19:46
  • root hd(0,4) was OK kernel /boot/vmlinuz-2.6.35-22-generic root=/dev/sda5 writes error: unknown command 'kernel'.
    – xralf
    Mar 26 '11 at 20:01
  • I tried linux command instead of kernel command. I'm not sure which version of vmlinuz I chosen (there were more options). After the boot command I was in my Lubuntu, but the touchpad and internet connection wasn't working. I rebooted and I was again in grub command line instead of grub menu.
    – xralf
    Mar 26 '11 at 20:27
  • It worked now. I had to copy the vmlinuz-2.6.35-22-generic (I used bad version of kernel before) to the /boot directory in /dev/sda1 and then I used the command linux /boot/vmlinuz-2.6.35-22-generic root=/dev/sda5. But after restart I always have to play with the grub command line. I suppose that solution is in your sentence Once booted check with Grub commands that you boot into Lubuntu each time. Could you please explain how do you think it? thank you
    – xralf
    Mar 26 '11 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.