安装Arch Linux


概念

  • UEFI 规范要求支持 FAT12、FAT16 和 FAT32 文件系统(参见 UEFI 规范 2.9 版 13.3.1.1 小节),但每个符合规范的厂商可以选择添加对其他文件系统的支持;比如,苹果公司(Apple)的 Mac 支持(并默认使用)他们自己的 HFS+ 或 APFS 文件系统。
  • vmlinux 是一个包括 linux kernel 的静态链接的可运行文件。文件类型是 linux 接受的可运行文件格式之中的一个(ELF、COFF或a.out)。
  • vmlinuz 是可引导的,压缩的 linux 内核,“vm” 代表的 “virtual memory” 。vmlinuz是vmlinux经过gzip和objcopy(*)制作出来的压缩文件。vmlinuz不仅是一个压缩文件,并且在文件的开头部分内嵌有gzip解压缩代码。所以你不能用gunzip 或 gzip –dc解包vmlinuz。vmlinuz是一个统称。有两种详细的表现形式:zImage和bzImage(big zImage)。zImage和bzImage的差别在于本身的大小和载入到内存的地址不同。zImage是0~640KB,bzImage是1M以上。假设内核比較小。那么能够採用zImage 或bzImage之中的一个,两种方式引导的系统运行时是同样的。大的内核採用bzImage。不能採用zImage。

准备安装U盘

镜像写入U盘

dd if=archlinux-2022.06.01-x86_64.iso of=/dev/sdc bs=1M

连接 SSH 安装

使用U盘引导进入系统后就可以开始安装了,如果觉得在电脑上操作不方便,可以给root账号设置一个密码,然后查询 IP,就可以通过SSH远程登录安装。

# 设置密码
passwd

# 查询ip地址
ip a

硬盘分区

EFI 300M;swap:4G;root分区:剩余空间。

cfdisk /dev/sda

设置 Boot loader

efibootmgr --disk /dev/sda --part 1 --create --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=UUID=55394c70-e770-4433-aeee-d688a837576c rw initrd=\initramfs-linux.img' --verbose

设置网络

# 启用网卡
ip link set enp0s25 up

问题

Failed to open file "/sys/devices/system/cpu/microcode/reload": Read-only file system

安装

pacstrap -i /mnt base base-devel linux linux-firmware linux-headers vim nano intel-ucode bash-completion

arch-chroot /mnt

### 安装 Systemd 启动器
bootctl install

vim /boot/loader/entries/arch.conf

编辑 /boot/loader/entries/arch.conf 文件

title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img

从哪个硬盘分区启动,写入启动配置文件

echo "options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/sda3) rw" >> /boot/loader/entries/arch.conf

延长SSD寿命,启用 fstrim

systemctl enable fstrim.timer

配置网络、蓝牙、声音

pacman -S networkmanager network-manager-applet dialog wpa_supplicant dhcpcd

启动安装的服务

systemctl enable dhcpcd@eno2
systemctl enable NetworkManager

蓝牙 打印机 音量

pacman -S mtools bluez bluez-utils cups xdg-utils xdg-user-dirs alsa-utils pulseaudio pulseaudio-bluetooth reflector

启动蓝牙

systemctl enable bluetooth

启动打印机服务

systemctl enable cups

OpenSSH

pacman -S openssh

启动 sshd

systemctl enable sshd

检查启动器

bootctl status

创建用户

useradd -m -s /bin/bash -G wheel arch
visudo

安装结束,取消挂载 退出 arch-chroot

exit
umount -R /mnt

重启

reboot

参考


发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注