[SOLVED] How to repair grub2 in MBR? win7/10.10 dual boot.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone, I apologize for re-posting what seems to be a common problem. I have a win7/10.10 dual-boot set up, more or less following the lifehacker.com tutorial (I know, I know). I had to reinstall windows, and its taken over the MBR so that only win7 boots now. My shared drive and the ubuntu filesystem are still there, I just can't get to them without a boot cd. So, I tried to follow the tutorials, which all basically say to reinstall grub or grub2. I tried one method, but ubuntu told me that installing grub2 anywhere but the MBR was a bad idea. Ok...so how do I do this so that ubuntu and win7 stay happy, but I get my grub menu back? Thanks in advance.
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369
Rep:
You have reinstalled Win 7 , so Grub is gone I assume .
So you do not have a other option than reinstalling GRUB .
After that if windows does not appear run the command susdo update-grub
If windows 7 is capable of booting UBUNTU than you can install GRUB on the root partition UBUNTU and let WIndows do the booting .
But do not ask me how , I do not use windows,.
I tried one method, but ubuntu told me that installing grub2 anywhere but the MBR was a bad idea. Ok...so how do I do this so that ubuntu and win7 stay happy, but I get my grub menu back? Thanks in advance.
You probably tried
Code:
grub-install /dev/sda3
rather than
Code:
grub-install /dev/sda
Obviously, I've missed out the rest of the commands and the partition may be wrong, but basically you want to be installing onto the drive, "/dev/sda" not a partition, "/dev/sdaX"
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d7d9e
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 4279 34267136 7 HPFS/NTFS
/dev/sda3 4280 7834 28555537+ 83 Linux
/dev/sda4 7836 19457 93353715 7 HPFS/NTFS
So, I thought it was because I hadn't mounted the drive, but even after having mounted the drive, it still doesn't work
Code:
sudo mount /dev/sda
mount: can't find /dev/sda in /etc/fstab or /etc/mtab
ubuntu@ubuntu:~$ sudo mount /dev/sda /mnt
mount: /dev/sda already mounted or /mnt busy
ubuntu@ubuntu:~$ sudo grub-install /dev/sda
/usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).
No path or device is specified.
Try `/usr/sbin/grub-probe --help' for more information.
Auto-detection of a filesystem module failed.
Please specify the module with the option `--modules' explicitly.
Anyway, I'm not sure what to try to do next. Most of the tutorials on line don't apply to this system, or repeat some of the steps suggested above.
thanks again from the n00b
PS...only win7 loads...
Last edited by Nizzok; 12-25-2010 at 05:18 PM.
Reason: adding stuff
Have a read of this.
For future reference take particular note of section 12 - of the options presented, I prefer method 3, the chroot. Note that you mount partitions (or directories), not device(s).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.