How to Recover MINT 13 Grub

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

How to Recover MINT 13 Grub

Post by pgmer6809 »

Hello,
I was running Mint 13 MAYA from partition /dev/sda2. This was dual booting with XP on /dev/sda1.
I installed AV linux from the live CD onto /dev/sda6. During the install I told it NOT to install GRUB in the MBR but it ignored me and did it anyway.
Now of course the grub on the MBR only points to the /boot/grub/grub.cfg on the /dev/sda6 partition and I have no menu entry for MINT.
AV linux does not have the redo-mbr command.

I would like to keep MINT as the main boot for the machine; I would like to insert the AV linux boot instructions back into the MINT (/dev/sda2) grub.cfg

a) How do I modify the MBR so that it points back to the /boot/grub.d on the /dev/sda2 partition?

b) is there a clean way to do this? (i.e. copy the /etc/grub.d/10_linux stuff from AV and put it into the /etc/grub.d/ on the MINT partition, then run update-grub?

Thanks for the help.
(I can boot from the MINT live CD if that helps, but I do not want to have to re-install MINT if I can avoid it.)
pgmer6809
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: How to Recover MINT 13 Grub

Post by caf4926 »

Boot the Mint cd and follow these steps
* Open a terminal and type

Code: Select all

sudo fdisk -l
* Now, you need to remember which device listed is your linux distribution, you said Mint was, /dev/sda2 . Now we need to mount the filesystem to /mnt

Code: Select all

sudo mount /dev/sda2 /mnt
* Now mount the rest of your devices

Code: Select all

sudo mount --bind /dev /mnt/dev
* Now chroot into your system

Code: Select all

sudo chroot /mnt
*

When that is done you need to run update-grub to create the configuration file.

Code: Select all

update-grub
*

To install GRUB 2 to the MBR, next you need to run grub-install /dev/sda

Code: Select all

grub-install /dev/sda
Linux Mint 21.1 Cinnamon
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

Re: How to Recover MINT 13 Grub --chroot fails

Post by pgmer6809 »

Thanks for the reply. I think I see what you are trying to do. But my 'chroot' command fails.
I mount the sda2 partition then issue the mount --bind cmd they work ok.

But the chroot cmd fails. It gives the message: "Cannot run command /bin/bash. Exec Format error'
It does this no matter what cmd I give it. E.g. chroot /mnt /bin/bash, or chroot /mnt /bin/sh or chroot /mnt /bin/echo

but if I just do a chroot / or chroot / /bin/bash etc. it works ok.
there is something else I need to do after I mount /dev/sda2 onto /mnt.
(I tried mounting my home partition on /mnt/home eg mount /dev/sda8 /mnt/home) but that has no effect.

Any other advice please?

pgmer6809
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

Re: How to Recover MINT 13 Grub -- SOLVED

Post by pgmer6809 »

Hi,
The orginal post describing how to use chroot to regenerate the grub files, works perfectly.
My problem came from booting from a 32bit install dvd but the os on the partitiion being chrooted to was 64 bit. This is what generated the Exec Format error.
(as it says in the ARCHlinux help wiki, this error usually indicates that the architectures to not match.)

when I booted with the correct DVD the procedure worked perfectly. :D

Thank you very much
pgmer6809
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: How to Recover MINT 13 Grub

Post by caf4926 »

when I booted with the correct DVD the procedure worked perfectly
Sorry I neglected to mention that. I kind of assumed you'd be using the same media as the install...
Linux Mint 21.1 Cinnamon
Locked

Return to “Installation & Boot”