Replacing Windows 10 with Archlinux, UEFI mode.
Hi,
I'm used to installing Arch Linux in Bios mode, but I'm about to get a new laptop that comes with Windows 10 preinstalled on it, so I guess it's in UEFI mode. The idea is to replace W10 with Arch.
What are the necessary steps ? I know UEFI needs an EFI (or ESP) partition, can I use the one that already exists with Windows ? Can I just format the Windows partition and create my Arch partitions on it and voila ? Should I stick with Grub as the bootloader or is there something better for UEFI ? Thanks !
About this post
- Posted
- Archived
- Score
- 58 · 100% up
- Kind
- Text
- ID
- ajnt57
35 comments
All modern Windows 10 machines come with their hard disk formated using 'GUID Partition Table' (GPT), which is a pre-requisite for UEFI boot.
Yes, you can use the EFI System partition that already exists.
And yes, you could simple change the partition type of the Windows 10 partition from 'Basic Data Partition' to 'Linux filesystem data'.
Most likely there will also be a 'Windows Recovery Environment' partition on the hard disk though, which you don't need for Linux.
For EFI boot, there is absolutely no need to mess around with GRUB (or any bootloader at all).
I personally prefer systemd-boot, because it's quick and simple to set up.
Other people tend to forgo a bootloader altogether and opt for 'EFI Stub' booting.
+1 for systemd-boot. I'm dual booting windows and Arch on and nvme SSD and systemd boots just disgustingly fast.
Thanks for the clear explanations ! Changing the partition type of the Windows 10 partition from 'Basic Data Partition' to 'Linux filesystem data' simply means formatting it from NTFS to Ext4, right ?
Changing partition type and formatting the portion are actually two different steps.
Changing the partition type is something that is done with a partition manager like
fdiskor preferablygdiskfor GPT partitions.Formatting a partition is done with the good old
mkfs.ext4.Disable secure boot in the bios and you should be good following the instructions.
Format your drive with GPT scheme and make one ~200MB EFI partition and the remaining size for the EXT4 root partition accompanied by a EXT4 home partition if you wish to. Also using a swap file is better than using a swap partition imo.
Thanks ! So basically I wipe everything, and I recreate an EFI partition instead of using the one coming with Windows. And then I create my partitions as I would do in Bios mode.
You could use the existing EFI partition from the Windows installation, but starting from scratch helps troubleshooting in the future. I hope you get my point.
Yes. Though not necessary, it's a good idea to really start from the beginning as if you had a brand new disk. I'd strongly recommend encrypting it, though with a larger drive writing random data to fill it up can take a while.
Format your disk as GPT. I used rEFInd, which basically runs by itself.
But if there is already Windows on it, wouldn't it already be in GPT ?
In most cases, yes.
That won't cause any issues. Just fdisk your main drive, the press 'm'. The help output will show you want to press to format it in GPT.
check to make sure. if it isnt in GPT, microsoft has a tool on their site for converting between Bios/GPT
I use EFI without a bootloader, or rather with the kernel's builtin efistub. Good if Arch is going to be the only OS.
Efistub was my solution as well for running Arch alone. Who needs a bootloader anyway when efi is one. :D
Glorious Eggroll has pretty good UEFI arch install guide using bootctl
I agree!
Installing Arch in UEFI mode is very similar to legacy mode. The only differences are: you need a separate FAT32 boot partition and the bootloader of your choice must be EFI bootable (GRUB is UEFI compatible) .
I use rEFInd. Easy to install reading the wiki and it's really customizable.
Here is how to do it
https://www.rodsbooks.com/refind/themes.html
Arch makes it easy to put your /boot files inside the ESP. Other distributions insist on separate partitions, resulting in your loader going under /boot/efi/efi (or some other absurd path).
Oh, and don't bother with GRUB. Use rEFInd if you want a fancy loader, systemd-boot if you want a minimal loader, or efistub if you want it to go straight to the OS.
Just be carefull that some laptops have discustingly bad UEFI implementations, because the standart is not strictly enforced. It can litterally make you crazy.
The archwiki has some troubleshooting steps, usually bad implementations only look for certain names in a specific path in the EFI partition, and only read the EFI partition at a specific place on the disk.
Reusing the same EFI scheme as windows is good.
I think it's recommended somewhere to use 500 MB for efi partition. I think it must be taking into account around 75MB per linux distribution + Windows + buffer.
Now, I took the easy way out by just getting a different MVMe drive for Arch to live on...and I don’t have my machine in front of me, but here’s my configuration iirc:
The LVM part is where
/,/Home, andswaplive.I went with rEFInd as a boot loader, but otherwise the installation is exactly the same as any other install—the wiki worked for me just fine.
Tbh, I’d recommend just reformatting the drive and going from there, if you’re not interested in retaining the windows install (tho the product key is still embedded).
Oh, and you should still disable secure boot unless you wanna fight with that.
A little update : I got my new laptop, I tried to install Arch as usual, I kept the existing ESP partition, and used the refind script "refind-install" ; it seemed to install without error, but I can only reboot to a rootfs ! What did I do wrong ?
My refind_linux.conf file is as follow, I don't know if it's normal :
"Boot with standard options" "archisobasedir=arch archisolabel=ARCH_201901"
"Boot to single user mode" "archisobasedir=arch archisolabel=ARCH_201901 single"
"Boot with minimal options" "ro root=UUID=bfbffb2e-37f3-48dd-a845-76a7123d7d32""
Any suggestion ?
GRUB is sometimes not friends with EFI. I advise system-boot. The rest you correctly prompted
You can keep Grub, but do not install it as if it is for a BIOS tho (https://wiki.archlinux.org/index.php/GRUB#UEFI_systems). And yes, I think you can simply wipe windows and install Arch
!remindme 3 days
Deleted before we saved it.
Deleted before we saved it.
There is no need to enable legacy mode if he's using UEFI boot.
Hey just noticed.. it's your 1st Cakeday ognefdi! hug
UEFI is such a pain in the ass. If your laptop supports it, go legacy, and disable secure boot.
My new laptop runs so much better without running in UEFI mode, and I don't plan on dual booting or using disks >2TB anyway.
It's not a pain in the ass if you follow the instructions on the wiki.