Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
24
rated 0 times [  24] [ 0]  / answers: 1 / hits: 223585  / 3 Years ago, thu, may 6, 2021, 8:55:35

After an installation of Ubuntu 12.04, erasing an old partition with Ubuntu 10.10, I can't get grub to load. I can't access my Windows 7 partition either



I get the message:



> error: no such device: 58ABF29C...  
grub rescue>


I suppose my master boot record got erased/corrupted. How can I check and fix this?


More From » grub2

 Answers
6

Re-install your GRUB.




  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 or Linux for all of your linux partitions. The partition will most probably be something like /dev/sda5 or something. Remember this partition.


  3. 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`.


  4. 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


  5. 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.


  6. 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.


  7. You’re done. You may restart your system.



[#38033] Thursday, May 6, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
byishted

Total Points: 469
Total Questions: 113
Total Answers: 113

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
;