Reinstalling Grub2 using LiveCD

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
cra1g321

Reinstalling Grub2 using LiveCD

Post by cra1g321 »

These instructions are based on the instructions from the ubuntu help website - https://help.ubuntu.com/community/Grub2 ... m%20LiveCD
Il try and make them easier to understand as when i first saw them it looked a bit complicated. Please dont look at this post thinking its gonna take forever it wont. Just take your time and follow them correctly

1. Ok 1st thing you want to do is boot into your LiveCD of Mint. (best to use the same version as the one you are running on your computer)Once everything is loaded and your at the mint desktop. Open the Mint Menu and type "Gparted" into the filter text box.When it loads you should see all the partitons that are on the hard drive. Linux Mint partitions will probaly be EXT4 and the windows partitions will probaly be NTFS.

2. Look at the list of partitons and see what one is the Linux Mint partiton.You can tell this by looking at the Mount Points of the partitons. You should see one with a "/" under Mount Point and its File system will likely be EXT4. When you have located this partition look to the left and see what it is called. For example mine is called dev/sda6 (yours may be something different like dev/sda1 etc)Now that you know what partition is the Linux Mint partition, just leave gparted open so you can look back at it again incase you forget. Now open up a Terminal by clicking the Mint menu then clicking "Terminal" under System.
Now we need to mount the Linux Mint partition so that we are able to use it (access it) . To do this copy and paste this code into the terminal -

Code: Select all

sudo mount /dev/sdXY /mnt 
You will need to change the XY part of the code to match the name of your Linux Mint partition. For example my mint partition is dev/sda6 so i would change the code to - sudo mount /dev/sda6 /mnt

Now that you edited the line of code to match your mint partiton, go ahead and press Enter on your keyboard then type in your password if your asked for it then press Enter again.(When your entering in your password you will not see any characters, letters numbers etc). It may look as if nothing has happened, but your Linux Mint partition will now be mounted. The terminal will display nothing after the $ sign like it did when you 1st open it.

3. Now we need to tell the computer to reinstall grub2 to the Linux Mint partition we just mounted. To do this copy and paste this line of code into the terminal

Code: Select all

sudo grub-install --root-directory=/mnt/ /dev/sdX
Again you will need to change this line of code to match your Linux Mint partition. Change the "X" at the end to match your mint partiton. My partition is dev/sda6 so i will change the the line of code to - sudo grub-install --root-directory=/mnt/ /dev/sda
It is IMPORTANT that you do not enter any number just the letters of the partitions.
When you have edited the line of code press Enter on your keyboard. You should then see a message saying Grub installer finished or something like that. Now close the terminal and gparted and reboot your pc/laptop without the livecd in the disc drive. To restart click the mint menu then click "Quit" then "Reboot".
*Note after you reboot you should see the grub2 menu you had before you installed/repaired windows. You may need to refresh (update) this menu so that it detects the new windows partition.
This can easily be done by logging into your Linux Mint, opening a Terminal then copying and pasting

Code: Select all

sudo update-grub
then press Enter then enter your password then hit Enter again. You will then see it detecting all the bootable partitons on the Hard drive. When you it displays 'Done', reboot again and you should be able to boot into windows again.

I know this isn't the best tutorial for reinstalling grub but i hope it helps someone.
dawgdoc

Re: Reinstalling Grub2 using LiveCD

Post by dawgdoc »

Great job Craig.

Now we can point all the people who do not search the forums to here.
User avatar
tdockery97
Level 14
Level 14
Posts: 5058
Joined: Sun Jan 10, 2010 8:54 am
Location: Mt. Angel, Oregon

Re: Reinstalling Grub2 using LiveCD

Post by tdockery97 »

I think the post should be stickied!
Mint Cinnamon 20.1
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: Reinstalling Grub2 using LiveCD

Post by caf4926 »

Nice work
Anyone that's interested can also see this:
https://wiki.ubuntu.com/Grub2#Recover%2 ... a%20LiveCD
Linux Mint 21.1 Cinnamon
cra1g321

Re: Reinstalling Grub2 using LiveCD

Post by cra1g321 »

Thnx 4 the comments guys. Let me know of any improvements i could make to it.

Do you think i should post it on the community site ??
AirValor

Re: Reinstalling Grub2 using LiveCD

Post by AirValor »

cra1g321 wrote:Thnx 4 the comments guys. Let me know of any improvements i could make to it.

Do you think i should post it on the community site ??
Definitely do that!

However, I suggest for finding out what drives are you should run this in the terminal.

Code: Select all

sudo fdisk -l
Following with

Code: Select all

sudo mkdir /media/sda
*note put the correct number after sda of which sda has Linux as its system

Then you mount it with

Code: Select all

sudo mount /dev/sda /media/sda
*note put the correct number after sda of which sda has Linux as its system

After that you can reinstall grub to it.

Code: Select all

sudo grub-install --root-directory=/media/sda /dev/sda
*note put the correct number after sda of which sda has Linux as its system


This worked flawlessly for me, I will post screenies if I boot to Mint :)
Thinker

Re: Reinstalling Grub2 using LiveCD

Post by Thinker »

cra1g321 wrote:I know this isn't the best tutorial for reinstalling grub but i hope it helps someone.
This is the best tutorial for me atleast. Thanks a lot.
Post Reply

Return to “Tutorials”