grub rescue -> no such partition

137,481

Solution 1

The grub rescue> prompt signifies that GRUB 2 has failed to find the grub folder, the grub.cfg file, and/or the associated modules. The rescue prompt is presented so the user can provide the path to the grub folder, load the necessary modules, and provide the proper boot commands. A common reason for the grub rescue> prompt is an incorrect path to the grub folder. Reasons for the prompt also include a failure to update GRUB 2 after certain system or partition operations, improper designation of the grubfolder location, missing linux or initrd.img symlinks in /, or a failed installation. To successfully boot from the grub rescue> prompt:

  1. The grubfolder must exist and contain the necessary GRUB 2 files and modules.
    2. The proper paths must be set via the set prefix command. Many GRUB 2 commands will not work until the correct path is set. If the path to the grubfolder (normally/boot/grub) is not correct, an unknown command or file not found message is likely.
  2. The necessary modules must be loaded. The kernel cannot be loaded until the 'linux' module is loaded.
  3. A Linux kernel and initrd.img must be located and loaded.

In your case the grub folder and grub.cfg is seems to be available but inaccessable because your OS's partition can't be mounted, as the corresponding module is not loaded or it is corrupted during resizing. For the module to load your grub should be completly loaded or prefix should be set. For that do the following:

  1. set prefix=(hdX,Y)/boot/grub
    Use the values determined earlier. Example: If the Ubuntu system is on sda5, enter: set prefix=(hd0,5)/boot/grub
    In your case it most probabily is (hd0,3)
  2. set root=(hdX,Y)
    Confirm the correct X,Y values and press ENTER. Example: If the Ubuntu system is on sda5, enter: set root=(hd0,5)
  3. insmod normal
    Load thenormal module.
    If the module loads there will be no message. If the module fails to load, try the full path: insmod (hdX,Y)/boot/grub/normal.mod
  4. normal Transition to the normal GRUB 2 mode with increased functionality. If the module loads there will be no message. If the module loads, HELP, TAB completion and command recall using the UP/DN keys should be available.
  5. set (Optional) Review the current settings.
  6. insmod linux Load the linux module. An error message usually means the path is incorrect.
  7. configfile /boot/grub/grub.cfg . This should load your configuration file that allow to boot all OSs.

Solution 2

As stated elsewhere, the correct command is ls (hd0,1)/. Please try to see if that will list the contents of the file system.

To load your system manually in grub

If vmlinuz and initrd.img do not exist at (hd0,3)/, you have to specify their exact location to boot into linux. So, in grub (please adapt vmlinuz and kernel versions to your setup)>

set root=(hd0,3)
linux (hd0,3)/vmlinuz root=/dev/sda3 ro

or if (hd0,3)/vmlinuz does not exist:

linux (hd0,3)/boot/vmlinuz-2.6.32.25-generic root=/dev/sda3 ro

then

initrd (hd0,3)/boot/initrd.img 

or if (hd0,3)/initrd.img does not exist:

initrd (hd0,3)/boot/initrd.img-2.6.33-25-generic 
boot

More info can be found here.

Share:
137,481

Related videos on Youtube

user300385
Author by

user300385

Updated on September 18, 2022

Comments

  • user300385
    user300385 over 1 year

    I have a big problem with my computer...

    I have reduced the windows partition and when I reboot then I have the grub rescue with the error message: "no such partition".

    Moreover, I don't have access to the bios and so it seems impossible to change the boot sequence to boot on my live usb or live cd.

    The command line ls gives me: (hd0) (hd0,1) (hd0,2) (hd0,3)

    I have a recovery windows partition (1 I think), a windows partition and a linux partition.

    Yet, the command lines ls (hd0,1), ls (hd0,2) and (hd0,3) gives me the error message: "unknown filesystem" and so I can't set a boot anymore.

    Do you have any idea?

    • enedil
      enedil almost 10 years
      Do you have Windows 8?
    • Amr Ayman
      Amr Ayman almost 10 years
      Have a look at this answer ...
    • Rafed Nole
      Rafed Nole almost 10 years
    • Rafed Nole
      Rafed Nole almost 10 years
    • Rafed Nole
      Rafed Nole almost 10 years
    • Rafed Nole
      Rafed Nole almost 10 years
      Please help in the above questions as well . I am unable to locate the partition and am fed up by ubuntu.please help. see my questions above .Thanks.
    • Rafed Nole
      Rafed Nole almost 10 years
    • Sudheer
      Sudheer almost 10 years
      why cant you access your bios it has nothing to do with grub
    • Rafed Nole
      Rafed Nole almost 10 years
      @Sudheer I dont know much i would greatly appreciate if you could help me fix this Thanks
    • Sudheer
      Sudheer almost 10 years
      can you access you bios setting
    • Rafed Nole
      Rafed Nole almost 10 years
      when i boot i get the grub rescue prompt
    • Rafed Nole
      Rafed Nole almost 10 years
      no key works just ls command works
    • Sudheer
      Sudheer almost 10 years
      Before grub screen when your computer logo comes you should see "esc for setup" like that
    • Rafed Nole
      Rafed Nole almost 10 years
      yes esc for start-up but pressing esc does nothing
    • Sudheer
      Sudheer almost 10 years
      To solve your problem you may need Ubuntu live usb/cd.
    • Rafed Nole
      Rafed Nole almost 10 years
      @Sudheer Without cd there are some ways i found I don't have any CDs
    • Rafed Nole
      Rafed Nole almost 10 years
      Could you look at the links I have commented above They describe the way I have tried
    • Sudheer
      Sudheer almost 10 years
      Does it say any other keys than esc. like F11
    • Rafed Nole
      Rafed Nole almost 10 years
      askubuntu.com/questions/493826/… This question gives the way I tried
    • Sudheer
      Sudheer almost 10 years
      @Rafad Nole where is your question link
  • Elder Geek
    Elder Geek almost 10 years
    After you get it booted manually, Run Boot Repair to fix your Grub - Here's just one of the many sources regarding how to do this: howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-bo‌​ot
  • Bram
    Bram almost 9 years
    I get: Unknown command `linux'. With ls I do see that vmlinuz and initrd are on (hd0,msdos5)
  • noleti
    noleti almost 9 years
    @Bram please open a new question on that, it might be a different issue, or search for other more fitting questions here
  • dev_ry
    dev_ry over 6 years
    Use the values determined earlier. in step 1, but can you please tell whats that command
  • Md Narimani
    Md Narimani over 4 years
    I have to do this every time I boot. How can I fix this permanently?
  • Harshiv
    Harshiv almost 4 years
    In my hp 15-ac026tx 'Ubuntu 18.04's case, both the vmlinuz and initrd.img were present in root, but it was "(hd0,8)/" instead of (hd0,1)/ , it shows "(hd0,msdosY) where Y is 123..89 etc number, but I did not need to type full (hd0,mados8)/ , only (hd0,8)/ worked as well the full fledged one.