阿里云 ESC 安装 ArchLinux

阿里云 ESC 安装 ArchLinux

2024/10/08

1. backup

disk:

# df

net:

# ip addr

2. install arch

boot from iso

download iso

iso mirror

wget http://mirrors.cloud.aliyuncs.com/iso/2024.10.01/archlinux-2024.10.01-x86_64.iso
wget https://mirrors.aliyun.com/archlinux/iso/2024.10.01/b2sums.txt
b2sum -c b2sums.txt # Verify iso

mkdir -p /iso
mv archlinux-2024.10.01-x86_64.iso /iso/archlinux.iso

grub setup

cat << 'EOF' >> /etc/grub.d/40_custom
menuentry "ArchLinux ISO" {
    set root=(hd0,3)
    set imgdevpath="/dev/vda3"
    set isofile="/iso/archlinux.iso"
    loopback loop $isofile
    echo "Starting from dev=$imgdevpath iso=$isofile..."
    linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=$imgdevpath img_loop=$isofile copytoram=y archisobasedir=arch
    initrd (loop)/arch/boot/x86_64/initramfs-linux.img
}
EOF

less /etc/grub.d/40_custom # confirm

update-grub

# 先打开 VPC 再 reboot
# reboot 执行后立即在 VPC 不停按 ESC
# 如果尽量 BIOS, 则选择原引导, 启动后再按 ESC 进入 GRUB

注意: copytoram=y 是将 rootfs 复制到内存, 这样可以解除系统盘占用, 以格式化分区. 如果内存不足, 可以找缩小后的 iso 或者 iso 放在数据盘上

references:

iso - archinstall

check internet:

ip addr
ping mirrors.cloud.aliyuncs.com 

add pacman mirror:

mirror selector: https://archlinux.org/mirrorlist/

echo 'Server = http://mirrors.cloud.aliyuncs.com/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist

# test mirror
pacman -Sy

# run installer
archinstall
# 网络配置可以选择 "Copy ISO network config...": 直接复制 ISO 的配置, 这样新系统初始有网
# 安装完成后, 可选择 NO 返回 ISO, reboot 即可

3. install apps

系统默认没有 ssh, 安装:

pacman -Sy vim openssh
# vim /etc/ssh/sshd_config  # PermitRootLogin yes

systemctl enable sshd --now

tools:

  • yay
  • tmux btop lf fzf …
Last updated on