Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1026  / 2 Years ago, mon, march 28, 2022, 4:56:21

I have Ubuntu 12.04 LTS 64-bit installed on my desktop PC, and it was working fine until a short while ago. I tried to reboot into Ubuntu after removing a Kubuntu installation from my PC and resizing my Ubuntu partition using my 11.10 live CD. When I rebooted, grub showed a black screen and said




Error: no such partition

grub rescue >_




I booted into my live CD again, Ubuntu was still installed and all my data was still there. I still cannot boot into Ubuntu. What should I do?


More From » boot

 Answers
1

It looks like Kubuntu was still in control of GRUB. When you removed it, you also removed the files grub needed to boot. Fortunately this should be an easy fix.



Since you're already on a live CD, I think the easiest route is to chroot to your installation and run the grub installation scripts. Start by opening your Ubuntu installation (your root partition, which contains folders such as "etc", "usr", and "home") in a file browser in order to mount it.



Now open a terminal.



Find the Mount Pount



In the terminal, type mount This will print out several lines. Look for one that mentions your ubuntu installation in /media. It will look something like:



/dev/sda1 on /media/disk type ext4 (rw,relatime)


In the example above, the device is /dev/sda1 and the mount point is /media/disk. Make a note of this, because we will use this information later.



Set up the Chroot



We need to setup the chroot. This means we will link some system folders from the LiveCD to your installed system. To do this, paste the following text into the terminal, but replace /media/disk with the mount point you found earlier:



for i in sys dev proc; do sudo mount --bind /$i /media/disk/$i; done


The above command runs the following three commands:



sudo mount --bind /dev /media/disk/dev
sudo mount --bind /sys /media/disk/sys
sudo mount --bind /proc /media/disk/proc


This binds /sys, /dev/ and /proc to the same folders on /media/disk. This means that /media/disk/dev/ is actually /dev/



Now we are ready to chroot. In the terminal type chroot /media/disk, where /media/disk is your mount point.



You should now see a root shell (the prompt should end in #). Any command executed here is restricted to your installed partition, and will (for the most part) operate as if you were on your installed system.



Fix the Bootloader



Now all we need to do install the bootloader. In the terminal, paste the following two lines:



grub-install /dev/sda
update-grub


Note: This assumes that you only have one drive in your computer. If you have two, or if you are running from a LiveUSB drive, make sure you replace /dev/sda in the above command with the device from the "Find the Mount Point" section above. Do not include the number at the end of the device. For example, if the device for your partition is /dev/sdb2, then you should use grub-install /dev/sdb.



And that's it! If those commands complete without error, then reboot your computer.


[#36691] Wednesday, March 30, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brailloni

Total Points: 122
Total Questions: 108
Total Answers: 108

Location: North Korea
Member since Tue, Apr 4, 2023
1 Year ago
brailloni questions
Tue, Jun 21, 22, 21:51, 2 Years ago
Thu, Jul 29, 21, 05:25, 3 Years ago
Sat, Apr 2, 22, 17:32, 2 Years ago
Mon, Oct 31, 22, 21:39, 2 Years ago
;