I have recently spent quite a while trying to get a dual boot system with Windows 8 Pro 64 bit edition and Arch Linux 64 bit edition on my UEFI system. Hopefully this guide will provide you with all the information you need to get up and running.
In this tutorial I assume that you have two hard drives. One for Arch and one for Windows 8 and that you are planning on using LVM for the Arch drive. Furthermore I’ll assume that /dev/sda is the Windows 8 drive and /dev/sdb is the Arch Linux drive. If this is not the case then change the commands as appropriate.
First of all you must install Windows 8. This is simple and I will not go into how to do this. Once it is installed follow the following instructions:
You’ll need to partition your drive for use with Arch Linux. I personally used the GParted Live CD as it was the easiest method available and does the job well. You can download the ISO from the gParted website. Then just burn it to a CD. Boot from the CD, partition the drive you wish to install Arch Linux on by first creating a GPT partition table on the drive and then creating a single LVM2 partition that takes up all the space on the drive. Do NOT create a UEFI SYSTEM PARTITION. We will be using the default Windows 8 UEFI SYSTEM PARTITION to save on space and to reduce the difficulty of the install. We will create the LVM partitions when we are installing Arch Linux later on.
Reboot your computer.
Download the latest Arch Linux ISO from the Arch Linux website (at the time of writing the latest ISO image was 2012.11.01 - although I am sure that these installation instructions will work with future installation images) and then burn that to a CD. Boot your computer from the CD you just made.
modprobe efivars
efibootmgr -v
If the commands above display an error then you have not booted your computer in UEFI mode. Doing so is out of the scope of this article. Either you do not have a UEFI motherboard or you have misconfigured something. Find out how to correct the issue and then follow the rest of this guide. If no error is shown then the final command should have listed the current UEFI boot options (which on my computer displayed Windows 8 and the Arch Linux CD).
Now we create our LVM volumes:
pvcreate /dev/sdb1
vgcreate VolGroup00 /dev/sdb1
lvcreate -C y -L 8G VolGroup00 -n lv_swap
lvcreate -L 10G VolGroup00 -n lv_var
lvcreate -L 50G VolGroup00 -n lv_root
lvcreate -L 100G VolGroup00 -n lv_home
this creates an 8GB swap partition, a 10GB /var partition, a 50GB / partition and a 100GB /home partition. Obviously you are free to change these sizes to suit your particular requirements.
Now lets format and mount the drives.
mkswap /dev/VolGroup00/lv_swap
swapon /dev/VolGroup00/lv_swap
mkfs.ext4 /dev/VolGroup00/lv_root
mkfs.ext4 /dev/VolGroup00/lv_var
mkfs.ext4 /dev/VolGroup00/lv_home
mount /dev/VolGroup00/lv_root /mnt
cd /mnt
mkdir home
mkdir var
mkdir -p boot/efi
cd ~
mount /dev/VolGroup00/lv_home /mnt/home
mount /dev/VolGroup00/lv_var /mnt/var
mount /dev/sda1 /mnt/boot/efi
Now that the file system has been sorted we can start the installation procedure.
pacstrap /mnt base
This will install the basic requirements for Arch Linux. You can also add base-devel if you wish although I opted to do that later once I had a working system. It is not required for any part of this article.
Now generate the fstab file.
genfstab -p /mnt >> /mnt/etc/fstab
If you leave the fstab file as it is you will get an error saying something like:
Unrecognized mount option "codepage=cp437" or missing value
to fix this edit the fstab file and look for the line which has (this is the line for the vfat partition /dev/sda1):
codepage=cp437
and change it to:
codepage=437
Now we simply chroot into our install so we can finish up the installation:
arch-chroot /mnt
install the bootloader (I am using Grub2):
pacman -S grub-efi-x86_64
Now you just need to follow the installation guide found here until you reach the section about mkinitcpio.conf. Once you hit that part return here and we will proceed.
Now you need to edit /etc/mkinitcpio.conf.
Add the following entries to the MODULE section:
vfat ext4 dm-mod
and add the following entries to the HOOKS section:
keymap lvm2
IMPORTANT: It is vital that the lvm2 entry comes before the filesystem entry, otherwise your system will not boot.
Now run:
mkinitcpio -p linux
and
passwd
to set the root password.
Finally we just need to configure the bootloader:
modprobe dm-mod
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo
You’ll need to get the hints_string value and the fs_uuid value for the next part. Find out the correct value by using the following two commands:
grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
and finally we just need to edit /etc/grub.d/40-custom to add the correct settings for booting Windows 8 (make sure you include the result of the above two commands in the correct place):
menuentry "Windows 8" {
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --fs-uuid --no-floppy --set=root <hints_string_value> <fs_uuid_value>
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
then create the Grub2 configuration file:
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg
Unmount the file systems:
umount /mnt/{boot/efi,home,var,}
and reboot! You now have a fully working dual boot Arch Linux and Windows 8 system. Enjoy!
Comments !