Skip to content

Install Arch Linux

andyceo edited this page Oct 13, 2023 · 4 revisions

Установка Arch Linux

Актуальная версия: archlinux-2023.02.01 Оборудование: Dell XPS 13 9360

Предварительные действия

  1. Скачать установочный образ и записать его на флешку:

     dd bs=4M if=archlinux-2023.02.01-x86_64.iso of=/dev/sdc conv=fsync oflag=direct status=progress
    
  2. Загрузиться с флешки и выбрать пункт меню "Arch Linux install medium"

  3. Перейти к установке

Установка

  1. Keymap:

     localctl list-keymaps
     loadkeys ru
    
  2. Internet connection:

     ip link
     iwctl
         device list
         station <DEVICE> scan
         station <DEVICE> get-networks
         station <DEVICE> connect <SSID>
     # iwctl --passphrase passphrase station <DEVICE> connect <SSID>
     ping ya.ru -c 2
    
  3. NTP:

     timedatectl set-ntp true
    
  4. Partitioning and formatting:

     # create also fat32 uefi partition if not exist
     fdisk /dev/sda
     pvcreate
     vgcreate
     lvcreate
     mkfs.btrfs /dev/mapper/<NAME>
    
  5. Create btrfs subvolumes and mount them:

     mount /dev/mapper/<NAME> /mnt
     btrfs su cr /mnt/@
     btrfs su cr /mnt/@home
     btrfs su cr /mnt/@var
     btrfs su cr /mnt/@opt
     btrfs su cr /mnt/@tmp
     btrfs su cr /mnt/@.snapshots
     umount /mnt
    
     # Mount root filesystem (subvolume @)
     mount -o commit=120,compress=zstd:15,space_cache=v2,subvol=@ /dev/mapper/<NAME> /mnt
    
     # You need to manually create folder to mount the other subvolumes at
     mkdir /mnt/{boot,home,var,opt,tmp,.snapshots}
    
     mount -o commit=120,compress=zstd:15,space_cache=v2,subvol=@home /dev/mapper/<NAME> /mnt/home
     mount -o commit=120,compress=zstd:15,space_cache=v2,subvol=@var /dev/mapper/<NAME> /mnt/var
     mount -o commit=120,compress=zstd:15,space_cache=v2,subvol=@opt /dev/mapper/<NAME> /mnt/opt
     mount -o commit=120,compress=zstd:15,space_cache=v2,subvol=@tmp /dev/mapper/<NAME> /mnt/tmp
     mount -o commit=120,compress=zstd:15,space_cache=v2,subvol=@.snapshots /dev/mapper/<NAME> /mnt/.snapshots
    
     mount /dev/sda1 /mnt/boot
    
  6. Installing first packages:

    pacstrap /mnt base linux linux-firmware nano intel-ucode btrfs-progs
    
  7. fstab:

    genfstab -U /mnt >> /mnt/etc/fstab
    
  8. Chroot:

    arch-chroot /mnt
    
  9. Timezone:

    # ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime
    ln -sf /usr/share/zoneinfo/<Region>/<City> /etc/localtime
    hwclock --systohc
    
  10. Locale:

    nano /etc/locale.gen
    locale-gen
    echo LANG=en_US.UTF-8 >> /etc/locale.conf
    
  11. Keymap (only if set a key map):

    echo KEYMAP=[keymap] >> /etc/vconsole.conf
    
  12. Hostname:

    echo archaeon >> /etc/hostname
    
  13. Hosts:

    nano /etc/hosts
    

    Content:

    127.0.0.1 localhost ::1 localhost 127.0.1.1 archaeon.localdomain archaeon

  14. Password for root:

    passwd
    
  15. Install remain packages:

    pacman -S lvm2 grub grub-btrfs efibootmgr base-devel linux-headers networkmanager network-manager-applet wpa_supplicant dialog os-prober mtools dosfstools reflector git bluez bluez-utils xdg-utils xdg-user-dirs htop mc bash-completion tor
    
  16. Adding btrfs module and LVM hook to mkinitcpio.conf and regenerate linux kernel:

    nano /etc/mkinitcpio.conf
    # modules - btrfs, hooks - lvm2
    
    mkinitcpio -p linux
    
  17. Grub:

    grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Arch Linux"
    grub-mkconfig -o /boot/grub/grub.cfg
    
  18. Create regular user:

    useradd -mG wheel andyceo
    passwd andyceo
    EDITOR=nano visudo
    # Uncomment the line which says %wheel ALL=(ALL:ALL) ALL
    
  19. Enable services:

    systemctl enable NetworkManager
    systemctl enable bluetooth
    systemctl enable tor
    
  20. Reboot to Arch Linux:

    exit
    umount -l /mnt
    reboot
    

После установки:

  1. Подключиться к WiFi: nmtui

  2. Установить Gnome: pacman -S gnome

  3. Включить/запустить сервис Гнома: systemctl enable/start gdm

  4. Установить приложения:

     pacman -S firefox vlc gparted smartmontools
    
  5. Поправить настройку faillock: /etc/security/faillock.conf: deny = 5, иначе слишком часто блокирует логин пользователя и sudo

Особенности

  • Аппаратные: на ноутбуке Dell XPS 13 9360 BIOS не увидит UEFI-загрузчик, установленный Arch. Надо создать файл boot/bootx64.efi чтобы BIOS увидел жесткий диск как диск, с которого можно загрузить UEFI-систему
  • Настроить Gnome (см. Gnome)

Восстановление системы с USB-флешки

  • загрузиться с флешки

  • интернет: iwctl --passphrase passphrase station <DEVICE> connect <SSID>

  • подмонтировать корневую файловую систему в /mnt и все что необходимо (см. /etc/fstab):

      mount -o commit=120,compress=zstd:15,space_cache=v2,subvol=@ /dev/mapper/<NAME> /mnt
      # примонтировать /boot
    
  • сделать подмонтированную файловую систему основной: arch-chroot /mnt

  • заняться восстановлением:

      # обновить и переустановить пакеты что изменились
      pacman -Syu
    
      # обновить и переустановить ядро linux (обязательно!)
      pacman -Syu linux
    
      # внимательно смотреть на ошибки, которые выдает pacman! 
      # если используется btrfs, то при исчерпании места файлы при обновлении могут быть нулевой длины!
    

Ссылки

Sidebar is under construction

Clone this wiki locally