|||
转自:http://opensuse.swerdna.org/suseboot.html
----------
HowTo Boot / Multiboot openSUSE and Windows (2000, XP, Vista - any mix) using the GRUB bootloader
Versions: Suse/openSUSE 10.x, 11.x
Scenario: You have openSUSE and one or more Windows installations on your drives and multibooting using GRUB isn't working. This tutorial leads you through reinstalling the Grub multiboot.
You might be interested in a companion tutorial about using the Windows bootloader for multibooting openSUSE and Windows:
HowTo Boot Multiboot openSUSE and Windows (2000, XP, Vista - any mix) using the Windows bootloader.
If you have no Windows installations, only Linux, you might want to read a companion tutorial for repairing a bootloader with focus on openSUSE, leaving out Windows: HowTo Boot into openSUSE when it won't Boot from the Grub Code on the Hard Drive.
If you just want to get the repair done without any introductory palaver, skip to the section "HowTo Repair your Grub Multiboot".
About Booting
Booting Windows with Microsoft Code: Windows 2000 and XP require you to have a primary partition on the first drive for the Microsoft bootloader codes; Microsoft call this the system partition. That's an inappropriate name so I'll call it by the correct name here: the bootloader partition. Windows will only boot from a bootloader partition that is a primary partition on the first drive. You can in fact cause a different drive to appear to Windows XP/2000 as the first drive by using the Grub "map" function, but your bootloader partition must still be a primary partition.
Once the requirement for a bootloader partition (as a primary partition) is met, you may install Windows to higher order partitions, either primary or logical.
For 2000, XP and Vista the bootloader partition must be made active or else booting from Microsoft code in the Master Boot Record (MBR) will fail. When you install Vista, it will seek out any existing active partition and make that Vista's bootloader partition. If an active partition does exist and it is a Linux partition, the Vista install will fail. If an active partition doesn't exist, Vista will make it's root partition the bootloader partition and make that partition active. Spare me!
Booting openSUSE with Grub Code: Grub can be configured to boot either from the Master Boot Record (MBR) or from a custom partition like /boot or /root. I demonstrate only the method of booting from the MBR in this tutorial. The second configuration is for advanced users because sometimes tweaking is required to get non-MBR booting to work OK after Yast is finished with it.
Booting Windows with Grub Code: This simply hands control over to the Microsoft bootloader in the bootloader partition. Curiously, in this instance it isn't necessary for the partition to be marked active. In fact, during installation of openSUSE the active partition is switched from the Windows bootloader partition to Suse's root partition. This is fine provided you switch it back if you want to revert to booting via Microsoft codes (e.g. if you uninstall Linux).
HowTo Repair Your Grub Multiboot: Two common problems can arise. The most disconcerting is when you cannot boot to anything. A lesser problem is that you can boot to Suse OK but not to Windows. There are a couple of methods for correcting these problems but I'll only cover one here that I think is good for new users. It's a three step process. First you get an assisted boot to the Suse installation. Then in step 2 you use Yast to completely recalculate and rewrite the Grub installation including rewriting the MBR. Finally, in step 3, you check and maybe alter Yast's new configuration for booting into Windows.
[Note: I show how to use the installation DVD to assist the boot to openSUSE. If you don't have one then there's a bunch of other ways in another tutorial on this site.]
Step 1 for Suse/openSUSE 10.x - Assisted Boot into openSUSE: Insert Suse's installation DVD and reboot the computer. Commence the installation process but only carry it forward a few steps. Click "Next" thought the Language screen. In the Media Check screen, do not click "Start Check" but simply click "Next" to skip to the the next screen. Agree to the Licence and "Next" to the Installation Mode screen. Here you select "Other Options". That will allow you to select to "Boot Installed System". Select that and click "next" to proceed. GoTo step 2
Step 1 for openSUSE 11.x - Assisted Boot into openSUSE: Insert Suse's installation DVD and reboot the computer. On the boot screen choose to "Repair Installed System". On the page titled "Repair Method", select "Expert Tools". Then click option "Install New Boot Loader". Select the partition where you installed Suse (if asked). You'll get the Grub GUI setup screen. Check under the Tab "Boot Loader Installation" that the checkmark is in "Boot from Master Boot Record" and remove any other checkmarks. Click "Finish". Wait for message "The boot loader was installed successfully". Click OK --> Next --> Finish. Ignore any error messages and reboot. That should install an elementary Grub and allow you to boot to openSUSE. So do that and it will take you to step 2
Step 2 - Reinitialise and Reinstall Grub: Once Suse has fully booted and settled down, go to Yast --> System --> Boot Loader. The Grub configuration screen comes up with the Tab "Section Management" activated. In the lower right is a drop-down selector labelled "Other". Select from "Other" the option "Propose New Configuration" and then wait for Grub to analyse your partitions and display a new configuration. This may take a while. Important: When that finishes, activate the tab labelled "Boot Loader Installation" and select to "Boot from the Master Boot Record". [Yast will often default to booting from the root or boot partition rather than from the MBR but that's for experts only -- always choose the MBR.] Then click Finish to save the changes and install the reconfigured Grub into the hard drive's MBR. If you get a message that "The bootloader boot sector will be written to a floppy disk ......... don't bother with the floppy -- just click OK to proceed and install to the MBR. Reboot and you should be able to boot to openSUSE using the Grub menu screen. Frequently you can also boot to Windows after completing Step 2, so try that too and maybe you won't need Step 3
Step 3 - Check/Repair Yast's Grub Configuration for Booting into Windows: The symptoms are that when you boot you can see Grub's menu and can select to boot to openSUSE successfully but if you select to boot to Windows, it fails. The solution is to boot into openSUSE and edit the Grub menu configuration file (menu.lst) located at /boot/grub/menu.lst. Menu.lst is a simple text file so you can use the following command in a console to open the file in a text editor with superuser permissions:
The line above is for Kwrite in KDE while the line below is for Gedit in Gnome.
Open menu.lst and locate the entry for Windows; there will generally be as many entries as there are VFAT and NTFS partitions on your drives. The trick is to identify the entry corresponding to the Windows Bootloader partition -- and then you can delete the spurious extra entries. I will show correct entries for some common cases to help you identify your situation and the correct entry for that situation:
Bootloader in partition 1 of drive 1: This is the most commonly occurring location. It matches most OEM desktops where 2000 and/or XP and/or Vista are installed in a straightforward fashion:
Bootloader in partition 2 of drive 1: Some laptops and some mass-produced name-brand desktops have a special Utility partition as the first partition of the first drive. It's hidden from Windows. Windows makes the second partition the bootloader partition:
A Windows 2000/XP Bootloader is in partition 1 of drive 2 because you swapped drives: If you install 2000 or XP on the primary drive and then swap drives; i.e. you swap a hard drive with 2000 and/or XP on it from the primary drive channel to the secondary drive channel -- you need to include the Grub "map" function to rectify the switch for the 2000/XP file "boot.ini":
A Vista Bootloader is in partition 1 of drive 2 because you swapped drives: If you install Vista alone on a primary drive and then swap drives OR if you first install 2000 or XP on the drive and then Vista and then swap drives; i.e. you swap a hard drive with Vista on it from the primary drive channel to the secondary drive channel -- NOTE that Vista completely ignores the "map" function that XP/2000 needed in the example above, so leave it out:
If you really want to verify which is the bootloader partition, then find the partition that contains the bootloader files: In Windows 2000/XP they are ntldr, ntdetect.com and boot.ini. Vista's visible bootloader files are bootmgr and the directory boot.
Well that should get you booting again. If you are still puzzled, browse on over to openSUSE Forums and recount your problem in the Install/Boot Forum.
APPENDIX: Some Common Error Messages: Here are some of the error messages you might see on your boot screen after a failed boot. You check and correct them in menu.lst at /boot/grub/menu.lst. My advice is first check the error out in menu.lst and see if it's real, second to reinstall Grub as per the section above regardless of what you found in menu.lst, third then see whether the flaw persists in the new menu.lst and correct it by editing if it does persist.
Error 13: Invalid or unsupported executable format: Is the entry pointing to a non-bootable partition (e.g. storage)?
Error 15: File not found: Is the entry designating the correct file (e.g. kernel entry)?
Error 22: No such Partition: Is the entry pointing to a real partition. This can happen after you alter your partitions.
No error number, just a message like this:
rootnoverify (hd0,1)
chainloader (hd0,1)+1
This is not a bootable disk ......
Is the entry pointing to a Windows system32 partition that is not a bootloader partition? Bootloader files must be on the first partition for Windows 2000/XP to boot.
No error number, just a message like this:
rootnoverify (hd1,0)
chainloader (hd1,0)+1
A disk read error occurred
Press Ctrl+Alt+Del to restart
Is the entry for a second or higher drive without the drive mapping function map (hd0) (hd1) etc?
Recommended reading: GRUB bootloader - Full tutorial and also Gnu Grub Manual.
Circa April 2006; last revised July 16 2009
---------------
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-1 14:42
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社