判定为UEFI设备

Surface Pro 2017

连接WIFI

wifi-menu

设置时间同步

timedatectl set-ntp true

设置分区

fdisk /dev/nvme0n1

（以实际情况为主fdisk -l查看）

EFI分区64M 建议：260–512 MiB（大概只能用到6M多一点不到7M）

/主分区剩下全部

fdisk: Create a partition with partition type EFI System.

mkfs.ext4 /dev/nvme0n1p2

SWAP最后再用文件设置，可见我的另一篇博客

mount /dev/nvme0n1p2 /mnt

（挂载目录随意）

mount /dev/nvme0n1p1 /mnt/efi

(目录随意大小写随意，最后只需在Grub里面设置即可)

安装

nano /etc/pacman.d/mirrorlist

Server = http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
[archlinuxcn]
Server = http://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch 或者 Server = http://mirrors.aliyun.com/archlinux/$repo/os/$arch [archlinuxcn] Server = http://mirrors.aliyun.com/archlinuxcn/$arch

Server = http://mirrors.zju.edu.cn/archlinux/$repo/os/$arch
[archlinuxcn]
Server = http://mirrors.zju.edu.cn/archlinuxcn/\$arch

Ctrl+O保存

Ctrl+X退出

1

perl: warning: Setting locale failed.

LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

nano /root/.bashrc

export LC_ALL=C

echo "export LC_ALL=C" >> /root/.bashrc

source /root/.bashrc

2
When you install/update linux kernel you can see these missing firmware warnings. These drivers are not necessary to run your system, at some point they where excluded from kernel. If these errors disturb you then you can get them from user repositories. The wd719x is a driver for "Western Digital WD7193, WD7197 and WD7296 SCSI cards" and aic94xx is the driver for "Adaptec SAS 44300, 48300, 58300 Sequencer".

# Download the missing firmware using your favourite AUR package manager.
yay -S aic94xx-firmware wd719x-firmware

# When you run kernel install again, you should not see the error any more.
yay -
S linux

3

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

To install other packages or package groups, append the names to the pacstrap command above (space separated) or use pacman while chrooted into the new system. For comparison, packages available in the live system can be found in packages.x86_64.

pacstrap -i /mnt base base-devel linux linux-firmware

-i给你有选择的权利，不过还是默认的好，如有特俗需求可以改）

配置系统

Fstab启动配置文件

genfstab -U /mnt >> /mnt/etc/fstab

Chroot

arch-chroot /mnt

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

hwclock --systohc

nano /etc/locale.gen

locale-gen
nano /etc/locale.conf

LANG=en_US.UTF-8

nano /etc/hostname

nano /etc/hosts

127.0.0.1   localhost.localdomain    localhost
::1         localhost.localdomain    localhost
127.0.1.1   myhostname.localdomain myhostname

If the system has a permanent IP address, it should be used instead of 127.0.1.1.

Initramfs

Creating a new initramfs is usually not required, because mkinitcpio was run on installation of the kernel package with pacstrap.

For LVM, system encryption or RAID, modify mkinitcpio.conf(5) and recreate the initramfs image:

mkinitcpio -P

passwd

UEFI systems
Note:
It is recommended to read and understand the Unified Extensible Firmware Interface, Partitioning#GUID Partition Table and Arch boot process#Under UEFI pages.
When installing to use UEFI it is important to boot the installation media in UEFI mode, otherwise efibootmgr will not be able to add the GRUB UEFI boot entry. Installing to the fallback boot path will still work even in BIOS mode since it does not touch the NVRAM.
To boot from a disk using UEFI, an EFI system partition is required. Follow EFI system partition#Check for an existing partition to find out if you have one already, otherwise you need to create it.
Installation
Note:
UEFI firmwares are not implemented consistently across manufacturers. The procedure described below is intended to work on a wide range of UEFI systems but those experiencing problems despite applying this method are encouraged to share detailed information, and if possible the workarounds found, for their hardware-specific case. A GRUB/EFI examples article has been provided for such cases.
The section assumes you are installing GRUB for x86_64 systems. For IA32 (32-bit) UEFI systems (not to be confused with 32-bit CPUs), replace x86_64-efi with i386-efi where appropriate.
First, install the packages grub and efibootmgr: GRUB is the bootloader while efibootmgr is used by the GRUB installation script to write boot entries to NVRAM.

Then follow the below steps to install GRUB:

Mount the EFI system partition and in the remainder of this section, substitute esp with its mount point.
Choose a bootloader identifier, here named GRUB. A directory of that name will be created in esp/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 esp/EFI/GRUB/ and install its modules to /boot/grub/x86_64-efi/.

grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB

After the above install completed the main GRUB directory is located at /boot/grub/. Note that grub-install also tries to create an entry in the firmware boot manager, named GRUB in the above example.

Remember to #Generate the main configuration file after finalizing the configuration.

Tip: If you use the option --removable then GRUB will be installed to esp/EFI/BOOT/BOOTX64.EFI (or esp/EFI/BOOT/BOOTIA32.EFI for the i386-efi target) and you will have the additional ability of being able to boot from the drive in case EFI variables are reset or you move the drive to another computer. Usually you can do this by selecting the drive itself similar to how you would using BIOS. If dual booting with Windows, be aware Windows usually places an EFI executable there, but its only purpose is to recreate the UEFI boot entry for Windows.
Note:
--efi-directory and --bootloader-id are specific to GRUB UEFI, --efi-directory replaces --root-directory which is deprecated.
You might note the absence of a device_path option (e.g.: /dev/sda) in the grub-install command. In fact any device_path provided will be ignored by the GRUB UEFI install script. Indeed, UEFI bootloaders do not use a MBR bootcode or partition boot sector at all.
Make sure to run the grub-install command from the system in which GRUB will be installed as the boot looader. That means if you are booting from the live installation environment, you need to be inside the chroot when running grub-install. If for some reason it is necessary to run grub-install from outside of the installed system, append the --boot-directory= option with the path to the mounted /boot directory, e.g --boot-directory=/mnt/boot.
See UEFI troubleshooting in case of problems. Additionally see GRUB/Tips and tricks#UEFI further reading.