Before starting, make sure you have a backup, and make sure to have a linux live boot ready to rescue your system. It's easy to mess this up!
Use gdisk to convert the partition table to GPT.c
```
gdisk /dev/sda
```
Create the "BIOS boot" partition that GRUB needs.
n to create a new partition. Needs to be about 1MB. You can probably squeeze this in from sectors 34-2047. Use L or l to look up the code for "BIOS boot" (ef02).
Write the new partition table.
w
Reload the partition table.
partprobe /dev/sda
- Disable Windows Fast-Startup
- Disable Secure Boot
For Both Windows and Linux
Partition | Location | Size | File system |
---|---|---|---|
ESP | sda1 | 100 MB | vfat |
Root | sda2 | 50 GB | ext4 |
Home | sda3 | 500 GB | ext4 |
Windows 10 | sda4 | 500 GB | ntfs |
# wifi-menu
# ping -c 3 www.google.com
# mkfs.ext4 /dev/sdb1
# mkfs.ext4 /dev/sdb2
# mount /dev/sdb2 /mnt
# mkdir /mnt/boot
# mkdir /mnt/home
# mount /dev/sdb1 /mnt/boot
# mount /dev/sdb3 /mnt/home
$ mkdir /boot/efi
$ mount /dev/sda1 /boot/efi
/etc/pacman.conf file.
[multilib] Include = /etc/pacman.d/mirrorlist
# pacstrap /mnt base base-devel linux linux-firmware vim git networkmanager grub efibootmgr
# genfstab -U /mnt >> /mnt/etc/fstab
# arch-chroot /mnt
# ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
# hwclock --systohc
# nano /etc/locale.gen
uncomment en_US.UTF-8
# locale-gen
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8
# echo arch >> /etc/hostname
# nano /etc/hosts
/etc/hosts should look like:
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.1.1 arch.localdomain arch
# passwd
$ mkinitcpio -p linux
# bootctl --path=/boot install
Then add following content to /boot/loader/entries/arch.conf
tittle Arch
linux /vmlinuz-linux
initrd /initramfs-linux.img
initrd /intel-ucode.img
options root=/dev/sda6 rw
and following content to /boot/loader/loader.conf
timeout 5
default arch
Edit /etc/default/grub
, set DEFAULT_TIMEOUT=30
.
$ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck
$ pacman -S os-prober
$ os-prober
$ grub-mkconfig -o /boot/grub/grub.cfg
Now, let's add Windows to the GRUB menu. Edit /boot/grub/grub.cfg
and add the following menuentry after the Arch Linux menuentries:
menuentry "Windows 10" --class windows --class os {
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --fs-uuid --set=root $hints_string $fs_uuid
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
Now change:
-
$hints_string
by the output of$ grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
-
$fs_uuid
by the output of$ grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
# pacman -S iw wpa_supplicant dialog networkmanager
# pacman -S zsh reflector ntfs-3g
$ exit # If still on arch-chroot mode
$ umount -R /mnt
$ reboot