After installing Ubuntu my computer boots into GRUB rescue mode after displaying 'no such partition' error message.

11,324

Try to re-install GRUB (Hoping your installed Ubuntu partition is there).

  1. Boot using a live cd of ubuntu.

  2. Open a terminal and run the command

sudo fdisk -l

It lists the complete partition table of the hard disk. In there, identify which partition you have got your linux installed on. You can identify it using the drive size you had allocated for it and looking at the last column of the output which will be ‘extended’ for all of your linux partitions. The partition will most probably be something like /dev/sda5 or something. Remember this partition.

  1. Create a temporary folder in your home directory (Note: You can make the temporary folder anywhere you want. I’m using the home folder just for the sake of explanation). I’m calling it ‘temp’ for now. So that ‘temp’ folder’s path will be /home/ubuntu/temp.

  2. Mount your linux partition there. That is, assuming that you found your linux partition to be /dev/sda5, you mount that at the ‘temp’ folder by doing the following command

sudo mount /dev/sda5 /home/ubuntu/temp

  1. If you want to check whether you have mounted the correct partition, go to your home folder and open temp. You will be in the ‘/’ directory. In there you will find ‘home’, in which your home folder’s name will be there. Once you’ve confirmed you have mounted the correct partition, do step 6.

  2. You have to install grub by showing the system where to read the data from the hard disk at the beginning. Don’t worry, just run the following command

sudo grub-install --root-directory=/home/ubuntu/temp /dev/sda

The ‘/dev/sda’ corresponds to your hard disk name. Replace it by whatever the command ‘sudo fdisk -l’ command showed you.

  1. You’re done. You may restart your system
Share:
11,324

Related videos on Youtube

VictorVictor5
Author by

VictorVictor5

Updated on September 18, 2022

Comments

  • VictorVictor5
    VictorVictor5 over 1 year

    I wanted Ubuntu on my Gateway Solo Laptop. It had Win98 on the C:\ and WinXP on the D:\. Before the install, I could not boot from CD, but I could boot from floppy.

    I installed Ubuntu to run alongside Windows XP as that was one of the options. It didn't detect Win98, but I swear it's on there. Install seemed fine and then it asked me to reboot.

    When I rebooted, I got the message error: no such partition and the grub rescue> command prompt. I've looked around, but some commands, like sudo, don't work. One command I did get to work was set root=(hd0,0) if that helps.

    I'm a noob, and it was a pain installing Win98 and XP since this system is so old. I don't want to wipe my drive and start all over!


    Additional details copied from comments

    Addendum, I restored my master boot record via my Win98 boot floppy and typing in frisk /mbr. But, I'd still like to get ubuntu - any help?

    If I restored my master boot record - did I delete Ubuntu?

    • VictorVictor5
      VictorVictor5 almost 12 years
      Addendum, I restored my master boot record via my Win98 boot floppy and typing in frisk /mbr.
    • VictorVictor5
      VictorVictor5 almost 12 years
      But, I'd still like to get ubuntu - any help?
    • VictorVictor5
      VictorVictor5 almost 12 years
      Crap, if I restored my master boot record - did I delete Ubuntu?
    • nanofarad
      nanofarad almost 12 years
      If you've destroyed your MBR, you have not destroyed Ubuntu. You have just destroyed that little elf that will guide you there. You can reinstall GRUB, and that elf will return., (No misnomer/pun intended)
    • VictorVictor5
      VictorVictor5 almost 12 years
      No I didn't abandon the question - are all of the posts showing up Irrational John?
    • irrational John
      irrational John almost 12 years
      @RobertArkenin The option --root-directory is not supposed to be valid for grub-install any longer. It was replaced by --boot-directory. See section 19 of the Grub user manual. I also don't see why one would install GRUB to /home/ubuntu/temp.
    • irrational John
      irrational John almost 12 years
      @VictorVictor5 What exactly is it that you want to pursue? My understanding is that you restored a Windows (Win98???) MBR so you should be able to boot Windows again. Do you still want to recover your Ubuntu installation? Are you going to overwrite it with Lubuntu? We seem to have drifted far away from the original question and I am not sure there is a valid line of inquiry here any longer.
    • VictorVictor5
      VictorVictor5 almost 12 years
      @Irrational John - I'm a noob, and this is my first time doing Linux ever, on top of that a very old machine (from '98). I'm going to try Lubuntu since it seems it's a lighter version than Ubuntu (I could be wrong). All I was trying to do was triple boot my computer. But I think I got it. Thanks for your feedback.
    • nanofarad
      nanofarad almost 12 years
      @irrationalJohn my old post disappeared, but we're not trying to install GRUB to the OP's home directory, we're using it as a temporary mount point.
  • VictorVictor5
    VictorVictor5 almost 12 years
    harisibrahimkv, here's the thing - I can't boot from CD (but I can boot from floppy), and I did try the sudo command, but grub rescue says its an unknown command.
  • VictorVictor5
    VictorVictor5 almost 12 years
    Any other ideas?
  • VictorVictor5
    VictorVictor5 almost 12 years
    Also, dumb question, but since I'm new, what the heck is a "live cd" of ubunutu? Is it the same thing as burning it to CD?
  • harisibrahimkv
    harisibrahimkv almost 12 years
    Live CD is the CD/USB of Ubuntu that you boot from. Here it might be termed as "Live floppy". Actually, Live specifically refers to the "Try Ubuntu" option. If you can boot from floppy and select "Try ubuntu", then do try and reinstall GRUB as I've said in my answer. Also, none of the commands I mentioned above are for a GRUB rescue prompt.
  • VictorVictor5
    VictorVictor5 almost 12 years
    One more quick question, would this still work with Lubuntu? My specs are PII 400 MHz, 384 MB RAM, 160 GB IDE HDD, but my I have 2 partitions on it already - Win98 on C:, and WinXP on D:, and I wanted Ubuntu or Lubuntu on a third partition, i.e., a triple boot. Your thoughts on an appropriate distro for something this old? Thanks again!
  • harisibrahimkv
    harisibrahimkv almost 12 years
    Ubuntu might 'just' run on it but I definitely do not recommend it. As far as I know, Arch Linux would be well for you although it is not a distro that will have everything set and ready for you. You'll have to spend a little time in preping it up. I also have heard of a linux distro called gentoo that takes about one a and a half days to install, but will be configured exactly for your system's hardware so that it will have maximum performance. It depends on how much patience you have. :) PS: Try giving Debian a shot too. I'm positive that it will work fine on your machine.
  • nanofarad
    nanofarad almost 12 years
    Yes, you may use Lubuntu. Also, sudo is a Linux command, not a grub command.; The commands used in grub are ones needed to find Linux and boot your system, not run Linux programs directly.
  • VictorVictor5
    VictorVictor5 almost 12 years
    Robert, sorry, one more question - you said I can use Lubuntu, but given the specs of my system, should I do Desktop Lubuntu, or Core? Also, which version? Sorry, this is all new to me!
  • nanofarad
    nanofarad almost 12 years
    You should get Lubuntu desktop (The newest version is fine) as it has useful things like a text editor, word processor, etc. Also, you may boot from the live installation media(Where you downloaded Lubuntu and wrote it to, like a CD, or even your floppy boot), and try to install from there. If you get a GRUB issue again, you may open a terminal and run the commands sudo apt-get install boot-repair, and then run boot-repair once it is installed.
  • VictorVictor5
    VictorVictor5 over 11 years
    Yeah I went ahead and used Puppy Linux.