Difference between revisions of "Dual boot with Windows"

From ArchWiki
Jump to: navigation, search
m (warning re large games in Windows)
(clar., format)
Line 1: Line 1:
 
[[Category:Boot process (English)]]
 
[[Category:Boot process (English)]]
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
 
 
{{i18n_links_start}}
 
{{i18n_links_start}}
 
{{i18n_entry|English|Windows_and_Arch_Dual_Boot}}
 
{{i18n_entry|English|Windows_and_Arch_Dual_Boot}}
 
{{i18n_entry|Русский|Двойная загрузка: Windows и Arch}}
 
{{i18n_entry|Русский|Двойная загрузка: Windows и Arch}}
 
{{i18n_links_end}}
 
{{i18n_links_end}}
 +
This is a simple article detailing different methods of Arch/Windows coexistence.
  
== Windows and Arch Dual Booting: ==
+
==Windows and Arch Dual Booting==
 
+
 
In this example, we will install Windows first, and subsequently install the GRUB bootloader along with Arch, allowing for dual boot.
 
In this example, we will install Windows first, and subsequently install the GRUB bootloader along with Arch, allowing for dual boot.
  
 
Installation will be standard, but there are a few things to keep in mind:
 
Installation will be standard, but there are a few things to keep in mind:
  
1. You will have to use logical partitions for some of our partitions, because there can only be up to 4 primary partitions per disk.
+
1. You may have to use logical partitions for some of our partitions, because there can only be up to 4 primary partitions per disk.
  
2. '''Very Important''': Remember to write down your partitions numbers: "sda1, sda2... sda8", noting which type of partitions belong to their relevant number. For example:
+
2. Remember to write down your partitions numbers: "sda1, sda2... sda8", noting which type of partitions belong to their relevant number. For example:
sda1: Windows (30GB should be enough. Many new games exceed 10GB each so bear this in mind)
+
 
 +
:; sda1 : Windows - 30GB should be enough. Many new games exceed 10GB each so bear this in mind.
 
   
 
   
sda2: /boot (100MB is plenty)
+
:; sda2 : /boot - 100MB is enough (optional)
 
   
 
   
sda3: / (about 10-16GB is good)
+
:; sda3 : / - about 10GB is appropiate
 
   
 
   
sda4: swap (between 512MB and 1024MB)
+
:; sda4: swap - between 1024MB and 1512MB (optional)
 
   
 
   
sda5: /home (use rest of hard drive)
+
:; sda5: /home - use rest of hard drive (optional)
  
It is important to note that there is a 1024 cylinder limit with some older BIOSs. This means that the BIOS cannot access things beyond the 1024th cylinder (about 8.5GB), so the /boot partition should be in the first 8.5GB (space before Windows partition). [http://gparted.sourceforge.net/livecd.php GParted LiveCD] or a partitioning tool in [http://www.sysresccd.org/Main_Page SystemRescueCd] are useful for moving and resizing partitions to accommodate this.
+
It is important to note that there is a 1024 cylinder limit with some older BIOSs. This means that the BIOS cannot access things beyond the 1024th cylinder (about 8.5GB), so the /boot partition should be in the first 8.5GB (space before Windows partition). [http://gparted.sourceforge.net/livecd.php GParted LiveCD] or a partitioning tool in [http://www.sysresccd.org/Main_Page SystemRescueCd] are useful for moving and resizing partitions to accommodate this.
 
+
3. When installing grub, you must configure /boot/grub/menu.lst), and make sure to install grub to /boot (or root (/) if you did not create a separate partition for /boot).  There should be about three lines at the end of the file that speak about chainloading to boot other OSs, these can most generally be uncommented if you follow above convention, this would place windows boot point at hd0,0 or sda1.  Thus you would have something akin to this:
+
  
 +
3. When installing grub, you must configure /boot/grub/menu.lst), and make sure to install grub to /boot (or root (/) if you did not create a separate partition for /boot). There should be about three lines at the end of the file that speak about chainloading to boot other OSs, these can most generally be uncommented if you follow above convention, this would place windows boot point at hd0,0 or sda1. Thus you would have something akin to this:
 
  # Windows XP
 
  # Windows XP
 
  title Windows XP
 
  title Windows XP
Line 37: Line 36:
 
The parts of this entry break down as follows:
 
The parts of this entry break down as follows:
  
'''''title Windows XP''''' <<--Can be anything you like, it will just be what is displayed in the grub bootup screen
+
:; title Windows XP : Can be anything you like, it will just be what is displayed in the grub bootup screen
  
'''''rootnoverify (hd0,0)''''' <<--Remember the partition numbers we wrote down, here you write in the partition number of your windows partition. This sets the windows boot at root, even though GRUB cannot read it.
+
:; rootnoverify (hd0,0) : Remember the partition numbers we wrote down, here you write in the partition number of your windows partition. This sets the windows boot at root, even though GRUB cannot read it.
  
'''''chainloader +1''''' <<-- What this does is call the Windows boot loader that is still in MBR in our case, since GRUB cannot boot Windows itself.
+
:; chainloader +1 : What this does is call the Windows boot loader that is still in MBR in our case, since GRUB cannot boot Windows itself.
  
'''REMEMBER:''' The file is read from the top down, so the system listed first will be the one to auto boot, if no keys are pressed during the grub boot screen.
+
{{Note|
 +
*The file is read from the top down, so the system listed first will be the one to auto boot, if no keys are pressed during the grub boot screen.
  
'''NOTE:'''GRUB uses a zero indexed system of numbering drives and partitions, which is a different convention than you may be used to seeing:
+
*GRUB uses a zero indexed system of numbering drives and partitions, which is a different convention than you may be used to seeing:
  First disk, first partition = sda1 = hd0,0
+
  First disk, first partition=sda1=hd0,0
  First disk, second partition = sda2 = hd0,1
+
  First disk, second partition=sda2=hd0,1
  Second disk, first partition = sdb1 =hd1,0
+
  Second disk, first partition=sdb1=hd1,0
 +
}}
  
 
==Dual Booting from Multiple Hard Drives==
 
==Dual Booting from Multiple Hard Drives==
To dual boot from two separate hard drives (e.g. one dedicated Linux drive and one dedicated Windows drive) and Windows is not on the first hard drive, the Windows boot loader must be "tricked" into thinking Windows is on the first hard drive. Do this by adding the following lines to your menu.lst config file:
+
To dual boot from two separate hard drives (e.g., one dedicated Linux drive and one dedicated Windows drive) and Windows is not on the first hard drive, the Windows boot loader must be "tricked" into thinking Windows is on the first hard drive. Do this by adding the following lines to your menu.lst config file:
 
+
 
  map (hd0) (hd1)
 
  map (hd0) (hd1)
 
  map (hd1) (hd0)
 
  map (hd1) (hd0)
  
 
So the entry for Windows on second disk, first partition will look like this:
 
So the entry for Windows on second disk, first partition will look like this:
 
 
  title Microsoft Windows XP Professional
 
  title Microsoft Windows XP Professional
 
  root (hd1,0)
 
  root (hd1,0)
Line 68: Line 67:
 
More information on GRUB configuration can be found in [http://www.gnu.org/software/grub/manual/grub.html the GRUB manual].
 
More information on GRUB configuration can be found in [http://www.gnu.org/software/grub/manual/grub.html the GRUB manual].
  
==Other Layouts ==
+
==Other Layouts==
1. Actually you could just use:
+
1. You could use:
sda1 <-WinXP
+
:; sda1 : Windows XP
 
   
 
   
sda2 <-swap
+
:; sda2 : swap
 
   
 
   
sda3 <-/ (Arch)
+
:; sda3 : root
 
   
 
   
sda4 <-/home (optional)
+
:; sda4 : home
  
and not use an extended(logical) partition (as /boot will be in the /root portion as well).
+
and not use an extended partition (as /boot will be in the / partition as well).
  
2. LVM (Linux Volume Management) is also a possibility to use, it works fine with arch, you could simply create a single LVM partition and let it create the other partitions inside it. This allows a single partition to hold all your needed GNU/Linux stuff, also allows you to easily resize any of them if it becomes necessary.
+
2. LVM (Linux Volume Management) is also a possibility to use. You could simply create a single LVM partition and let it create the other partitions inside it. This allows a single partition to hold all your needed GNU/Linux data, and allows to easily partitions when necessary.
  
==Notes on /home ==
+
==Notes on /home==
You may not wish to store you documents on this mountpoint, especially if you wish to share data between both Windows and Arch Linux. Historically, this was done on a FAT partition because writing to NTFS was still experimental. [http://www.ntfs-3g.org/ NTFS-3G] now offers stable writing to NTFS partitions, so you can just leave this as another partition that will be shared by both Windows and arch. Another option would be to use some of the tools in Windows, such as [http://www.fs-driver.org/ fs-driver] and use an ext3 or ext2 partition to store documents (fs-driver will mount ext3 partitions as ext2, so you will not be able to take advantage of journaling while in Windows).
+
You may not wish to store you documents on this mountpoint, especially if you wish to share data between both Windows and Arch Linux. Historically, this was done on a FAT partition because writing to NTFS was still experimental. [http://www.ntfs-3g.org/ NTFS-3G] now offers stable writing to NTFS partitions, so you can just leave this as another partition that will be shared by both Windows and arch. Another option would be to use some of the tools in Windows, such as [http://www.fs-driver.org/ fs-driver] and use an ext3 or ext2 partition to store documents (fs-driver will mount ext3 partitions as ext2, so you will not be able to take advantage of journaling while in Windows).
  
==Other Options ==
+
==Using Windows boot-loader==
Another option is sort of the reverse of what is described at the beginning of this article where GRUB loads the Windows boot loader, which then loads Windows. Under this option, the Windows boot loader load GRUB, which then loads arch. For information on this method see http://www.geocities.com/epark/linux/grub-w2k-HOWTO.html. I do not believe there are any distinct advantages of this method over the previous one, you will still need a /boot partition, and this one is arguably more difficult to setup.
+
Another option is sort of the reverse of what is described at the beginning of this article where GRUB loads the Windows boot loader, which then loads Windows. Under this option, the Windows boot loader load GRUB, which then loads arch. For information on this method see http://www.geocities.com/epark/linux/grub-w2k-HOWTO.html. I do not believe there are any distinct advantages of this method over the previous one, you will still need a /boot partition, and this one is arguably more difficult to setup.

Revision as of 16:24, 13 November 2009

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end This is a simple article detailing different methods of Arch/Windows coexistence.

Windows and Arch Dual Booting

In this example, we will install Windows first, and subsequently install the GRUB bootloader along with Arch, allowing for dual boot.

Installation will be standard, but there are a few things to keep in mind:

1. You may have to use logical partitions for some of our partitions, because there can only be up to 4 primary partitions per disk.

2. Remember to write down your partitions numbers: "sda1, sda2... sda8", noting which type of partitions belong to their relevant number. For example:

sda1 
Windows - 30GB should be enough. Many new games exceed 10GB each so bear this in mind.
sda2 
/boot - 100MB is enough (optional)
sda3 
/ - about 10GB is appropiate
sda4
swap - between 1024MB and 1512MB (optional)
sda5
/home - use rest of hard drive (optional)

It is important to note that there is a 1024 cylinder limit with some older BIOSs. This means that the BIOS cannot access things beyond the 1024th cylinder (about 8.5GB), so the /boot partition should be in the first 8.5GB (space before Windows partition). GParted LiveCD or a partitioning tool in SystemRescueCd are useful for moving and resizing partitions to accommodate this.

3. When installing grub, you must configure /boot/grub/menu.lst), and make sure to install grub to /boot (or root (/) if you did not create a separate partition for /boot). There should be about three lines at the end of the file that speak about chainloading to boot other OSs, these can most generally be uncommented if you follow above convention, this would place windows boot point at hd0,0 or sda1. Thus you would have something akin to this:

# Windows XP
title Windows XP
rootnoverify (hd0,0)
chainloader +1

The parts of this entry break down as follows:

title Windows XP 
Can be anything you like, it will just be what is displayed in the grub bootup screen
rootnoverify (hd0,0) 
Remember the partition numbers we wrote down, here you write in the partition number of your windows partition. This sets the windows boot at root, even though GRUB cannot read it.
chainloader +1 
What this does is call the Windows boot loader that is still in MBR in our case, since GRUB cannot boot Windows itself.
Note:
Template error: are you trying to use the = sign? Visit Help:Template#Escape template-breaking characters for workarounds.

Dual Booting from Multiple Hard Drives

To dual boot from two separate hard drives (e.g., one dedicated Linux drive and one dedicated Windows drive) and Windows is not on the first hard drive, the Windows boot loader must be "tricked" into thinking Windows is on the first hard drive. Do this by adding the following lines to your menu.lst config file:

map (hd0) (hd1)
map (hd1) (hd0)

So the entry for Windows on second disk, first partition will look like this:

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

More information on GRUB configuration can be found in the GRUB manual.

Other Layouts

1. You could use:

sda1 
Windows XP
sda2 
swap
sda3 
root
sda4 
home

and not use an extended partition (as /boot will be in the / partition as well).

2. LVM (Linux Volume Management) is also a possibility to use. You could simply create a single LVM partition and let it create the other partitions inside it. This allows a single partition to hold all your needed GNU/Linux data, and allows to easily partitions when necessary.

Notes on /home

You may not wish to store you documents on this mountpoint, especially if you wish to share data between both Windows and Arch Linux. Historically, this was done on a FAT partition because writing to NTFS was still experimental. NTFS-3G now offers stable writing to NTFS partitions, so you can just leave this as another partition that will be shared by both Windows and arch. Another option would be to use some of the tools in Windows, such as fs-driver and use an ext3 or ext2 partition to store documents (fs-driver will mount ext3 partitions as ext2, so you will not be able to take advantage of journaling while in Windows).

Using Windows boot-loader

Another option is sort of the reverse of what is described at the beginning of this article where GRUB loads the Windows boot loader, which then loads Windows. Under this option, the Windows boot loader load GRUB, which then loads arch. For information on this method see http://www.geocities.com/epark/linux/grub-w2k-HOWTO.html. I do not believe there are any distinct advantages of this method over the previous one, you will still need a /boot partition, and this one is arguably more difficult to setup.