Prepare Arch Linux Live Disc
- Make a bootable installation media for Arch Linux
-
This laptop doesn’t have any CD/DVD drive so the first thing is to make a bootable USB drive.
Boot into Windows 10. In Windows, download archlinux iso from the following website
https://www.archlinux.org/download/
Use the mirror which is closest to you and download the Arch iso. archlinux-2015.12.01-dual.iso
Download Rufus from the following location https://rufus.akeo.ie/
Plugin any usb drive/pendrive in your usb port. Make sure that you backup data from this usb drive
- Attach it to your computer
Turn off Windows fast boot and secure boot, if not already [NOT needed to HDD upgrade]
- Shutdown Windows after disabling fast start following instruction here or here. And use the command shutdown -s -t 0 to do so.
-
Restart windows by clicking on Power -> Restart. Make sure that when hitting restart, you are press down Shift key Windows will give you options for Troubleshoot/Adanced Options/UEFI Firmware/
-
Once you restart your machine you should be able to see the BIOS settings.
Under Configuration you should disable Intel Fast boot, disable SecureBoot (more here). Make sure you change the settings for Graphics from Switchable to Internal. This is needed only to install, you can then modify it later. Save the changes and exit.
-
-
Once the machine restarts press and hold F12 key.
This will give you option to boot from various available devices and your USB drive would be one of them
- Select your USB drive to boot
-
Select the UEFI boot mode when you see the ArchLinux boot screen.
Once the usb has booted you will see the root prompt.
Connect to the internet (Wi-Fi), if you need to update or install some packages in chroot session
1 2 3 4 5 |
rfkill unblock wifi # I need to do this for Lenovo Ideapad $ iw dev # Get the interface name $ wifi-menu <wifi_interface_name> ping google.com # check internet |
Decrypt the root partition with LUKS Link
1 2 3 |
# cryptsetup open /dev/sdaX cryptroot # mount /dev/mapper/cryptroot /mnt |
where /dev/sdX is the disk (not a partition) where GRUB is to be installed. For example /dev/sda or /dev/nvme0n1, or /dev/mmcblk0
1 2 |
# mount /dev/sdaY /mnt/boot |
Find and mount the efi partition to /mnt/boot/efi
1 2 |
mount /dev/sda1 /mnt/boot/efi |
Arch and Grub Installation after chroot in.
-
chroot into the arch installation (from live CD).
12arch-chroot /mnt [/bin/bash] -
Install the bootloader – grub.
Note: This step should NOT be necessary.
Install the packages grub and efibootmgr. GRUB is the bootloader, efibootmgr creates bootable .efi stub entries used by the GRUB installation script.
12pacman -S grub
Generate the main configuration file
-
Make sure all partitions are mounted, i.e. / /boot /boot/efi
1234567891011121314151617mount -alsblk----------------------------------------------------NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 477G 0 disk├─sda1 8:1 0 260M 0 part /boot/efi├─sda2 8:2 0 16M 0 part├─sda3 8:3 0 234.2G 0 part├─sda4 8:4 0 25G 0 part├─sda5 8:5 0 1000M 0 part├─sda6 8:6 0 20.2G 0 part├─sda7 8:7 0 1000M 0 part├─sda8 8:8 0 200M 0 part /boot├─sda9 8:9 0 8G 0 part [SWAP]└─sda10 8:10 0 187.1G 0 part└─cryptroot 254:0 0 187.1G 0 crypt /
123456789101112131415nvme0n1 259:0 0 953.9G 0 disk├─nvme0n1p1 259:1 0 260M 0 part /boot/efi├─nvme0n1p2 259:2 0 16M 0 part├─nvme0n1p3 259:3 0 234.2G 0 part├─nvme0n1p4 259:4 0 25G 0 part├─nvme0n1p5 259:5 0 1000M 0 part├─nvme0n1p6 259:6 0 20.2G 0 part├─nvme0n1p7 259:7 0 1000M 0 part├─nvme0n1p8 259:8 0 200M 0 part /boot├─nvme0n1p9 259:9 0 8G 0 part [SWAP]├─nvme0n1p10 259:10 0 187.1G 0 part│ └─cryptroot 254:0 0 187.1G 0 crypt /└─nvme0n1p11 259:11 0 477G 0 part└─home-crypt 254:1 0 476.9G 0 crypt /home -
Intial Ramdisk Environment
12mkinitcpio -p linuxNote: Step 2-4 can be omitted, it does not hurt though. You can jump to step 5 configure grub.
Add the encrypt hook to mkinitcpio.conf: link here.
123etc/mkinitcpio.confHOOKS="... encrypt ... filesystems ..." -
update /etc/default/grub
1234GRUB_CMDLINE_LINUX_DEFAULT="i915.preliminary_hw_support=1"GRUB_ENABLE_CRYPTODISK=yGRUB_CMDLINE_LINUX="cryptdevice=UUID=1de833a9-36b8-4bab-91d6-65360080e71c:cryptroot root=/dev$ - install os-prober, only detect the correct Windows boot after boot into Linux, not from chroot with live CD.
-
configure grub
The following steps install the GRUB UEFI application to $esp/EFI/grub, install its modules to /boot/grub/x86_64-efi, and place the bootable grubx64.efi stub in $esp/EFI/grub.
First, tell GRUB to use UEFI, set the boot directory and set the bootloader ID. Mount the ESP partition to e.g. /boot or /boot/efi and in the following change $esp to that mount point (usually /boot):
12# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grubThe –bootloader-id is what appears in the boot options to identify the GRUB EFI boot option; make sure this is something you will recognize later. The install will create a directory of the same name under $esp/EFI/ where the EFI binary bootloader will be placed.
12grub-mkconfig -o /boot/grub/grub.cfg #Generate initial grub config.Now, let’s add Windows to the GRUB menu. Edit /boot/grub/grub.cfg and add the following menuentry after the Arch Linux menuentries [Note: grub boot loader does not locate Windows OS, but this is necessary for grub to load Arch Linux in my case. After I boot into arch linux, I ran sudo os-prober and update grub config.] See here for details.
1234567891011if [ "${grub_platform}" == "efi" ]; thenmenuentry "Microsoft Windows Vista/7/8/10 UEFI-GPT" {insmod part_gptinsmod fatinsmod search_fs_uuidinsmod chainsearch --fs-uuid --set=root $hints_string $fs_uuidchainloader /EFI/Microsoft/Boot/bootmgfw.efi}fiand update the string with following output:
$hints_string with the output of $ grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi. $fs_uuid with the output of $ grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi.
- Unmount and Reboot
1 2 3 4 |
exit umount -R /mnt reboot |
- Reboot into Arch Linux
-
Install os-prober. Regenerate grub configuration. Reboot.
123456pacman -Syu os-probersudo os-prober#/dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efigrub-mkconfig -o /boot/grub/grub.cfg #OR following is bettergrub-customizerDone! Now you can choose between Windows and Arch Linux at the start. Yay!
DEC
About the Author:
Beyond 8 hours - Computer, Sports, Family...