Recovering grub after Windows frehs install

Hello everyone.

I was doing some tests to see which Linux version suits me the best, and turns out it`s openSUSE. Problem is, after a Windows install, I dont have a grub menu anymore, I tried the bellow and didnt work.

https://en.opensuse.org/SDB:Repair_MBR_after_Windows_install

My install setup is this:

  • Install Windows 7 first (explanation later)
  • Install openSUSE 12.2 64bit XFCE

Thing is, my Windows 7 is Enterprise, which means I have 3 months to evaluate it. It’s original and downloaded from microsoft, but every 3 months I have to re-install it. And that`s where the trouble is, after installing Windows I can’t recover the grub menu.

Any help? =)

Use this article https://forums.opensuse.org/content/146-using-livecd-take-over-repair-installed-system.html to start with. If it’s a one disk machine the command to restore grub2 is

grub2-install /dev/sda

Thank you for your quick response. I’ll give it a try and post the results here.

Just one thing, it doesnt matter if I already tried the method I tried, right?

No, that doesn’t matter.

BTW can I do this with the normal DVD or I have to download a Live CD?

There’s a link in the article to a similar article which uses the DVD

On 2013-01-19 22:26, amarildojr wrote:
>
> BTW can I do this with the normal DVD or I have to download a Live CD?

Yes, but you do not get a nice graphical environment. You boot the
rescue option of the dvd, and log in as root (there is no user there).


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

I can’t give the command “mount – bind /dev /mnt/dev” it says file or directory does not exist. I’m stuck with that

I couldn’t edit my last post so: when I try to give “grub2-install /dev/sda” it says the file is read-only

On 2013-01-20 03:16, amarildojr wrote:
>
> I can’t give the command “mount – bind /dev /mnt/dev” it says file or
> directory does not exist. I’m stuck with that

Is the target root system mounted on /mnt?


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

How could I know? :open_mouth:

Come on, people. I really need to use SUSE! Someone help!

I see you posted in my rescue article and I replied there with a correction to the code you were using which had a typo in it

You need

mount --bind /dev /mnt/dev

Your example had a space added after –

type mount for a list of mounted file systems

a file system can only be mounted once r/w so if it is mounted you need to umount it (note that is umount not unmount) to allow the mount location you need for the operation

Did it? because I don’t put a space there. Must have gotten out on the hurry I was

OK I need to mount or umount in order to that directory to exist?

no

mount with out anything else just shows list of mounted file systems

if the files system us already mounted the you can use umount to unmount it

may or may not be needed …depends on what you see in mount table

Just follow the guide step by step
And it will work. The key is making sure you correctly identify the openSUSE / (root) partition from your fdisk output. This is the first thing you mount.

OK I got it working, openSUSE shows on the boot menu but Windows is gone now. I noticed my keyboard setup is different on the recover setup, so I corrected a letter and all worked. Here’s what I did:

fdisk -l (the linux root was on sda1)
mount --bind /dev /mnt/dev
chroot /mnt
grub2-install /dev/sda
exit
reboot

Now openSUSE is displayed on the boot menu, but Windows is gone.

Come on, just one more step for me to use openSUSE :smiley:

Open a terminal and do

su -
grub2-mkconfig -o /boot/grub2/grub.cfg

wait for it.
Then reboot and check