Difference between revisions of "Dual boot with Windows (简体中文)"

From ArchWiki
Jump to: navigation, search
(Create page.)
 
(Create page.)
Line 1: Line 1:
 
[[Category:Boot process (简体中文)]]
 
[[Category:Boot process (简体中文)]]
 
[[Category:Getting and installing Arch (简体中文)]]
 
[[Category:Getting and installing Arch (简体中文)]]
 +
[[en:Windows and Arch Dual Boot]]
 
[[ru:Windows and Arch Dual Boot]]
 
[[ru:Windows and Arch Dual Boot]]
 
[[sk:Windows and Arch Dual Boot]]
 
[[sk:Windows and Arch Dual Boot]]
[[zh-cn: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.
  

Revision as of 14:06, 2 April 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. Even if you don't intend to share filesystems, the EFI System Partition is likely to be damaged on an EFI system. Therefore, you should disable Fast Startup, as described here, before you install Linux on any computer that uses Windows 8.

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.

Installation

The recommended way to setup a Linux/Windows dual booting system is to first install Windows, only using part of the disk for its partitions. When you have finished the Windows setup, boot into the Linux install environment where you can create additional partitions for Linux while leaving the existing Windows partitions untouched.

Some newer computers come pre-installed with Windows 8 which will be using Secure Boot. Arch Linux currently does not support Secure Boot, but some Windows 8 installations have been seen not to boot if Secure Boot is turned off in the BIOS. In some cases it is necessary to turn off both Secure Boot as well as Fastboot in the BIOS options in order to allow Windows 8 to boot without Secure Boot. However there are potential security risks in turning off Secure Boot for booting up Windows 8. Therefore, it may be a better option to keep the Windows 8 install intact and have an independent hard drive for the Linux install - which can then be partitioned from scratch using a GPT partition table. Once that is done, creating several ext4/FAT32/swap partitions on the second drive may be a better way forward if the computer has two drives available. This is often not easy or possible on a small laptop. Currently, Secure Boot is still not in a fully stable state for reliable operation, even for Linux distributions that support it.

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 .

Computers that come with newer versions of Windows often have secure boot enabled. You will need to take extra steps to either disable secure boot or to make your installation media compatible with secure boot.

时间标准

  • 建议:将 Arch Linux 和 Windows 皆设置为UTC。需要修改Windows注册表。另:记得关闭Windows的在线时间校准以防硬件时间被设为localtime。若需同步网络时间(NTP sync),请在Arch Linux上安装ntpd
  • 不建议:将Arch Linux的硬件时钟模式设为localtime并禁用任何时钟同步服务(如ntpd.service)。这将会使Windows检查硬件时间的正确性,并且你需要在一年中至少启动Windows两次(分别在春季与秋季)以正确应用夏令时。So please don't ask on the forums why the clock is one hour behind or ahead if you usually go for days or weeks without booting into Windows(所以请不要忘记启动Windows而在论坛问为什麼时钟会快/慢一个小时)。}}

See also