How to Recover MINT 13 Grub

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

How to Recover MINT 13 Grub

Postby pgmer6809 on Tue Nov 13, 2012 4:08 am

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
pgmer6809
Level 2
Level 2
 
Posts: 84
Joined: Sun Mar 04, 2012 9:06 pm

Linux Mint is funded by ads and donations.
 

Re: How to Recover MINT 13 Grub

Postby caf4926 on Tue Nov 13, 2012 4:39 am

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

Image
Mint 16 Cinnamon_64
User avatar
caf4926
Level 7
Level 7
 
Posts: 1746
Joined: Mon Mar 22, 2010 3:21 pm
Location: UK Lake District

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

Postby pgmer6809 on Thu Nov 15, 2012 3:46 pm

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 2
Level 2
 
Posts: 84
Joined: Sun Mar 04, 2012 9:06 pm

Re: How to Recover MINT 13 Grub -- SOLVED

Postby pgmer6809 on Thu Nov 15, 2012 6:46 pm

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
pgmer6809
Level 2
Level 2
 
Posts: 84
Joined: Sun Mar 04, 2012 9:06 pm

Re: How to Recover MINT 13 Grub

Postby caf4926 on Fri Nov 16, 2012 12:48 am

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...
Image
Mint 16 Cinnamon_64
User avatar
caf4926
Level 7
Level 7
 
Posts: 1746
Joined: Mon Mar 22, 2010 3:21 pm
Location: UK Lake District


Return to Installation & Boot

Who is online

Users browsing this forum: medwatt, Painter and 22 guests