Before
-
Check the hardware, three disks on my Lenovo ThinkPad P50
-
Samsung SSD 970 EVO Plus 250GB for installing windows
-
Samsung SSD 960 EVO 250GB for installling archlinux
-
WDC WD5000LPLX-0 HHD 500GB for data storage
-
-
Disable Windows Fast Startup if start from windows
-
Disable UEFI Secure Boot. (Arch Linux install media does not support Secure Boot.)
-
Windows UEFI vs BIOS limitations. (In case where Windows and Linux dual boot from the same disk, it is advisable to follow the method used by Windows, ie. either go for UEFI/GPT boot or BIOS/MBR boot. )
-
Bootloader UEFI vs BIOS limitations. (Most of the linux bootloaders installed for one firmware type cannot launch or chainload bootloaders of the other firmware type. If Arch and Windows are dual-booting from same disk, then Arch should follow the same firmware boot mode and partitioning combination used by the installed Windows in the disk.)
Windows 10 Installation
create an windows Installer USB drive using rufus
-
In GNU/Linux
make a bootable USB on windows in VirtualBox
-
In Windows
Using Rufus directly
Boot the live environment, F12
install in windows 10 install Samsung SSD 970 EVO Plus 250GB
Arch Linux Installation
Download the last iso of Arch Linux
Create an Arch Linux live USB using rufus
Boot the live environment
Pointing the current boot device to a drive containing the Arch installation media is typically achieved by pressing a key during the POST phase.
When the Arch menu appears, select Boot Arch Linux and press Enter to enter the installation environment.
Set the keyboard layout and Console fonts
If you have the 4K display, console fonts will be extremely small.
|
|
Verify the boot mode
|
|
Connect to the internet
|
|
Update the system clock
|
|
Partition the disks
When recognized by the live system, disks are assigned to a block device such as /dev/sda or /dev/nvme1n1.
|
|
Results ending in rom, loop or airoot may be ignored.
|
|
| UEFI with GPT | ||||
|---|---|---|---|---|
| Mount point | Partition | | Suggested size
| | |
/mnt/boot or /mnt/efi
|
/dev/sdX1
|
EFI system partition | 260–512 MiB | |
/mnt
|
/dev/sdX2
|
Linux x86-64 root (/) | Remainder of the device | |
| [SWAP] | /dev/sdX3
|
Linux swap | More than 512 MiB | |
Swap
On average desktop machines with up to 512 MiB RAM, the 2× rule is usually adequate; if a sufficient amount of RAM (more than 1024 MiB) is available, it may be possible to have a smaller swap partition.
To use hibernation (a.k.a suspend to disk) it is advised to create the swap partition at the size of RAM.
Create a partition table and partitions
|
|
Create new table
To create a new GUID Partition Table and clear all current partition data, type o at the prompt. Skip this step if the table you require has already been created.
Create partitions
Create a new partition with the n command. You must enter the partition number, first sector, last sector and the partition type.
Partition number
A partition number is the number assigned to a partition, e.g. a partition with number 1 on a disk /dev/sda would be /dev/sda1.
First and last sector
relative terms by preceding the size with +size or -size. E.g. +2G to specify a point 2 GiB after the default start sector, or -200M to specify a point 200 MiB before the last available sector.
Partition type
The default, Linux filesystem (GUID 0FC63DAF-8483-4772-8E79-3D69D8477DE4, gdisk’s internal code 8300), should be fine for most use cases.
|
|
|
|
Format the partitions
an EFI system partition must contain a FAT32 file system
Note: mkfs.vfat is a symlink to mkfs.fat, they are the same utility.
|
|
If you created a partition for swap, initialize it with mkswap:
|
|
the root partition will contain the ext4 file system
|
|
Mount the file systems
The simplest scenarios for mounting EFI system partition are:
- mount ESP to
/efiand use a boot loader which is capable of accessing the kernel(s) and initramfs image(s) that are stored elsewhere (typically/boot). - mount ESP to
/boot. This is the preferred method when directly booting a EFISTUB kernel from UEFI.
Tip: /efi is a replacement for the previously popular (and possibly still used by other Linux distributions) ESP mountpoint /boot/efi.
Mount the file system on the root partition to /mnt:
|
|
|
|
|
|
Select the mirrors
|
|
The higher a mirror is placed in the list, the more priority it is given when downloading a package. You may want to edit the file accordingly, and move the geographically closest mirrors to the top of the list, although other criteria should be taken into account.
This file will later be copied to the new system by pacstrap, so it is worth getting right.
Install essential packages
|
|
Configure the Linux system
Fstab
Generate an fstab file:
|
|
Check the resulting /mnt/etc/fstab file, and edit it in case of errors.
|
|
Chroot
Change root into the new system:
|
|
Time zone
|
|
Localization
Uncomment en_US.UTF-8 UTF-8 and zh_CN.UTF-8 UTF-8 locales in /etc/locale.gen, and generate them with:
|
|
Create the locale.conf file, and set the LANG variable accordingly:
|
|
|
|
If you set the keyboard layout, make the changes persistent in vconsole.conf:
|
|
|
|
Network configuration
Create the hostname file:
|
|
|
|
Add matching entries to hosts:
|
|
|
|
If the system has a permanent IP address, it should be used instead of 127.0.1.1.
|
|
|
|
Root password
Set the root password:
|
|
# Represents executing commands as Root users, $ Represents executing commands as ordinary users
Add a new user
|
|
Install sudo
|
|
|
|
Boot loader for UEFI systems
Detecting other operating systems
To have grub-mkconfig search for other installed systems and automatically add them to the menu, install the os-prober and ntfs-3g package and mount the partitions that contain the other systems. Then re-run grub-mkconfig.
|
|
microcode updates
Choose and install a Linux-capable boot loader. If you have an Intel or AMD CPU, enable microcode updates in addition.
|
|
install a Linux-capable boot loader
|
|
EFI directory must be EPS mount point.
Choose a bootloader identifier, here named GRUB. A directory of that name will be created in /efi/EFI/ to store the EFI binary and this is the name that will appear in the UEFI boot menu to identify the GRUB boot entry.
Execute the following command to install the GRUB EFI application grubx64.efi to /efi/EFI/GRUB/ and install its modules to /boot/grub/x86_64-efi/.
|
|
|
|
Check
|
|
checks it for syntax errors, and entry point in menuentry menu.
Reboot
Exit the chroot environment by typing exit or pressing Ctrl+d.
|
|
Optionally manually unmount all the partitions with umount -R /mnt: this allows noticing any “busy” partitions, and finding the cause with fuser.
Finally, restart the machine by typing reboot: any partitions still mounted will be automatically unmounted by systemd. Remember to remove the installation media and then login into the new system with the root account.