postelbe快递单号查询:重装windows后怎么再进linux??

来源:百度文库 编辑:高考问答 时间:2024/04/29 17:32:20
我的机子装了windows和linux,重装的一次windows之后找不到进linux的界面了。还请各位高人指点!!小弟不胜感激~~~

下载grub_for_dos,解压以后把grldr这个文件拷到c盘盘根下面,打开boot.ini,在最后加一行:c:\grldr="grub"保存,重启,会出现选择菜单,选grub,它会自动寻找menu.lst,一般这样就可以进入grub菜单,启动 linux。如果不能找到会进入命令行,输入:root (hd0,*)(你的 linux所在的区),回车,输入:configfile /boot/grub/grub.conf,如果你的/boot是单独分区的,输入:configflie /grub/grub.conf,回车即可进入grub启动选择菜单。
进入linux后,运行grub,输入root (hd0,*)(你的linux的区),回车,输入setup (hd,0)这样可以把grub安装到mbr,开机直接进入grub的系统选择菜单。如果你的grub菜单里没有windows,可以编辑 /boot/grub/grub.conf,在里面加上这样几句:
title windows
rootnoverify (hd0,0)
chainloader +1
这样就可以用grub引导双系统了。

只要想办法把grub装上了就可以了
下面内容摘自ubuntu wiki,基本上什么情况就提到了。
适用于各种linux版本

RecoveringUbuntuAfterInstallingWindows

Contents

1. Using the Ubuntu Install CD
2. Using the Ubuntu Live CD
1. Using the LiveCD while preserving Windows Bootloader
2. Using the LiveCD and Overwriting the Windows bootloader
3. Note using the Ubuntu Live CD
3. Using the Unofficial "Super Grub Disk"
4. Troubleshooting
1. Preparing Your Working Environment
1. Recovering GRUB Automatically
2. Recovering GRUB Manually
3. Configuring the GRUB Menu
5. GRUB Resources

Using the Ubuntu Install CD

This section explains how to rescue GRUB (the GRand Unified Boot loader), using the Ubuntu install CD ROM.

*

Enter your computers BIOS to check computer can boot from CD ROM. If you can boot from CD, insert CD ROM into drive. Exit the BIOS (if needed save your settings to make sure the computer boots from the CD ROM).
*

When the Ubuntu splash screen comes up with the boot: prompt, type in rescue and press enter.
*

Choose your language, location (country) and then keyboard layout as if you were doing a fresh install.
*

Enter a host name, or leave it with the default (Ubuntu).
*

At this stage you are presented with a screen where you can select which partition is your root partition (there is a list of the partitions on your hard drive, so you are required to know which partition number Ubuntu is on). This will be dev/discs/disc0/partX, where the X is a partition number.
*

you are then presented with a command prompt (a hash).
*

type $ grub-install /dev/hdaX where X is your Ubuntu root install.

Using the Ubuntu Live CD

Please choose one of the following options:
Using the LiveCD while preserving Windows Bootloader

Don't forget that this method, as described, puts GRUB back on the MBR (master boot record) of the hard drive instead of in the root parititon. This is fine for most people, but not if you already have an alternative boot manager.

In other words, if you use something like Boot Magic or System Commander, the commands you've just read will overwrite what you've got.

If you've installed GRUB into the Root Partition instead of the MBR, the commands are a little different. Here's are the instructions that I have for my system:

How to Restore the Grub Menu after a Re-Ghosting:

1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.

2. Open a Terminal. Go SuperUser (that is, type "su" in a non-Ubuntu distro, or "sudo -i" in Ubuntu). Enter root passwords as necessary.

3. Type "grub" which makes a GRUB prompt appear.

4. Type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,3)". Use whatever your computer spits out for the following lines.

5. Type "root (hd0,3)".

6. Type "setup (hd0,3)". This is key. Other instructions say to use "(hd0)", and that's fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as "(hd0,3)".

7. Type "quit".

8. Restart the system. Remove the bootable CD.

From: [WWW] http://ubuntuforums.org/showpost.php?p=121355&postcount=5
Using the LiveCD and Overwriting the Windows bootloader

1. Pop in the Live CD, boot from it until you reach the desktop.

2. Open a terminal window or switch to a tty (Ctrl + Alt + F1).

3. Type "grub"

4. Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).

5. Type "setup (hd0)", ot whatever your harddisk nr is.

6. Quit grub by typing "quit".

7. Reboot.

From: [WWW] http://ubuntuforums.org/showpost.php?p=117829&postcount=2
Note using the Ubuntu Live CD

You could have to run "grub" not from the Ubuntu Live CD, but from your disk installation to make it work. To do this mount your root partition (following examples assume a root partition on hda1):

sudo mkdir /mnt/linux
sudo mount /dev/hda1 /mnt/linux

then change directory to your installation sbin and run grub from there

sudo cd /mnt/linux/sbin
sudo ./grub

Using the Unofficial "Super Grub Disk"

Note: This method works very well with system with only one Linux... (most probably) if you have more than one Linux Super Grub Disk will restore the first Grub that it will find on your partitions.

*

Download [WWW] Super Grub Disk
*

Burn into a cdrom (better) or a floppy
*

Boot from it
*

Select: your language
*

Select: Restore Grub on MBR
*

Select: Auto
*

You see the message: SGD has done it!
*

Reboot
*

You're done.

Troubleshooting

This section applies to...

*

Dual-boot setups in which Windows was installed after Ubuntu
*

Conditions where Windows failure forced a re-installation
*

Windows recovery techniques involving the "restoration" of the MBR
*

Cases where GRUB failed to install

Prerequisites:

*

Your Ubuntu partitions are all still intact
*

You have a LiveCD, such as the Ubuntu LiveCD, or anything you're comfortable with
*

You're familiar enough with your LiveCD to gain access to a console
*

You remember how you set up your partitions (having a printout of /etc/fstab is ideal, though you can make do with the output of fdisk -l /dev/hda)
*

Knowledge of how your kernel works (specifically with regards to initrd), if you're using a non-Ubuntu kernel or built your own
*

Your kernel's version; this howto assumes 2.6.10-5-386

Preparing Your Working Environment

To begin the restoration procedure, insert your LiveCD and reboot your computer. Proceed with your LiveCD's bootup proceedure until you are presented with an interface. If your LiveCD does not immediately present you with a console, also called a terminal, open one -- to do this with the Ubuntu LiveCD, click Applications -> System Tools -> Terminal.

Note: Since this is a LiveCD environment, any changes to user accounts or filesystem layouts at this level will not be permanent. This means you can set a temporary root password and create directories without affecting your actual installation.

Now, you need to gain root access. Under Ubuntu, this can be done with the following commands:

sudo -i

Under Knoppix, the following command will suffice, and you will not be prompted for a password.

su -

Now that you have root access, you need to mount the partition(s) containing your bootloader files.

You will need access to both your /sbin/ and /boot/ directories. If you have a /boot/ listing in your fstab, you are among those who will need to mount two partitions.

Begin by creating a mount point for your working environment -- you'll notice this is the same as creating a directory.

mkdir /mnt/work

If you need to mount /boot/, too, run the following command.

mkdir /mnt/work/boot

Now it's time to actually load your filesystem data. Review your fstab and identify the location(s) of / and /boot/; these will likely look something like /dev/hda3 and /dev/hda4, though the letter 'a' and the numbers 3 and 4 may differ.

Note: For the remainder of this howto, /dev/hda3 and /dev/hda4 will be assumed, so alter them as needed when typing them in yourself.

Enter the following commands to load your filesystem and some information GRUB may need.

mount /dev/hda4 /mnt/work
mount -o bind /dev /mnt/work/dev
mount -o bind /proc /mnt/work/proc
cp /proc/mounts /mnt/work/etc/mtab

Now, you have to enter your working environment. The following command will take care of that.

chroot /mnt/work/ /bin/bash

Warning: From this point on, any files you modify will affect your Ubuntu system. You have left the safety of the LiveCD. Excercise caution.
Recovering GRUB Automatically

If you have a separate /boot/ partition, type the following line.

mount /dev/hda3 /boot/

Reinstalling GRUB from this point is easy. Just enter the following command.

/sbin/grub-install /dev/hda

If the command you used above failed, which is unlikely, you will need to configure GRUB manually (it isn't too hard); if it succeeded, you should read the note at the start of the final section: "Configuring the GRUB Menu".
Recovering GRUB Manually

Before you can undertake the next step, it's important that you understand how GRUB identifies partitions.

To GRUB, numbers begin with 0, and letters are expressed numerically, also beginning with 0.

For example, /dev/hda1 is "hd0,0" to GRUB. Similarly, /dev/hdb3 is "hd1,2".

Note: The "root" line must point to the location of your /boot/ partition if you have one. If you do not have one, point it at your / partition.

/sbin/grub
grub> root (hd0,2)
grub> setup (hd0)
grub> quit

Configuring the GRUB Menu

Note: This step does not need to be done if you're just trying to recover your MBR. Installing Windows will not alter the contents of your existing menu.lst, so if everything was working right before, everything will continue to work right now, and you can restart your computer.

Open the GRUB menu file, /boot/grub/menu.lst, with your favourite text editor. An example follows.

nano /boot/grub/menu.lst

Note: Your menu.lst file is used to control the operating systems GRUB displays on startup, as well as its visual appearance. This howto will only explain how to get your operating systems to boot; it will not tell you how to make your bootloader pretty.

A sample menu.lst, stripped of unnecessary comments, appears below. It is based on the /dev/hda3 and /dev/hda4 example above, and assumes Windows resides at /dev/hda1.

timeout 5 #The number of seconds GRUB should wait before booting an OS
default 0 #The entry which should be booted by default
fallback 1 #The entry which should be booted in the event of the first one failing

title Ubuntu, 2.6.10 #A 32-bit Ubuntu entry
#This (or something like it) should be in your configuration
root (hd0,2)
initrd /initrd.img-2.6.10-5-386
kernel /vmlinuz-2.6.10-5-386 root=/dev/hda4

title Ubuntu, 2.6.10 #Another 32-bit Ubuntu entry
#This is an example of an Ubuntu entry which does not have a separate /boot/ partition
#(it is provided only as an alternate to the example above -- do not use them together)
root (hd0,2)
initrd /boot/initrd.img-2.6.10-5-386
kernel /boot/vmlinuz-2.6.10-5-386

title Microsoft Windows XP Home #An entry for a Windows installation
#If you're reading this guide, you probably want this
root (hd0,0)
makeactive
chainloader +1

And that's it. Save and close the file, then reboot and try out the entries.

这样的问题我也没见过啊,不过我装的也是双系统,WINDOWS和LINUX我前两把WINDOWS格式化了重装了依次.现在一样可以进LINUX的啊,你的LINUX装在什么盘符下了啊,我的C盘是WINDOWS的系统,F盘是LINUX的系统,我现在只要开机就会出现选项问进如那个系统的