个人工具

“UbuntuHelp:How to dual-boot Ubuntu and XP after installing them separately on two HDs”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/How_to_dual-boot_Ubuntu_and_XP_after_installing_them_separately_on_two_HDs}} {{Languages|UbuntuHelp:How_to_dual-boot_Ubuntu_and_XP_after_installin...)
 
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/How_to_dual-boot_Ubuntu_and_XP_after_installing_them_separately_on_two_HDs}}
 
{{From|https://help.ubuntu.com/community/How_to_dual-boot_Ubuntu_and_XP_after_installing_them_separately_on_two_HDs}}
 
{{Languages|UbuntuHelp:How_to_dual-boot_Ubuntu_and_XP_after_installing_them_separately_on_two_HDs}}
 
{{Languages|UbuntuHelp:How_to_dual-boot_Ubuntu_and_XP_after_installing_them_separately_on_two_HDs}}
 
 
 
== Introduction ==
 
== Introduction ==
 
 
You have installed Ubuntu on a separate HD because you were afraid to loose things on your Windows disk?
 
You have installed Ubuntu on a separate HD because you were afraid to loose things on your Windows disk?
 
You absolutely want to keep XP and Ubuntu separate?
 
You absolutely want to keep XP and Ubuntu separate?
 
Then this might help you. :)
 
Then this might help you. :)
 
 
== Case 1: You haven't installed Ubuntu yet  ==
 
== Case 1: You haven't installed Ubuntu yet  ==
 
 
Do a fresh install of Ubuntu with the windows hard drive still plugged in. Ubuntu will automatically detect the other hard drive, and Grub will automatically list it as a choice at startup.
 
Do a fresh install of Ubuntu with the windows hard drive still plugged in. Ubuntu will automatically detect the other hard drive, and Grub will automatically list it as a choice at startup.
 
You can then also see the other hard drive and access it while in Ubuntu by mounting it.
 
You can then also see the other hard drive and access it while in Ubuntu by mounting it.
 
 
== Case 2: You already installed Ubuntu on an HD ==
 
== Case 2: You already installed Ubuntu on an HD ==
 
 
=== Short tutorial ===
 
=== Short tutorial ===
 
 
If you were afraid to partition and format another hard drive just for Ubuntu and disconnected the previous one with Windows during the installation, you will run into this problem to have to add Windows boot manually.
 
If you were afraid to partition and format another hard drive just for Ubuntu and disconnected the previous one with Windows during the installation, you will run into this problem to have to add Windows boot manually.
 
The solution is simply adding this to /boot/grub/menu.lst:
 
The solution is simply adding this to /boot/grub/menu.lst:
第29行: 第21行:
 
map (hd1) (hd0)
 
map (hd1) (hd0)
 
</nowiki></pre>
 
</nowiki></pre>
 
 
The parts with '''(hd1,0)''','''(hd0) (hd1)''' and '''(hd1) (hd0)''' depend on where your Windows partition is, which you can find out by typing:
 
The parts with '''(hd1,0)''','''(hd0) (hd1)''' and '''(hd1) (hd0)''' depend on where your Windows partition is, which you can find out by typing:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo fdisk -l
 
sudo fdisk -l
 
</nowiki></pre>
 
</nowiki></pre>
 
 
In this example, Windows is assumed to be on ''hd1'' and Ubuntu on ''hd0''.
 
In this example, Windows is assumed to be on ''hd1'' and Ubuntu on ''hd0''.
 
 
The problem is that [http://www.gnu.org/software/grub/manual/html_node/DOS_002fWindows.html#DOS_002fWindows Windows boot must be on the first hard disk/partition in order to boot]. You trick it into thinking that by adding those last two lines with the ''map'' command in the Grub menu entry.
 
The problem is that [http://www.gnu.org/software/grub/manual/html_node/DOS_002fWindows.html#DOS_002fWindows Windows boot must be on the first hard disk/partition in order to boot]. You trick it into thinking that by adding those last two lines with the ''map'' command in the Grub menu entry.
 
 
=== Complete tutorial ===
 
=== Complete tutorial ===
 
 
Backup your menu.lst first:
 
Backup your menu.lst first:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bkp
 
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bkp
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Find out where your Windows hard disk is with (if you are confused here just post the result here and someone might help)
 
Find out where your Windows hard disk is with (if you are confused here just post the result here and someone might help)
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo fdisk -l
 
sudo fdisk -l
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Then you need to add the new entry to grub with
 
Then you need to add the new entry to grub with
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo gedit /boot/grub/menu.lst
 
sudo gedit /boot/grub/menu.lst
 
</nowiki></pre>
 
</nowiki></pre>
 
 
And then add the entry:
 
And then add the entry:
 
<pre><nowiki>
 
<pre><nowiki>
第66行: 第50行:
 
map (hd1) (hd0)
 
map (hd1) (hd0)
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If your Windows is on a second SATA you have to use sd1 instead of hd1, I think. The second line of the map command is just so your Ubuntu hard drive will be recognizeable on Windows. If you need to read/write on Ubuntu partitions from Windows or vice-versa, you need to search for other tools (ntfs-3g and ntfs-config for Ubuntu and ext3 for Windows), but that's outside the scope of this thread.
 
If your Windows is on a second SATA you have to use sd1 instead of hd1, I think. The second line of the map command is just so your Ubuntu hard drive will be recognizeable on Windows. If you need to read/write on Ubuntu partitions from Windows or vice-versa, you need to search for other tools (ntfs-3g and ntfs-config for Ubuntu and ext3 for Windows), but that's outside the scope of this thread.
 
 
If you need more information on Grub's map command you can find it '''[http://www.gnu.org/software/grub/manual/html_node/map.html#map here]'''.
 
If you need more information on Grub's map command you can find it '''[http://www.gnu.org/software/grub/manual/html_node/map.html#map here]'''.
 
 
== References ==
 
== References ==
 
 
* [http://ubuntuforums.org/showthread.php?p=2702832#post2702832 Tutorial by eks on the Ubuntu forums]
 
* [http://ubuntuforums.org/showthread.php?p=2702832#post2702832 Tutorial by eks on the Ubuntu forums]
 
* See also [http://ubuntuforums.org/showthread.php?t=179902 Dualboot two hard drives]
 
* See also [http://ubuntuforums.org/showthread.php?t=179902 Dualboot two hard drives]
 
== Go back ==
 
== Go back ==
 
* [https://help.ubuntu.com/community/Installation Go back to Installation]
 
* [https://help.ubuntu.com/community/Installation Go back to Installation]
 
 
----
 
----
 
[[category:CategoryDocumentation]]
 
[[category:CategoryDocumentation]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 17:39的版本

Introduction

You have installed Ubuntu on a separate HD because you were afraid to loose things on your Windows disk? You absolutely want to keep XP and Ubuntu separate? Then this might help you. :)

Case 1: You haven't installed Ubuntu yet

Do a fresh install of Ubuntu with the windows hard drive still plugged in. Ubuntu will automatically detect the other hard drive, and Grub will automatically list it as a choice at startup. You can then also see the other hard drive and access it while in Ubuntu by mounting it.

Case 2: You already installed Ubuntu on an HD

Short tutorial

If you were afraid to partition and format another hard drive just for Ubuntu and disconnected the previous one with Windows during the installation, you will run into this problem to have to add Windows boot manually. The solution is simply adding this to /boot/grub/menu.lst:

title		Windows XP Professional
root		(hd1,0)
savedefault
makeactive
chainloader	+1
map (hd0) (hd1)
map (hd1) (hd0)

The parts with (hd1,0),(hd0) (hd1) and (hd1) (hd0) depend on where your Windows partition is, which you can find out by typing:

sudo fdisk -l

In this example, Windows is assumed to be on hd1 and Ubuntu on hd0. The problem is that Windows boot must be on the first hard disk/partition in order to boot. You trick it into thinking that by adding those last two lines with the map command in the Grub menu entry.

Complete tutorial

Backup your menu.lst first:

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bkp

Find out where your Windows hard disk is with (if you are confused here just post the result here and someone might help)

sudo fdisk -l

Then you need to add the new entry to grub with

sudo gedit /boot/grub/menu.lst

And then add the entry:

title		Windows XP Professional
root		(hd1,0)
savedefault
makeactive
chainloader	+1
map (hd0) (hd1)
map (hd1) (hd0)

If your Windows is on a second SATA you have to use sd1 instead of hd1, I think. The second line of the map command is just so your Ubuntu hard drive will be recognizeable on Windows. If you need to read/write on Ubuntu partitions from Windows or vice-versa, you need to search for other tools (ntfs-3g and ntfs-config for Ubuntu and ext3 for Windows), but that's outside the scope of this thread. If you need more information on Grub's map command you can find it here.

References

Go back