个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
第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 ==
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
You have installed Ubuntu on a separate HD because you were afraid to loose things on your Windows disk?
+
<html>
You absolutely want to keep XP and Ubuntu separate?
+
<head>
Then this might help you. :)
+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
== Case 1: You haven't installed Ubuntu yet  ==
+
<meta name="robots" content="index,nofollow">
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.
+
<title>How - Community Ubuntu Documentation</title>
You can then also see the other hard drive and access it while in Ubuntu by mounting it.
+
<script type="text/javascript">
== Case 2: You already installed Ubuntu on an HD ==
+
<!--// common functions
=== Short tutorial ===
+
// We keep here the state of the search box
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.
+
searchIsDisabled = false;
The solution is simply adding this to /boot/grub/menu.lst:
+
function searchChange(e) {
<pre><nowiki>
+
// Update search buttons status according to search box content.
title Windows XP Professional
+
// Ignore empty or whitespace search term.
root (hd1,0)
+
var value = e.value.replace(/\s+/, '');
savedefault
+
if (value == '' || searchIsDisabled) {
makeactive
+
searchSetDisabled(true);
chainloader +1
+
} else {
map (hd0) (hd1)
+
searchSetDisabled(false);
map (hd1) (hd0)
+
}
</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:
+
function searchSetDisabled(flag) {
<pre><nowiki>
+
// Enable or disable search
sudo fdisk -l
+
document.getElementById('fullsearch').disabled = flag;
</nowiki></pre>
+
document.getElementById('titlesearch').disabled = flag;
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.
+
function searchFocus(e) {
=== Complete tutorial ===
+
// Update search input content on focus
Backup your menu.lst first:
+
if (e.value == 'Search') {
<pre><nowiki>
+
e.value = '';
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bkp
+
e.style.color = 'black';
</nowiki></pre>
+
searchIsDisabled = false;
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>
+
}
sudo fdisk -l
+
function searchBlur(e) {
</nowiki></pre>
+
// Update search input content on blur
Then you need to add the new entry to grub with
+
if (e.value == '') {
<pre><nowiki>
+
e.value = 'Search';
sudo gedit /boot/grub/menu.lst
+
e.style.color = 'gray';
</nowiki></pre>
+
searchIsDisabled = true;
And then add the entry:
+
}
<pre><nowiki>
+
}
title Windows XP Professional
+
function actionsMenuInit(title) {
root (hd1,0)
+
// Initiliaze action menu
savedefault
+
for (i = 0; i < document.forms.length; i++) {
makeactive
+
var form = document.forms[i];
chainloader +1
+
if (form.className == 'actionsmenu') {
map (hd0) (hd1)
+
// Check if this form needs update
map (hd1) (hd0)
+
var div = form.getElementsByTagName('div')[0];
</nowiki></pre>
+
var label = div.getElementsByTagName('label')[0];
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 (label) {
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]'''.
+
// This is the first time: remove label and do buton.
== References ==
+
div.removeChild(label);
* [http://ubuntuforums.org/showthread.php?p=2702832#post2702832 Tutorial by eks on the Ubuntu forums]
+
var dobutton = div.getElementsByTagName('input')[0];
* See also [http://ubuntuforums.org/showthread.php?t=179902 Dualboot two hard drives]
+
div.removeChild(dobutton);
== Go back ==
+
// and add menu title
* [https://help.ubuntu.com/community/Installation Go back to Installation]
+
var select = div.getElementsByTagName('select')[0];
----
+
var item = document.createElement('option');
[[category:CategoryDocumentation]]
+
item.appendChild(document.createTextNode(title));
 +
item.value = 'show';
 +
select.insertBefore(item, select.options[0]);
 +
select.selectedIndex = 0;
 +
}
 +
}
 +
}
 +
}
 +
//-->
 +
</script>
 +
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/htdocs/ubuntu/css/common.css">
 +
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" href="/htdocs/ubuntu/css/screen.css">
 +
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" href="/htdocs/ubuntu/css/print.css">
 +
<link rel="stylesheet" type="text/css" charset="utf-8" media="projection" href="/htdocs/ubuntu/css/projection.css">
 +
<link rel="Start" href="/community/UserDocumentation">
 +
<link rel="Alternate" title="Wiki Markup" href="/community/How?action=raw">
 +
<link rel="Alternate" media="print" title="Print View" href="/community/How?action=print">
 +
<link rel="Search" href="/community/FindPage">
 +
<link rel="Index" href="/community/TitleIndex">
 +
<link rel="Glossary" href="/community/WordIndex">
 +
<link rel="Help" href="/community/HelpOnFormatting">
 +
</head>
 +
<body  lang="en" dir="ltr">
 +
<script xmlns="" src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
 +
<script xmlns="" type="text/javascript"><![CDATA[
 +
_uacct = "UA-1018242-8";
 +
urchinTracker();
 +
]]></script>
 +
<div id="header">
 +
<div id="mastwrap"><div id="masthead">
 +
<div id="logo"><a href="/community/UserDocumentation">Community Ubuntu Documentation</a></div>
 +
<form id="searchform" method="get" action="">
 +
<div>
 +
<input type="hidden" name="action" value="fullsearch">
 +
<input type="hidden" name="context" value="180">
 +
<label for="searchinput">Search:</label>
 +
<input id="searchinput" type="text" name="value" value="" size="20"
 +
onfocus="searchFocus(this)" onblur="searchBlur(this)"
 +
onkeyup="searchChange(this)" onchange="searchChange(this)" alt="Search">
 +
<input id="titlesearch" name="titlesearch" type="submit"
 +
value="Titles" alt="Search Titles">
 +
<input id="fullsearch" name="fullsearch" type="submit"
 +
value="Text" alt="Search Full Text">
 +
</div>
 +
</form>
 +
<script type="text/javascript">
 +
<!--// Initialize search form
 +
var f = document.getElementById('searchform');
 +
f.getElementsByTagName('label')[0].style.display = 'none';
 +
var e = document.getElementById('searchinput');
 +
searchChange(e);
 +
searchBlur(e);
 +
//-->
 +
</script>
 +
<div id="sisternav">
 +
<ul>
 +
<li id="plain">
 +
<a href="https://help.ubuntu.com/6.06"
 +
accesskey="t">6.06 LTS</a>
 +
</li>
 +
<li id="plain">
 +
<a href="https://help.ubuntu.com/6.10"
 +
accesskey="t">6.10</a>
 +
</li>
 +
<li id="plain">
 +
<a href="https://help.ubuntu.com/7.04"
 +
accesskey="t">7.04</a>
 +
</li>
 +
<li id="plain">
 +
<a href="https://help.ubuntu.com/7.10"
 +
accesskey="t">7.10</a>
 +
</li>
 +
<li id="current">
 +
<a href="https://help.ubuntu.com/community"
 +
accesskey="t">Community Docs</a>
 +
</li>
 +
</ul>
 +
</div>
 +
</div></div>
 +
<ul class="extranav">
 +
<li><a href="/community/UserDocumentation">User Documentation</a></li>
 +
</ul>
 +
</div>
 +
<div id="page" lang="en" dir="ltr"><!-- start page -->
 +
<h1 id="title"><a title="Click to do a full-text search for this title" href="/community/How?action=fullsearch&amp;value=linkto%3A%22How%22&amp;context=180">How</a></h1>
 +
<div lang="en" id="content" dir="ltr">
 +
<a id="top"></a>
 +
<div lang="en" id="content" dir="ltr">
 +
<a id="top"></a>
 +
<p><strong>This page does not exist yet. You can create a new empty page, or use one of the page templates. Before creating the page, please check if a similar page already exists.</strong> </p>
 +
<a href="/community/How?action=edit">Create new empty page</a><p> </p>
 +
<div>
 +
<table>
 +
<tr>
 +
<td>
 +
<p> <strong>Page templates:</strong> </p>
 +
</td>
 +
<td>
 +
<p> <strong>Existing pages with similar names:</strong> </p>
 +
</td>
 +
</tr>
 +
<tr>
 +
<td style="vertical-align: top;">
 +
<p> <ul>
 +
<li><a href="/community/How?action=edit&amp;template=AideTemplate">AideTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=[[category:CategoryTemplate">CategoryTemplate</a></li>]]
 +
<li><a href="/community/How?action=edit&amp;template=DocumentationTemplate">DocumentationTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=HelpTemplate">HelpTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=HilfeTemplate">HilfeTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=HomepageTemplate">HomepageTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=PagePersonnelleTemplate">PagePersonnelleTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=Pr%c3%a9sentationTemplate">PrésentationTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=SlideShowHandOutTemplate">SlideShowHandOutTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=SlideShowTemplate">SlideShowTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=SlideTemplate">SlideTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=SupportPapierD'UnePr%c3%a9sentationTemplate">SupportPapierD'UnePrésentationTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=ThuisbladTemplate">ThuisbladTemplate</a></li>
 +
<li><a href="/community/How?action=edit&amp;template=TransparentTemplate">TransparentTemplate</a></li>
 +
</ul>
 +
</p>
 +
</td>
 +
<td style="vertical-align: top;">
 +
<p> <ul>
 +
<li><a href="/community/How_to_dual-boot_Ubuntu_and_XP_after_installing_them_separately_on_two_HDs">How to dual-boot Ubuntu and XP after installing them separately on two HDs</a></li>
 +
<li><a href="/community/HowTo">HowTo</a></li>
 +
<li><a href="/community/HowTo%3a_Theora_and_Vorbis_in_an_Ogg_wrapper">HowTo: Theora and Vorbis in an Ogg wrapper</a></li>
 +
<li><a href="/community/HowToAddaLauncher">HowToAddaLauncher</a></li>
 +
<li><a href="/community/HowToBuildToraWithOracle">HowToBuildToraWithOracle</a></li>
 +
<li><a href="/community/HowToCaptureDigitalVideo">HowToCaptureDigitalVideo</a></li>
 +
<li><a href="/community/HowToCompressedSoundFonts">HowToCompressedSoundFonts</a></li>
 +
<li><a href="/community/HowToConfigureSoundBlasterAudigySEinBreezy">HowToConfigureSoundBlasterAudigySEinBreezy</a></li>
 +
<li><a href="/community/HowToConfigureUbuntuForMicrosoftVirtualPC2004">HowToConfigureUbuntuForMicrosoftVirtualPC2004</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/AboutBook">HowToCookEdubuntu/Chapters/AboutBook</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/Administration">HowToCookEdubuntu/Chapters/Administration</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/Application">HowToCookEdubuntu/Chapters/Application</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/BehindEdubuntu">HowToCookEdubuntu/Chapters/BehindEdubuntu</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/ContributingToEdubuntu">HowToCookEdubuntu/Chapters/ContributingToEdubuntu</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/Difference">HowToCookEdubuntu/Chapters/Difference</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/Docs">HowToCookEdubuntu/Chapters/Docs</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/HardwareRequirements">HowToCookEdubuntu/Chapters/HardwareRequirements</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/Installation">HowToCookEdubuntu/Chapters/Installation</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/LTSPManagement">HowToCookEdubuntu/Chapters/LTSPManagement</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/Philosophy">HowToCookEdubuntu/Chapters/Philosophy</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/StandAloneHardware">HowToCookEdubuntu/Chapters/StandAloneHardware</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/StandAloneInstallation">HowToCookEdubuntu/Chapters/StandAloneInstallation</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/StandAloneIntro">HowToCookEdubuntu/Chapters/StandAloneIntro</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/StandAloneWhatNow">HowToCookEdubuntu/Chapters/StandAloneWhatNow</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/Support%26Docs">HowToCookEdubuntu/Chapters/Support&amp;Docs</a></li>
 +
<li><a href="/community/HowToCookEdubuntu/Chapters/ThinClientIntroduction">HowToCookEdubuntu/Chapters/ThinClientIntroduction</a></li>
 +
<li><a href="/community/HowToCygwinX">HowToCygwinX</a></li>
 +
<li><a href="/community/HowToEnableSpamFilteringInEvolution">HowToEnableSpamFilteringInEvolution</a></li>
 +
<li><a href="/community/HowToGetBetterRefreshRatesAndResolutions">HowToGetBetterRefreshRatesAndResolutions</a></li>
 +
<li><a href="/community/HowToGetHelp">HowToGetHelp</a></li>
 +
<li><a href="/community/HowToJACKConfiguration">HowToJACKConfiguration</a></li>
 +
<li><a href="/community/HowToMD5SUM">HowToMD5SUM</a></li>
 +
<li><a href="/community/HowToMonitorInternetTrafficTotals">HowToMonitorInternetTrafficTotals</a></li>
 +
<li><a href="/community/HowToPureDataIntroduction">HowToPureDataIntroduction</a></li>
 +
<li><a href="/community/HowToQjackCtlConnections">HowToQjackCtlConnections</a></li>
 +
<li><a href="/community/HowToReadline">HowToReadline</a></li>
 +
<li><a href="/community/HowToRecordInternetRadio">HowToRecordInternetRadio</a></li>
 +
<li><a href="/community/HowToRemoveWindows">HowToRemoveWindows</a></li>
 +
<li><a href="/community/HowToRipRealaudioStreamsToMp3">HowToRipRealaudioStreamsToMp3</a></li>
 +
<li><a href="/community/HowToSeq24Introduction">HowToSeq24Introduction</a></li>
 +
<li><a href="/community/HowToSetupLTSPDevelEnvironment">HowToSetupLTSPDevelEnvironment</a></li>
 +
<li><a href="/community/HowToSetupSoundCards">HowToSetupSoundCards</a></li>
 +
<li><a href="/community/HowToUseTheTerminal">HowToUseTheTerminal</a></li>
 +
<li><a href="/community/HowToUseTheTerminal/Talk">HowToUseTheTerminal/Talk</a></li>
 +
<li><a href="/community/HowToVanillaKernelWithRealtimePreemption">HowToVanillaKernelWithRealtimePreemption</a></li>
 +
<li><a href="/community/HowToVirtualKeyboardKeymapping">HowToVirtualKeyboardKeymapping</a></li>
 +
<li><a href="/community/HowToZeroconf">HowToZeroconf</a></li>
 +
<li><a href="/community/HowTos">HowTos</a></li>
 +
<li><a href="/community/HowtoConky140">HowtoConky140</a></li>
 +
<li><a href="/community/HowtoFixIndicFontRendering">HowtoFixIndicFontRendering</a></li>
 +
<li><a href="/community/HowtoPartition">HowtoPartition</a></li>
 +
</ul>
 +
</p>
 +
</td>
 +
</tr>
 +
</table>
 +
</div>
 +
<a id="bottom"></a>
 +
</div>
 +
<a id="bottom"></a>
 +
</div>
 +
</div> <!-- end page -->
 +
<div id="footer">
 +
<div id="ubuntulinks">
 +
&copy; 2007 <a href="http://www.canonical.com">Canonical Ltd</a>. Ubuntu, Kubuntu, Edubuntu and Canonical are registered trademarks of Canonical Ltd.<br />
 +
<a href="https://help.ubuntu.com/community/WikiGuide">Feedback</a> &mdash;
 +
<a href="https://help.ubuntu.com/community/License">Legal</a> &mdash;
 +
<a href="https://help.ubuntu.com/community/Credits">Credits</a>
 +
<br />
 +
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
 +
<img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/80x15.png" />
 +
</a>
 +
</div>
 +
</div>
 +
</body>
 +
</html>
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 22:48的版本

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> How - Community Ubuntu Documentation

How

This page does not exist yet. You can create a new empty page, or use one of the page templates. Before creating the page, please check if a similar page already exists.

Create new empty page

Page templates:

Existing pages with similar names: