Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to restore my debian's grub after installing Windows 7

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
tomsawyer
Posts: 4
Joined: 2010-05-21 00:44

How to restore my debian's grub after installing Windows 7

#1 Post by tomsawyer »

Hi,
I have installed Windows 7 on my laptop . Now, it directly boot from Windows 7 . I think the MBR overwrote my grub . I have found two methods by google , but still does work .
1: boot from debian install CD, Alt +F2 switch to the console. "grub " "root (hd0,0)" "setup (hd0,0)".
2:boot from CD, mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt ; chroot /mnt ; grub-install /dev/sda.
I wonder if someone can help me , thanks very much.

User avatar
TobiSGD
Posts: 859
Joined: 2010-05-08 22:27
Location: Hannover, Germany

Re: How to restore my debian's grub after installing Windows 7

#2 Post by TobiSGD »

Boot from your installer disk, in the bootloader-menu choose Advanced and System Rescue, answer the questions and choose Repair bootloader, done.

smallchange
Posts: 1740
Joined: 2009-05-04 15:56
Been thanked: 1 time

Re: How to restore my debian's grub after installing Windows 7

#3 Post by smallchange »

I usually use SysrescueCD for this. It has an option that lets you boot right into your installation so you can fix it from within using

Code: Select all

grub-install /dev/sda
or

Code: Select all

aptitude reinstall grub
Just use the boot command "rescuecd root=/dev/sda1" or whatever your root is. It will even work with LVM Volumes, like "rescuecd root=/dev/mapper/my_root_volume".

User avatar
AMLJ
Posts: 973
Joined: 2009-03-18 07:40
Location: Mierlo, Netherlands
Contact:

Re: How to restore my debian's grub after installing Windows 7

#4 Post by AMLJ »

Download Super Grub Disk from here, burn it to a CD, and then boot from that. It will fix the problem.
AMLJ**0-1-47

tomsawyer
Posts: 4
Joined: 2010-05-21 00:44

Re: How to restore my debian's grub after installing Windows 7

#5 Post by tomsawyer »

smallchange wrote:I usually use SysrescueCD for this. It has an option that lets you boot right into your installation so you can fix it from within using

Code: Select all

grub-install /dev/sda
or

Code: Select all

aptitude reinstall grub
Just use the boot command "rescuecd root=/dev/sda1" or whatever your root is. It will even work with LVM Volumes, like "rescuecd root=/dev/mapper/my_root_volume".

thanks for your help . Its works.

However , there's still have one problem . that's is win7 keeps changing the boot flag! https://bbs.archlinux.org/viewtopic.php?id=88604

then , I reinstall my grub from my current /boot partition to MBR by doing as follows:
grub>root (hd0,0)
grub>setup (hd0)

when I reboot , I enter into grub bash line instead of boot menu.

I don't find menu.lst file in /boot/grub .

How could I fix it ?

by the way , I can only boot my system by inputing mass of command line such as kernel /vmlinuz-2.6......

User avatar
TobiSGD
Posts: 859
Joined: 2010-05-08 22:27
Location: Hannover, Germany

Re: How to restore my debian's grub after installing Windows 7

#6 Post by TobiSGD »

If you use squeeze or sid, you will not have a menu.lst, because you they use grub 2. In this case boot in your system and do, as root,

Code: Select all

update-grub
If you use lenny, just create a menu.lst.

tomsawyer
Posts: 4
Joined: 2010-05-21 00:44

Re: How to restore my debian's grub after installing Windows 7

#7 Post by tomsawyer »

TobiSGD wrote:If you use squeeze or sid, you will not have a menu.lst, because you they use grub 2. In this case boot in your system and do, as root,

Code: Select all

update-grub
If you use lenny, just create a menu.lst.
I do create a menu.lst in my /boot/grub

but after I installed it into MBR as follows:
grub>root (hd0,0)
grub>setup (hd0)

I reboot my laptop , it enter into grub bash console instead of grub menu .

I use find command to look for menu.lst
grub>find /boot/grub/menu.lst

there's no found file.

so , I don't know how to do with it . How to create menu.lst in grub.

User avatar
TobiSGD
Posts: 859
Joined: 2010-05-08 22:27
Location: Hannover, Germany

Re: How to restore my debian's grub after installing Windows 7

#8 Post by TobiSGD »

In this case I would try to reinstall grub. Boot into your system and try this,as root:

Code: Select all

apt-get --purge remove grub
apt-get install grub
This should generate a valid menu.lst in /boot/grub.

Post Reply