reinstall/restore grub

Well,well,
Nice new day,nice new problems.
After resizing and moving partitions on my disk with gparted(live USB),i lost grub.
Finally i could boot using systemrescue my O.S.
But i couldn’t restore my grub,i tried with YaST (nothing=screen with nice pixels) and from the console with that probably i installed grub,because now i can boot without the stick by tipping where root,kernel and initrd are.
How can i reinstall my previous grub?
from what i saw old stage1 and 2 they don’t exist any more.
Thanks,Thanks

Grub or grub2??

EFI/GPT or old MBR format

grub2 i want the old menu back
EFI yes MBR no (in the past)

I tried the command grub-update(nothing) and the command grub-install says better try with yast

Now that i am thinking over,i don’t know where the grub(and which grub) is currently installed,because i re-installed it using command-line and booting from live-systemrescue with the option boot installed linux,since i couldn’t boot with out it.

I simply tipped 1.find /boot/grub/stage1
2.device (/dev/sda2) means the output of 1
3.setup (/dev/sda2)

Sorry not /dev/sda2 but (hd0,1)…

If it is installed in efi mode the old mbr ways no longer work. Do you have a efi/boot partition?

Probably the best approach is to chroot from a live DVD (note should be same version) then run grub2-install

Without more info about your partitioning it is hard to give exact instructions.

Thank you, I will try,
from my current O.S.(openSUSE13.1x64 ,installed from a live-KDE)i have the output

grub-install /dav/sda2
WARNING! You are trying to invoke the unsupported grub-install script
with a parameter. To really do this, call grub-install.unsupported.
You should rather call "yast2 bootloader" or create configuration files
appropriate for the intended target.

You need to chroot first.

something like this using the sdX# for your system


#mount /dev/sda6 /mnt
#mount --bind /dev /mnt/dev
#chroot /mnt
#grub2-install /dev/sda

Note you do the grub2-install to a drive NOT a partition

The following just might help (not sure, though).

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

Might or might not be needed but the OP must install to a drive not a partition

I did it yesterday without any results(in my case i had to bind mount /proc and /sys),
yast came on console,auto and without warnings,when finished on console i saw “no grub.conf” found on directory /etc.
I don’t understand why i have to use a chroot to do something like that and no my current SUSE13.1
I will try next what kerijan2003 wrote.

Thanks

**YES

**In chroot ,after mounting -B /dev,/proc and /sys,
i did grub2-mkconfig -o /boot/grub2/grub.cfg
and after grub2-install /dev/sda
yast2 didn’t came on

Everything is like before
Thanks to all of you

I think that’s the crucial point,/dev/sda and not /dev/sda2
And *grub2-install *and not grub-install.
I am not 100% sure either if i had to mount --bind /sys /mnt/sys,(but i am sure about mount --bind /proc /mnt/proc):
but anyway worked