Difference between revisions of "Dual boot with Windows"

From ArchWiki
Jump to: navigation, search
(Windows and Arch Dual Booting: Link to more up to date page.)
m (use internal links when possible)
(19 intermediate revisions by 11 users not shown)
Line 1: Line 1:
 
[[Category:Boot process]]
 
[[Category:Boot process]]
 +
[[Category:Getting and installing Arch]]
 
[[ru:Windows and Arch Dual Boot]]
 
[[ru:Windows and Arch Dual Boot]]
 
[[sk:Windows and Arch Dual Boot]]
 
[[sk:Windows and Arch Dual Boot]]
 
This is a simple article detailing different methods of Arch/Windows coexistence.
 
This is a simple article detailing different methods of Arch/Windows coexistence.
  
{{Out of date|GRUB Legacy support has been dropped from Arch Linux:<br> https://www.archlinux.org/news/grub-legacy-no-longer-supported/}}
+
== Potential Data Loss ==
  
== Partition ==
+
=== Renaming Files on NTFS partitions ===
There are two part:
+
* Windows Partition - 30 GB should be enough. Many new games exceed 10GB each so bear this in mind.
+
* Arch Linux partition - There are Single root partition and Discrete partitions. See [[Partitioning]].
+
  
In this article, the example partitions are:
+
Windows is limited to filepaths being shorter than [http://blogs.msdn.com/b/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx 260 characters].
* sda1 : {{ic|Windows}}
+
* sda2 : {{ic|/boot}}
+
* sda3 : {{ic|/}}
+
* sda5: {{ic|swap}}
+
* sda6: {{ic|/home}}
+
  
==Windows and Arch Dual Booting==
+
Windows also puts [http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#naming_conventions certain characters off limits] in filenames for reasons that run all the way back to DOS:
See [[Grub#Dual-booting]].
+
  
==Dual Booting from Multiple Hard Drives==
+
* < (less than)
To dual boot from two separate hard drives (e.g., one dedicated Linux drive and one dedicated Windows drive).
+
* > (greater than)
 +
* : (colon)
 +
* " (double quote)
 +
* / (forward slash)
 +
* \ (backslash)
 +
* | (vertical bar or pipe)
 +
* ? (question mark)
 +
* * (asterisk)
  
=== Windows + Arch ===
+
These are limitations of Windows and not NTFS: any other OS using the NTFS partition will be fine. Windows will fail to detect these files and running {{ic|chkdsk}} will most likely cause them to be deleted.
  
You have Windows installed on the first hard drive and you want to install Arch on the second one.
+
=== Fast Start-Up ===
Follow this procedure :
+
  
# Unplug the Windows hard drive (this is not needed if you are sure you know which drive have the Windows on it and which one is supposed to receive Arch. But this way you are sure you won't do any mistake)
+
Fast Start-Up is a feature in Windows 8 that hibernates the computer rather than actually shutting it down to speed up boot times. Your system can lose data if Windows hibernates and you dual boot into another OS and make changes to files.
# Install Arch on the second hard drive (that has become the first if you have unplug the Windows one)
+
# Be sure to install GRUB on the MBR on the Arch drive (I didn't test with syslinux but it should work too).
+
# At the end of the process you should be able to boot on Arch but not on Windows (the disk is unplug and even if not, GRUB doesn't know how to boot Windows... Yet !)
+
# Log in on Arch
+
#Edit /boot/grub/menu.lst (that needs root access),At the end add :
+
(2) Windows
+
title Seven
+
rootnoverify (hd0,0)
+
makeactive
+
chainloader +1
+
I use '(2)' because '(0)' and '(1)' are already used by Arch.  
+
  
If you want Windows to be loaded by default (the happy wife, happy life way !)
+
[http://sourceforge.net/p/ntfs-3g/ntfs-3g/ci/559270a8f67c77a7ce51246c23d2b2837bcff0c9/ NTFS-3G added a safe-guard] to prevent read-write mounting of hibernated disks, but the NTFS driver within the Linux kernel has no such safeguard.
Change the 'default' value by the one used for declaring Windows just before (here it is '2').
+
Ex :
+
# general configuration:
+
timeout  8
+
default  2
+
  
7/halt your computer and plug-in the Windows drive
+
== BIOS Systems ==
  
8/Restart the computer.
+
=== Using a Linux boot loader ===
You should see the GRUB menu proposing Arch and Windows. Select the one you want et voila !
+
  
=== Arch + Windows ===
+
You may use [[GRUB#Dual-booting|GRUB]] or [[Syslinux#Chainloading|Syslinux]].
  
If 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:
+
=== Using Windows boot loader ===
map (hd0) (hd1)
+
map (hd1) (hd0)
+
  
So the entry for Windows on second disk, first partition will look like this:
+
With this setup the Windows bootloader loads GRUB which then boots Arch.
title Microsoft Windows XP Professional
+
root (hd1,0)
+
savedefault
+
makeactive
+
map (hd0) (hd1)
+
map (hd1) (hd0)
+
chainloader +1
+
  
Or if the above configuration doesn't work, you might try the one below from the Arch Wiki GRUB page:
+
==== Windows 7/8 boot loader ====
title Windows
+
map (hd0) (hd1)
+
map (hd1) (hd0)
+
rootnoverify (hd1,0)
+
makeactive #if you use Windows7 this line should be commented out
+
chainloader +1
+
  
More information on GRUB configuration can be found in [http://www.gnu.org/software/grub/manual/grub.html the GRUB manual].
+
The following section contains excerpts from http://www.iceflatline.com/2009/09/how-to-dual-boot-windows-7-and-linux-using-bcdedit/.
  
==Using Windows boot-loader==
+
The remainder of the setup is similar to a typical installation. Some documents state that the partition being loaded by the Windows boot loader must be a primary partition but I have used this without problem on an extended partition.
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.  
+
  
===Using Windows 7/8 Boot-Loader===
+
* When installing the GRUB boot loader, install it on your {{ic|/boot}} partition rather than the MBR. {{Note|For instance, my {{ic|/boot}} partition is {{ic|/dev/sda5}}. So I installed GRUB at {{ic|/dev/sda5}} instead of {{ic|/dev/sda}}. For help on doing this, see [[GRUB#Install to partition or partitionless disk]]}}
Excerpted from http://www.iceflatline.com/2009/09/how-to-dual-boot-windows-7-and-linux-using-bcdedit/
+
  
In order to have the Windows boot-loader see the linux partition, one of the linux partitions created needs to be FAT32 (in this case, /dev/sda3). The remainder of the setup is similar to a typical installation. Some documents state that the partition being loaded by the Win boot-loader must be a primary partition but I have used this without problem on an extended partition.
+
* Under Linux make a copy of the boot info by typing the following at the command shell:
  
*When installing the grub bootloader, install it on your '''/boot''' partition rather than the MBR. {{Note| For instance, my '''/boot''' partition is '''/dev/sda5'''. So I installed grub at '''/dev/sda5''' instead of '''/dev/sda''' <br>  For help on doing this, see [[Grub#Install to Partition or Partitionless Disk]]}}
+
my_windows_part=/dev/sda3
 +
my_boot_part=/dev/sda5
 +
mkdir /media/win
 +
mount $my_windows_part /media/win
 +
dd if=$my_boot_part of=/media/win/linux.bin bs=512 count=1
  
*Under linux make a copy of the boot info by typing the following at the command shell:
+
* Boot to Windows and open up and you should be able to see the FAT32 partition. Copy the linux.bin file to {{ic|C:\}}. Now run '''cmd''' with administrator privileges (navigate to ''Start > All Programs > Accessories'', right-click on ''Command Prompt'' and select ''Run as administrator''):
<pre>
+
my_windows_part=/dev/sda3
+
my_boot_part=/dev/sda5
+
mkdir /media/win
+
mount $my_windows_part /media/win
+
dd if=$my_boot_part of=/media/win/linux.bin bs=512 count=1
+
</pre>
+
*Boot to windows and open up and you should be able to see the FAT32 partition. Copy the linux.bin file to C:\. Now run '''cmd''' with administrator privileges (navigate to Start->All Programs->Accessories, Right-click on Command Prompt and select “Run as administrator.”)
+
<pre>
+
bcdedit /create /d “Linux” /application BOOTSECTOR
+
</pre>
+
*BCDEdit will return an alphanumeric identifier for this entry that I will refer to as {ID} in the remaining steps. You’ll need to replace {ID} by the actual returned identifier. An example of {ID} is {d7294d4e-9837-11de-99ac-f3f3a79e3e93}.
+
<pre>
+
bcdedit /set {ID} device partition=c:
+
bcdedit /set {ID}  path \linux.bin
+
bcdedit /displayorder {ID} /addlast
+
bcdedit /timeout 30
+
</pre>
+
  
Done! Reboot and enjoy. In my case I'm using the Win bootloader so that I can map my Dell Precision M4500's second power button to boot linux instead of windows.
+
bcdedit /create /d “Linux” /application BOOTSECTOR
  
===Using Windows 2000/XP Bootloader===
+
* BCDEdit will return an alphanumeric identifier for this entry that I will refer to as {ID} in the remaining steps. You’ll need to replace {ID} by the actual returned identifier. An example of {ID} is {d7294d4e-9837-11de-99ac-f3f3a79e3e93}.
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 Linux bootloader; you will still need a {{ic|/boot}} partition, and this one is arguably more difficult to set up.
+
 
 +
bcdedit /set {ID} device partition=c:
 +
bcdedit /set {ID}  path \linux.bin
 +
bcdedit /displayorder {ID} /addlast
 +
bcdedit /timeout 30
 +
 
 +
Reboot and enjoy. In my case I'm using the Windows boot loader so that I can map my Dell Precision M4500's second power button to boot Linux instead of Windows.
 +
 
 +
==== Windows 2000/XP boot loader ====
 +
 
 +
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 Linux boot loader; you will still need a {{ic|/boot}} partition, and this one is arguably more difficult to set up.
 +
 
 +
== UEFI Systems ==
 +
 
 +
Both [[Gummiboot]] and [[UEFI_Bootloaders#Using_rEFInd|rEFInd]] autodetect '''Windows Boot Manager''' {{ic|\EFI\Microsoft\Boot\bootmgfw.efi}} and show it in their boot menu, so there is no manual config required.
 +
 
 +
For [[GRUB]](2) follow [[GRUB#Windows_Installed_in_UEFI-GPT_Mode_menu_entry]].
 +
 
 +
Syslinux (as of version 6.01) and ELILO do not support chainloading other EFI applications, so they cannot be used to chainload {{ic|\EFI\Microsoft\Boot\bootmgfw.efi}} .
  
 
== See also ==
 
== See also ==
[https://bbs.archlinux.org/viewtopic.php?id=140049 Booting Windows from a desktop shortcut]
+
 
 +
* [https://bbs.archlinux.org/viewtopic.php?id=140049 Booting Windows from a desktop shortcut]
 +
* [[time#UTC_in_Windows|UTC in Windows]]

Revision as of 22:18, 23 January 2014

This is a simple article detailing different methods of Arch/Windows coexistence.

Potential Data Loss

Renaming Files on NTFS partitions

Windows is limited to filepaths being shorter than 260 characters.

Windows also puts certain characters off limits in filenames for reasons that run all the way back to DOS:

  • < (less than)
  • > (greater than)
  •  : (colon)
  • " (double quote)
  • / (forward slash)
  • \ (backslash)
  • | (vertical bar or pipe)
  •  ? (question mark)
  • * (asterisk)

These are limitations of Windows and not NTFS: any other OS using the NTFS partition will be fine. Windows will fail to detect these files and running chkdsk will most likely cause them to be deleted.

Fast Start-Up

Fast Start-Up is a feature in Windows 8 that hibernates the computer rather than actually shutting it down to speed up boot times. Your system can lose data if Windows hibernates and you dual boot into another OS and make changes to files.

NTFS-3G added a safe-guard to prevent read-write mounting of hibernated disks, but the NTFS driver within the Linux kernel has no such safeguard.

BIOS Systems

Using a Linux boot loader

You may use GRUB or Syslinux.

Using Windows boot loader

With this setup the Windows bootloader loads GRUB which then boots Arch.

Windows 7/8 boot loader

The following section contains excerpts from http://www.iceflatline.com/2009/09/how-to-dual-boot-windows-7-and-linux-using-bcdedit/.

The remainder of the setup is similar to a typical installation. Some documents state that the partition being loaded by the Windows boot loader must be a primary partition but I have used this without problem on an extended partition.

  • When installing the GRUB boot loader, install it on your /boot partition rather than the MBR.
    Note: For instance, my /boot partition is /dev/sda5. So I installed GRUB at /dev/sda5 instead of /dev/sda. For help on doing this, see GRUB#Install to partition or partitionless disk
  • Under Linux make a copy of the boot info by typing the following at the command shell:
my_windows_part=/dev/sda3
my_boot_part=/dev/sda5
mkdir /media/win
mount $my_windows_part /media/win
dd if=$my_boot_part of=/media/win/linux.bin bs=512 count=1
  • Boot to Windows and open up and you should be able to see the FAT32 partition. Copy the linux.bin file to C:\. Now run cmd with administrator privileges (navigate to Start > All Programs > Accessories, right-click on Command Prompt and select Run as administrator):
bcdedit /create /d “Linux” /application BOOTSECTOR
  • BCDEdit will return an alphanumeric identifier for this entry that I will refer to as {ID} in the remaining steps. You’ll need to replace {ID} by the actual returned identifier. An example of {ID} is {d7294d4e-9837-11de-99ac-f3f3a79e3e93}.
bcdedit /set {ID} device partition=c:
bcdedit /set {ID}  path \linux.bin
bcdedit /displayorder {ID} /addlast
bcdedit /timeout 30

Reboot and enjoy. In my case I'm using the Windows boot loader so that I can map my Dell Precision M4500's second power button to boot Linux instead of Windows.

Windows 2000/XP boot loader

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 Linux boot loader; you will still need a /boot partition, and this one is arguably more difficult to set up.

UEFI Systems

Both Gummiboot and rEFInd autodetect Windows Boot Manager \EFI\Microsoft\Boot\bootmgfw.efi and show it in their boot menu, so there is no manual config required.

For GRUB(2) follow GRUB#Windows_Installed_in_UEFI-GPT_Mode_menu_entry.

Syslinux (as of version 6.01) and ELILO do not support chainloading other EFI applications, so they cannot be used to chainload \EFI\Microsoft\Boot\bootmgfw.efi .

See also