特殊:Badtitle/NS100:WindowsDualBoot:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:WindowsDualBoot}} | {{Languages|UbuntuHelp:WindowsDualBoot}} | ||
#title Dual Boot Ubuntu and Windows | #title Dual Boot Ubuntu and Windows | ||
== Introduction == | == Introduction == | ||
This page describes how to | This page describes how to set up your computer in order to dual boot Ubuntu and Windows. | ||
== | == Back Up Your Data == | ||
Although this may seem obvious, it is important to [[UbuntuHelp:BackupYourSystem|| backup]] your data files to an external backup medium before attempting a dual-boot install (or any other hard drive manipulation), in case your hard drive becomes corrupted during the process. External hard drives, USB flash drives, and multiple DVDs or CDs are useful as external backup media. | |||
== Have a Windows recovery CD/DVD available == | |||
Although this may seem obvious, | Many computer manufacturers that pre-install Windows provide a Windows recovery/re-installation CD or DVD with the computer. | ||
However, many companies no longer ship a physical disk but instead create a hidden partition on the hard drive in which the recovery-disk information is stored. A utility is then usually provided which allows the user to burn a recovery/re-installation CD or DVD from it. If you are buying a new computer and intent on dual-booting, make sure you have (or can make) a physical Windows recovery/re-installation CD or DVD. If neither a CD/DVD nor a recovery partition/burning utility is provided by your computer manufacturer, you may need to telephone your vendor and ask for a CD or DVD (to which you are normally entitled under the Windows EULA). | |||
If you are buying a new computer and | It is very important to have such a physical recovery/re-installation CD/DVD prior to changing your hard drive, in case your hard drive becomes corrupted in the process (and the recovery partition thereby becomes unavailable for use). | ||
Once you have created a physical backup disk from a restore-image partition on the hard-drive, the restore-image partition can either be removed or left in place. Ubuntu can be installed with it intact without problems. | |||
=== Getting Recovery Media === | |||
You may need to request a physical recovery/re-installation CD or DVD directly from your computer manufacturer. Here are some resources: | |||
* [http://support.dell.com/support/topics/global.aspx/support/dsn/en/document?c=us&cs=19&docid=287034&l=en&s=dhs&redirect=1#7 Dell Operating System (OS) Recovery CD Creation and Manual Operating System Reinstall] | * [http://support.dell.com/support/topics/global.aspx/support/dsn/en/document?c=us&cs=19&docid=287034&l=en&s=dhs&redirect=1#7 Dell Operating System (OS) Recovery CD Creation and Manual Operating System Reinstall] | ||
* [http://support.dell.com/pcrt Other related links and information for Dell owners] | * [http://support.dell.com/pcrt Other related links and information for Dell owners] | ||
* [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-4M7HWZ | * [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-4M7HWZ Lenovo Product Recovery CD or DVD] | ||
* [http://www.mydigitallife.info/2006/01/18/ibm-lenovo-thinkpad-recovery-cd/ | * [http://www.mydigitallife.info/2006/01/18/ibm-lenovo-thinkpad-recovery-cd/ Getting recovery CDs from IBM for a Thinkpad] | ||
* [http://h10025.www1.hp.com/ewfrf/wc/genericDocument?cc=us&docname=bph07143&lc=en Obtaining a Windows Recovery CD or DVD set | * [http://h10025.www1.hp.com/ewfrf/wc/genericDocument?cc=us&docname=bph07143&lc=en Obtaining a Windows Recovery CD or DVD set for HP and Compaq PCs] | ||
== | == Install Ubuntu after Windows == | ||
In general, a Windows OS should be installed first, because its bootloader is very particular and because Windows installers tend to overwrite the entire hard drive (potentially wiping out any other data stored on it). If Windows isn't already installed, install it first. If you are able to [[UbuntuHelp:PartitioningSchemes|partition the drive]] prior to installing Windows, leave space for Ubuntu during the initial partitioning process. Then you won't have to resize your NTFS partition to make room for Ubuntu later (saving a bit of time). | |||
When a Windows installation already occupies the entire hard drive, its partition needs to be shrunk, creating free space for the Ubuntu partition. See [[UbuntuHelp:HowtoResizeWindowsPartitions|How to Resize Windows Partitions]] to learn how to do this. | |||
This can be done through Control Panel -> Administrative tools -> Computer Management -> Disk Management. You can then use the partition manager to shrink the partitions. As a side note, you can only create free space to the right of a partition. | |||
If you have resized the windows 7 /vista partitions and cannot boot up windows, you can use the instructions from [[UbuntuHelp:RecoveringWindows#Resizing|Windows Vista / 7 Partitions|WindowsRecovery]] to fix it. | |||
* Download Ubuntu iso from [http://www. | Once free space has been created on the hard drive, it is easy to install Ubuntu as the second operating system (and it is done automatically) from the Ubuntu [[UbuntuHelp:LiveCD|LiveCD]]. Allow the Ubuntu [[UbuntuHelp:LiveCD|LiveCD]] to install to "largest available free space" (if you have left unallocated free space), or manually into a partition that you have already created for Ubuntu. | ||
* | === Install Ubuntu === | ||
* Download an Ubuntu [[UbuntuHelp:LiveCD|LiveCD]] image (.iso) from [http://www.ubuntu.com/GetUbuntu/download Ubuntu Downloads] and burn an Ubuntu [[UbuntuHelp:LiveCD|LiveCD]] (see [[UbuntuHelp:BurningIsoHowto|BurningIsoHowto]]). | |||
* Insert the [[UbuntuHelp:LiveCD|LiveCD]] into your CD-ROM drive and reboot your PC. | |||
* If the computer does not boot from the CD (eg. Windows starts again instead), check your BIOS settings and | * If the computer does not boot from the CD (eg. Windows starts again instead), check your BIOS settings and adjust them so that booting from the CD is allowed. | ||
* Proceed with installation until you are asked this question: "How do you want to partition the disk ?". | |||
==== Resizing Partitions Using the Ubuntu Installer ==== | |||
===== Automatic partition resizing ===== | |||
= | * Choose the First Option (It should be something like: "Resize IDE1 master, partition #1 (hda1) and use freed space"). | ||
* Specify the size of the new partition as a percentage of your entire hard disk. | |||
=== Resizing Partitions Using the Ubuntu Installer === | * Click on "Forward". | ||
==== Automatic | * Continue to [[UbuntuHelp:WindowsDualBoot#head-6852d2e9b3e03d350a4271b58e3bdea4bbe81ad8|Finishing|Ubuntu Installation]] | ||
===== Manual partitioning ===== | |||
* Choose "Manually edit partition table" | |||
==== Manual partitioning ==== | |||
* Listed will be your current partitions | * Listed will be your current partitions | ||
* Select the partition you want to resize and press Enter. | |||
* Select "Size:", press Enter. | |||
* Select Yes, press Enter. | |||
* Type in a new size in Gigabytes for your partition, it's recommended you free up AT LEAST 10 GB of free space for your Ubuntu install. Press Enter when happy with your changes. It may take some time to apply the changes. | |||
* Create a swap partition of at least your amount of RAM (if you don't know, 2000 MB is a good value). | |||
* Create a partition for your Ubuntu installation, at least 10 GB. | |||
* Select "Finish partitioning and write changes to disk". | |||
== Master Boot Record and Boot Manager == | == Master Boot Record and Boot Manager == | ||
GNU/ | GNU/GRUB2 is the boot manager installed in Ubuntu by default. If you use the Alternate CD you can choose Lilo instead. GRUB2, GRUB and Lilo are good Open Source boot managers so the main parts of the boot loaders are installed inside Ubuntu. This means Ubuntu is independent and avoids any need for writing to other operating systems. To accomplish this, the only thing in your computer outside of Ubuntu that needs to be changed is a small code in the MBR (Master Boot Record) of the first hard disk. The MBR code is changed to point to the boot loader in Ubuntu. You will be presented with a list of operating systems and you can choose one to boot. If you do nothing Ubuntu will boot after a ten second countdown. If you select Windows then GRUB or Lilo will chain-load Windows for you at the Windows boot sector, which is the first sector of the Windows partition. | ||
If you have a problem with changing the MBR code, you might prefer to just install the code for pointing to GRUB to the first sector of your Ubuntu partition instead. If you do that during the Ubuntu installation process, then Ubuntu won't boot until you configure some other boot manager to point to Ubuntu's boot sector. | If you have a problem with changing the MBR code, you might prefer to just install the code for pointing to GRUB to the first sector of your Ubuntu partition instead. If you do that during the Ubuntu installation process, then Ubuntu won't boot until you configure some other boot manager to point to Ubuntu's boot sector. | ||
Windows Vista no longer utilizes boot.ini, ntdetect.com, and ntldr when booting. Instead, Vista stores all data for its new boot manager in a boot folder. Windows Vista ships with an command line utility called bcdedit.exe, which requires administrator credentials to use. You may want to read [http://go.microsoft.com/fwlink/?LinkId=112156] about it. | Windows Vista no longer utilizes boot.ini, ntdetect.com, and ntldr when booting. Instead, Vista stores all data for its new boot manager in a boot folder. Windows Vista ships with an command line utility called bcdedit.exe, which requires administrator credentials to use. You may want to read [http://go.microsoft.com/fwlink/?LinkId=112156] about it. | ||
Using a command line utility always has its learning curve, so a more productive and better job can be done with a free utility called [http://neosmart.net/dl.php?id=1 EasyBCD], developed and mastered in during the times of Vista Beta already. EasyBCD is user friendly and many Vista users highly recommend EasyBCD. | Using a command line utility always has its learning curve, so a more productive and better job can be done with a free utility called [http://neosmart.net/dl.php?id=1 EasyBCD], developed and mastered in during the times of Vista Beta already. EasyBCD is user friendly and many Vista users highly recommend EasyBCD. | ||
== Installing Windows After Ubuntu == | == Installing Windows After Ubuntu == | ||
Normally when Windows is installed after Ubuntu the | Normally when Windows is installed after Ubuntu the "Master Boot Record", MBR, will be overwritten. You can bootup off a [[UbuntuHelp: https://help.ubuntu.com/community/LiveCD | LiveCD ]] and repair the MBR. However, there are 2 different approaches: | ||
<<Anchor(recovering-grub)>> | <<Anchor(recovering-grub)>> | ||
== Recovering GRUB after reinstalling Windows == | === Recovering GRUB after reinstalling Windows === | ||
There are also these help guides | |||
* https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows | |||
* https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20[[UbuntuHelp:LiveCD|LiveCD]] | |||
Which should help with any install of Ubuntu now. | |||
For some simple cases the advice below might help | |||
==== Ubuntu 10.04 or 9.10 ==== | |||
Sorry, definitely use this guide | |||
* https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20[[UbuntuHelp:LiveCD|LiveCD]] | |||
==== Ubuntu 9.10 & earlier ==== | |||
The older Grub, sometimes called Grub-legacy or perhaps Grub1 was used up until Ubuntu 9.10. The default for 9.10 was initially Grub1 but installs would drift over to Grub2 without users really being aware of the change. With any current Ubuntu install it is wise to install, or re-install Grub2 as shown in the link above. | |||
If you run an older Ubuntu or had any trouble with Grub2 then Grub1 & Lilo are still available. To fix the MBR with an older [[UbuntuHelp: https://help.ubuntu.com/community/LiveCD | LiveCD ]] to access a Grub command-line: | |||
1.#1 Boot into a [[UbuntuHelp: https://help.ubuntu.com/community/LiveCD | [[UbuntuHelp:LiveCD|LiveCD]] ]] | |||
1.#2 Open a [[UbuntuHelp: https://help.ubuntu.com/community/UsingTheTerminal#Starting_a_Terminal | terminal ]] | |||
1.#3 Open the GRUB Command-line utility by typing | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo grub | sudo grub | ||
</nowiki></pre> | </nowiki></pre> | ||
1.#4 Tell GRUB | 1.#4 Find where Grub is. If this gives a few different answers then you will need to find the correct one, perhaps by trial-and-error. | ||
<pre><nowiki> | |||
find /boot/grub/stage1 | |||
</nowiki></pre> | |||
1.#5 Tell GRUB which partition to tell the MBR your Grub is on by entering | |||
<pre><nowiki> | <pre><nowiki> | ||
root (hdA,B) | root (hdA,B) | ||
</nowiki></pre> | </nowiki></pre> | ||
The coordinates A,B are where 'A' is the hard-drive number, starting at 0, and 'B' is the partition number, starting at 0. For example, if Ubuntu was installed on the second partition of the first hard-drive, the command should be | |||
<pre><nowiki> | <pre><nowiki> | ||
root (hd0,1) | root (hd0,1) | ||
</nowiki></pre> | </nowiki></pre> | ||
1.# | 1.#6 Tell GRUB which drive's MBR to fix | ||
<pre><nowiki> | <pre><nowiki> | ||
setup (hd0) | setup (hd0) | ||
</nowiki></pre> | </nowiki></pre> | ||
Replace 0 only in the extremely unlikely event that your bios does not use the first hard-drive as the boot device. Typically Ubuntu might be on any drive but the bios will almost always go to the first drive's MBR to find out where to find the boot-loader. | |||
1.# | 1.#7 Leave the GRUB Command line | ||
<pre><nowiki> | <pre><nowiki> | ||
quit | quit | ||
</nowiki></pre> | </nowiki></pre> | ||
and reboot. | and reboot. | ||
=== Master Boot Record backup and re-replacement === | |||
Back-up the existing MBR, install Windows, replace your backup overwriting the Windows boot code: | |||
<ol><li>Create an NTFS partition for windows (using fdisk, GPartEd or whatever tool you are familiar with) | |||
</li><li>Backup the MBR e.g. <code><nowiki>dd if=/dev/sda of=/mbr.bin bs=446 count=1</nowiki></code> | |||
</li><li>Install windows | |||
</li><li>Boot into a [[UbuntuHelp: https://help.ubuntu.com/community/[[UbuntuHelp:LiveCD|LiveCD]] | [[UbuntuHelp:LiveCD|LiveCD]] ]] | |||
</li><li>Mount your root partition in the [[UbuntuHelp:LiveCD|LiveCD]] | |||
</li><li>Restore the MBR e.g. <code><nowiki>dd if=/media/sda/mbr.bin of=/dev/sda bs=446 count=1</nowiki></code> | |||
</li><li>Restart and Ubuntu will boot | |||
</li><li>Setup grub to boot windows</li></ol> | |||
== Issues with Windows XP and NTFS == | == Issues with Windows XP and NTFS == | ||
The Ubuntu installer has included support for resizing NTFS partitions since Ubuntu 5.10 (Breezy Badger) was released way back in 2005. Very few problems have been reported relative to the huge number of times that the installer has been used. If you tried the above procedure and have had no luck, it might be that there is a pre-existing problem either in the file system, in the partition table or the hard disk. | The Ubuntu installer has included support for resizing NTFS partitions since Ubuntu 5.10 (Breezy Badger) was released way back in 2005. Very few problems have been reported relative to the huge number of times that the installer has been used. If you tried the above procedure and have had no luck, it might be that there is a pre-existing problem either in the file system, in the partition table or the hard disk. | ||
第134行: | 第132行: | ||
<ol><li>[http://unetbootin.sourceforge.net/ Download] and install the Windows (.exe) file, then reboot. | <ol><li>[http://unetbootin.sourceforge.net/ Download] and install the Windows (.exe) file, then reboot. | ||
</li><li>Select the UNetbootin-partedmagic entry after rebooting, and wait as PartedMagic boots up. | </li><li>Select the UNetbootin-partedmagic entry after rebooting, and wait as PartedMagic boots up. | ||
</li><li>Start the partition manager by clicking the GParted icon on the the panel. | </li><li>Start the partition manager by clicking the [[UbuntuHelp:GParted|GParted]] icon on the the panel. | ||
</li><li>Select your disk (probably /dev/sda) via the drop-down menu on the top-right corner of the interface. | </li><li>Select your disk (probably /dev/sda) via the drop-down menu on the top-right corner of the interface. | ||
</li><li>Right-click the NTFS partition to be resized (probably /dev/sda1), and select the "resize" option. | </li><li>Right-click the NTFS partition to be resized (probably /dev/sda1), and select the "resize" option. | ||
第141行: | 第139行: | ||
</li><li>Upon the next Windows boot, click OK when prompted to remove UNetbootin-partedmagic to remove its boot menu entry.</li></ol> | </li><li>Upon the next Windows boot, click OK when prompted to remove UNetbootin-partedmagic to remove its boot menu entry.</li></ol> | ||
== Also see == | |||
* [[UbuntuHelp:MultiOSBoot|MultiOSBoot]] - How to boot more than two operating systems from a single hard drive. | |||
* [[UbuntuHelp:[[category:CategoryVirtualization|Virtualization]] [[category:Category]]]] | |||
== External Links == | == External Links == | ||
* [http://ubuntuguide.org/wiki/Ubuntu:Karmic#Installing_Ubuntu Ubuntuguide -- Installing Ubuntu] -- concise and up-to-date | |||
* [http://members.iinet.net/~herman546/ Illustrated Dual Boot Site]. | * [http://members.iinet.net/~herman546/ Illustrated Dual Boot Site]. | ||
* [http://neosmart.net/wiki/display/EBCD/Linux Dual-Booting Ubuntu and Vista with EasyBCD] | * [http://neosmart.net/wiki/display/EBCD/Linux Dual-Booting Ubuntu and Vista with EasyBCD] | ||
* [http://neosmart.net/wiki/display/EBCD/Ubuntu Step-By-Step Screenshot Tutorial to set-up an Ubuntu + Vista dual-boot] | * [http://neosmart.net/wiki/display/EBCD/Ubuntu Step-By-Step Screenshot Tutorial to set-up an Ubuntu + Vista dual-boot] | ||
* [http://www.ehomeupgrade.com/entry/2622/how-to_dual-boot_ubuntu How-To: Dual-Boot Ubuntu 6.06 (Dapper) Linux Desktop Along Side Windows XP] | * [http://www.ehomeupgrade.com/entry/2622/how-to_dual-boot_ubuntu How-To: Dual-Boot Ubuntu 6.06 (Dapper) Linux Desktop Along Side Windows XP] | ||
* [http://www.howtoforge.com/unetbootin_windows_ubuntu_fedora_p4 HowtoForge Guide: Partition Resizing using UNetbootin-PartedMagic] | * [http://www.howtoforge.com/unetbootin_windows_ubuntu_fedora_p4 HowtoForge Guide: Partition Resizing using UNetbootin-PartedMagic] | ||
---- | ---- |
2010年5月20日 (四) 01:01的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/WindowsDualBoot }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/af | • {{#if: UbuntuHelp:WindowsDualBoot|Afrikaans| [[::WindowsDualBoot/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/ar | • {{#if: UbuntuHelp:WindowsDualBoot|العربية| [[::WindowsDualBoot/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/az | • {{#if: UbuntuHelp:WindowsDualBoot|azərbaycanca| [[::WindowsDualBoot/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/bcc | • {{#if: UbuntuHelp:WindowsDualBoot|جهلسری بلوچی| [[::WindowsDualBoot/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/bg | • {{#if: UbuntuHelp:WindowsDualBoot|български| [[::WindowsDualBoot/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/br | • {{#if: UbuntuHelp:WindowsDualBoot|brezhoneg| [[::WindowsDualBoot/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/ca | • {{#if: UbuntuHelp:WindowsDualBoot|català| [[::WindowsDualBoot/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/cs | • {{#if: UbuntuHelp:WindowsDualBoot|čeština| [[::WindowsDualBoot/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/de | • {{#if: UbuntuHelp:WindowsDualBoot|Deutsch| [[::WindowsDualBoot/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/el | • {{#if: UbuntuHelp:WindowsDualBoot|Ελληνικά| [[::WindowsDualBoot/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/es | • {{#if: UbuntuHelp:WindowsDualBoot|español| [[::WindowsDualBoot/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/fa | • {{#if: UbuntuHelp:WindowsDualBoot|فارسی| [[::WindowsDualBoot/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/fi | • {{#if: UbuntuHelp:WindowsDualBoot|suomi| [[::WindowsDualBoot/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/fr | • {{#if: UbuntuHelp:WindowsDualBoot|français| [[::WindowsDualBoot/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/gu | • {{#if: UbuntuHelp:WindowsDualBoot|ગુજરાતી| [[::WindowsDualBoot/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/he | • {{#if: UbuntuHelp:WindowsDualBoot|עברית| [[::WindowsDualBoot/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/hu | • {{#if: UbuntuHelp:WindowsDualBoot|magyar| [[::WindowsDualBoot/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/id | • {{#if: UbuntuHelp:WindowsDualBoot|Bahasa Indonesia| [[::WindowsDualBoot/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/it | • {{#if: UbuntuHelp:WindowsDualBoot|italiano| [[::WindowsDualBoot/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/ja | • {{#if: UbuntuHelp:WindowsDualBoot|日本語| [[::WindowsDualBoot/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/ko | • {{#if: UbuntuHelp:WindowsDualBoot|한국어| [[::WindowsDualBoot/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/ksh | • {{#if: UbuntuHelp:WindowsDualBoot|Ripoarisch| [[::WindowsDualBoot/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/mr | • {{#if: UbuntuHelp:WindowsDualBoot|मराठी| [[::WindowsDualBoot/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/ms | • {{#if: UbuntuHelp:WindowsDualBoot|Bahasa Melayu| [[::WindowsDualBoot/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/nl | • {{#if: UbuntuHelp:WindowsDualBoot|Nederlands| [[::WindowsDualBoot/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/no | • {{#if: UbuntuHelp:WindowsDualBoot|norsk| [[::WindowsDualBoot/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/oc | • {{#if: UbuntuHelp:WindowsDualBoot|occitan| [[::WindowsDualBoot/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/pl | • {{#if: UbuntuHelp:WindowsDualBoot|polski| [[::WindowsDualBoot/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/pt | • {{#if: UbuntuHelp:WindowsDualBoot|português| [[::WindowsDualBoot/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/ro | • {{#if: UbuntuHelp:WindowsDualBoot|română| [[::WindowsDualBoot/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/ru | • {{#if: UbuntuHelp:WindowsDualBoot|русский| [[::WindowsDualBoot/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/si | • {{#if: UbuntuHelp:WindowsDualBoot|සිංහල| [[::WindowsDualBoot/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/sq | • {{#if: UbuntuHelp:WindowsDualBoot|shqip| [[::WindowsDualBoot/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/sr | • {{#if: UbuntuHelp:WindowsDualBoot|српски / srpski| [[::WindowsDualBoot/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/sv | • {{#if: UbuntuHelp:WindowsDualBoot|svenska| [[::WindowsDualBoot/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/th | • {{#if: UbuntuHelp:WindowsDualBoot|ไทย| [[::WindowsDualBoot/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/tr | • {{#if: UbuntuHelp:WindowsDualBoot|Türkçe| [[::WindowsDualBoot/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/vi | • {{#if: UbuntuHelp:WindowsDualBoot|Tiếng Việt| [[::WindowsDualBoot/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/yue | • {{#if: UbuntuHelp:WindowsDualBoot|粵語| [[::WindowsDualBoot/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/zh | • {{#if: UbuntuHelp:WindowsDualBoot|中文| [[::WindowsDualBoot/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/zh-hans | • {{#if: UbuntuHelp:WindowsDualBoot|中文(简体)| [[::WindowsDualBoot/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WindowsDualBoot | UbuntuHelp:WindowsDualBoot | {{#if: | :}}WindowsDualBoot}}/zh-hant | • {{#if: UbuntuHelp:WindowsDualBoot|中文(繁體)| [[::WindowsDualBoot/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:WindowsDualBoot|:WindowsDualBoot|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :WindowsDualBoot/zh | | {{#ifexist: WindowsDualBoot/zh | | {{#ifeq: {{#titleparts:WindowsDualBoot|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:WindowsDualBoot|1|-1|}} | zh | | }}
- title Dual Boot Ubuntu and Windows
Introduction
This page describes how to set up your computer in order to dual boot Ubuntu and Windows.
Back Up Your Data
Although this may seem obvious, it is important to | backup your data files to an external backup medium before attempting a dual-boot install (or any other hard drive manipulation), in case your hard drive becomes corrupted during the process. External hard drives, USB flash drives, and multiple DVDs or CDs are useful as external backup media.
Have a Windows recovery CD/DVD available
Many computer manufacturers that pre-install Windows provide a Windows recovery/re-installation CD or DVD with the computer. However, many companies no longer ship a physical disk but instead create a hidden partition on the hard drive in which the recovery-disk information is stored. A utility is then usually provided which allows the user to burn a recovery/re-installation CD or DVD from it. If you are buying a new computer and intent on dual-booting, make sure you have (or can make) a physical Windows recovery/re-installation CD or DVD. If neither a CD/DVD nor a recovery partition/burning utility is provided by your computer manufacturer, you may need to telephone your vendor and ask for a CD or DVD (to which you are normally entitled under the Windows EULA). It is very important to have such a physical recovery/re-installation CD/DVD prior to changing your hard drive, in case your hard drive becomes corrupted in the process (and the recovery partition thereby becomes unavailable for use). Once you have created a physical backup disk from a restore-image partition on the hard-drive, the restore-image partition can either be removed or left in place. Ubuntu can be installed with it intact without problems.
Getting Recovery Media
You may need to request a physical recovery/re-installation CD or DVD directly from your computer manufacturer. Here are some resources:
- Dell Operating System (OS) Recovery CD Creation and Manual Operating System Reinstall
- Other related links and information for Dell owners
- Lenovo Product Recovery CD or DVD
- Getting recovery CDs from IBM for a Thinkpad
- Obtaining a Windows Recovery CD or DVD set for HP and Compaq PCs
Install Ubuntu after Windows
In general, a Windows OS should be installed first, because its bootloader is very particular and because Windows installers tend to overwrite the entire hard drive (potentially wiping out any other data stored on it). If Windows isn't already installed, install it first. If you are able to partition the drive prior to installing Windows, leave space for Ubuntu during the initial partitioning process. Then you won't have to resize your NTFS partition to make room for Ubuntu later (saving a bit of time). When a Windows installation already occupies the entire hard drive, its partition needs to be shrunk, creating free space for the Ubuntu partition. See How to Resize Windows Partitions to learn how to do this. This can be done through Control Panel -> Administrative tools -> Computer Management -> Disk Management. You can then use the partition manager to shrink the partitions. As a side note, you can only create free space to the right of a partition. If you have resized the windows 7 /vista partitions and cannot boot up windows, you can use the instructions from Windows Vista / 7 Partitions|WindowsRecovery to fix it. Once free space has been created on the hard drive, it is easy to install Ubuntu as the second operating system (and it is done automatically) from the Ubuntu LiveCD. Allow the Ubuntu LiveCD to install to "largest available free space" (if you have left unallocated free space), or manually into a partition that you have already created for Ubuntu.
Install Ubuntu
- Download an Ubuntu LiveCD image (.iso) from Ubuntu Downloads and burn an Ubuntu LiveCD (see BurningIsoHowto).
- Insert the LiveCD into your CD-ROM drive and reboot your PC.
- If the computer does not boot from the CD (eg. Windows starts again instead), check your BIOS settings and adjust them so that booting from the CD is allowed.
- Proceed with installation until you are asked this question: "How do you want to partition the disk ?".
Resizing Partitions Using the Ubuntu Installer
Automatic partition resizing
- Choose the First Option (It should be something like: "Resize IDE1 master, partition #1 (hda1) and use freed space").
- Specify the size of the new partition as a percentage of your entire hard disk.
- Click on "Forward".
- Continue to Finishing|Ubuntu Installation
Manual partitioning
- Choose "Manually edit partition table"
- Listed will be your current partitions
- Select the partition you want to resize and press Enter.
- Select "Size:", press Enter.
- Select Yes, press Enter.
- Type in a new size in Gigabytes for your partition, it's recommended you free up AT LEAST 10 GB of free space for your Ubuntu install. Press Enter when happy with your changes. It may take some time to apply the changes.
- Create a swap partition of at least your amount of RAM (if you don't know, 2000 MB is a good value).
- Create a partition for your Ubuntu installation, at least 10 GB.
- Select "Finish partitioning and write changes to disk".
Master Boot Record and Boot Manager
GNU/GRUB2 is the boot manager installed in Ubuntu by default. If you use the Alternate CD you can choose Lilo instead. GRUB2, GRUB and Lilo are good Open Source boot managers so the main parts of the boot loaders are installed inside Ubuntu. This means Ubuntu is independent and avoids any need for writing to other operating systems. To accomplish this, the only thing in your computer outside of Ubuntu that needs to be changed is a small code in the MBR (Master Boot Record) of the first hard disk. The MBR code is changed to point to the boot loader in Ubuntu. You will be presented with a list of operating systems and you can choose one to boot. If you do nothing Ubuntu will boot after a ten second countdown. If you select Windows then GRUB or Lilo will chain-load Windows for you at the Windows boot sector, which is the first sector of the Windows partition. If you have a problem with changing the MBR code, you might prefer to just install the code for pointing to GRUB to the first sector of your Ubuntu partition instead. If you do that during the Ubuntu installation process, then Ubuntu won't boot until you configure some other boot manager to point to Ubuntu's boot sector. Windows Vista no longer utilizes boot.ini, ntdetect.com, and ntldr when booting. Instead, Vista stores all data for its new boot manager in a boot folder. Windows Vista ships with an command line utility called bcdedit.exe, which requires administrator credentials to use. You may want to read [1] about it. Using a command line utility always has its learning curve, so a more productive and better job can be done with a free utility called EasyBCD, developed and mastered in during the times of Vista Beta already. EasyBCD is user friendly and many Vista users highly recommend EasyBCD.
Installing Windows After Ubuntu
Normally when Windows is installed after Ubuntu the "Master Boot Record", MBR, will be overwritten. You can bootup off a LiveCD and repair the MBR. However, there are 2 different approaches: <<Anchor(recovering-grub)>>
Recovering GRUB after reinstalling Windows
There are also these help guides
- https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
- https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
Which should help with any install of Ubuntu now. For some simple cases the advice below might help
Ubuntu 10.04 or 9.10
Sorry, definitely use this guide
Ubuntu 9.10 & earlier
The older Grub, sometimes called Grub-legacy or perhaps Grub1 was used up until Ubuntu 9.10. The default for 9.10 was initially Grub1 but installs would drift over to Grub2 without users really being aware of the change. With any current Ubuntu install it is wise to install, or re-install Grub2 as shown in the link above. If you run an older Ubuntu or had any trouble with Grub2 then Grub1 & Lilo are still available. To fix the MBR with an older LiveCD to access a Grub command-line: 1.#1 Boot into a [[UbuntuHelp: https://help.ubuntu.com/community/LiveCD | LiveCD ]] 1.#2 Open a terminal 1.#3 Open the GRUB Command-line utility by typing
sudo grub
1.#4 Find where Grub is. If this gives a few different answers then you will need to find the correct one, perhaps by trial-and-error.
find /boot/grub/stage1
1.#5 Tell GRUB which partition to tell the MBR your Grub is on by entering
root (hdA,B)
The coordinates A,B are where 'A' is the hard-drive number, starting at 0, and 'B' is the partition number, starting at 0. For example, if Ubuntu was installed on the second partition of the first hard-drive, the command should be
root (hd0,1)
1.#6 Tell GRUB which drive's MBR to fix
setup (hd0)
Replace 0 only in the extremely unlikely event that your bios does not use the first hard-drive as the boot device. Typically Ubuntu might be on any drive but the bios will almost always go to the first drive's MBR to find out where to find the boot-loader. 1.#7 Leave the GRUB Command line
quit
and reboot.
Master Boot Record backup and re-replacement
Back-up the existing MBR, install Windows, replace your backup overwriting the Windows boot code:
- Create an NTFS partition for windows (using fdisk, GPartEd or whatever tool you are familiar with)
- Backup the MBR e.g.
dd if=/dev/sda of=/mbr.bin bs=446 count=1
- Install windows
- Boot into a [[UbuntuHelp: https://help.ubuntu.com/community/LiveCD | LiveCD ]]
- Mount your root partition in the LiveCD
- Restore the MBR e.g.
dd if=/media/sda/mbr.bin of=/dev/sda bs=446 count=1
- Restart and Ubuntu will boot
- Setup grub to boot windows
Issues with Windows XP and NTFS
The Ubuntu installer has included support for resizing NTFS partitions since Ubuntu 5.10 (Breezy Badger) was released way back in 2005. Very few problems have been reported relative to the huge number of times that the installer has been used. If you tried the above procedure and have had no luck, it might be that there is a pre-existing problem either in the file system, in the partition table or the hard disk. First you should try running CHKDSK before trying again to resize the partition, and if you are using the Alternate CD, defragging might help. It is recommended that you run CHKDSK once again after resizing your NTFS partition. Also, try the following alternative methods:
Using QtParted from the System Rescue CD
- Boot into Windows and backup any valuable documents/photos etc onto removable media such as CD-R/DVD-R.
- Run the Windows disk check tool (Error-checking) on C: a couple of times (the results can be seen in the Administrative Tools > Event Viewer > Application under a "Winlogon" entry).
- Run the Windows defragmentation tool on C:
- Download the System Rescue CD ISO image (100 MB; has several very useful software tools).
- Burn the ISO image to a CD.
- Boot from the CD and hit Enter when you see the message "Boot:".
- When you get a command prompt, enter:
run_qtparted
- Select your disk on the graphical screen (most likely /dev/hda).
- Select your NTFS partition to be resized (most likely /dev/hda1).
- Right click with the mouse and choose Resize.
- Set the new partition size.
- Commit your changes in the File -> Commit menu. If your keyboard and mouse stop responding during resizing then please just be patient.
- Once your changes are saved, remove the System Rescue CD and insert your Ubuntu installation CD.
- Reboot and install Ubuntu into the free space.
Using GParted from UNetbootin-PartedMagic
Another approach to resizing partitions, which does not require a CD, is to load PartedMagic from Windows via the UNetbootin PartedMagic Loader:
- Download and install the Windows (.exe) file, then reboot.
- Select the UNetbootin-partedmagic entry after rebooting, and wait as PartedMagic boots up.
- Start the partition manager by clicking the GParted icon on the the panel.
- Select your disk (probably /dev/sda) via the drop-down menu on the top-right corner of the interface.
- Right-click the NTFS partition to be resized (probably /dev/sda1), and select the "resize" option.
- Drag the slider to specify the new size the NTFS partition should be resized to, then press OK.
- Press the "Apply" button to resize the disk, then reboot once done.
- Upon the next Windows boot, click OK when prompted to remove UNetbootin-partedmagic to remove its boot menu entry.
Also see
- MultiOSBoot - How to boot more than two operating systems from a single hard drive.
- [[UbuntuHelp: ]]
External Links
- Ubuntuguide -- Installing Ubuntu -- concise and up-to-date
- Illustrated Dual Boot Site.
- Dual-Booting Ubuntu and Vista with EasyBCD
- Step-By-Step Screenshot Tutorial to set-up an Ubuntu + Vista dual-boot
- How-To: Dual-Boot Ubuntu 6.06 (Dapper) Linux Desktop Along Side Windows XP
- HowtoForge Guide: Partition Resizing using UNetbootin-PartedMagic