linux:notes:arch_linux_install
Table of Contents
Information
- Arch Linux Installation
Download
Installation Notes
Initial
EFI Entry Wipe
- Repeat
-b
for every entry that appears with-v
efibootmgr -v
efibootmgr -b 0000 -B
efibootmgr -b 0001 -B
efibootmgr -O
Drive Wipe
- See Drive Wipe for thorough erase
- Change
/dev/sda
to match environment - Run the
dd
command for a few seconds or so just to wipe out any surviving disk/partition information at the beginning of the drive
lsblk
sgdisk --zap-all '/dev/sda'
dd if='/dev/zero' of='/dev/sda'
reboot
Test Internet
ping 'archlinux.org'
Wireless Connection
iw dev
is used to find the wireless interface name- If single wireless interface exists, no need to specify it
iw dev
wifi-menu -o 'wlp3s0'
Enable SSH
- Allows installation over SSH
ifconfig
shows the IP address- Connect with the username
root
ip addr
passwd
systemctl start 'sshd'
Synchronize Time
timedatectl set-ntp 'true'
Disk Partitioning
- See Partitioning
Install
Update Mirrorlist
- Uncomment the commented Server URLs
wget 'https://www.archlinux.org/mirrorlist/?country=US&protocol=https&ip_version=4' -O '/etc/pacman.d/mirrorlist'
nano '/etc/pacman.d/mirrorlist'
Easy Update Mirrorlist
- Useful for copy/paste over SSH
wget 'https://www.archlinux.org/mirrorlist/?country=US&protocol=https&ip_version=4' -O '/tmp/mirrorlist' && sed -i 's/#Server/Server/g' '/tmp/mirrorlist' && mv '/tmp/mirrorlist' '/etc/pacman.d/mirrorlist'
Install
pacstrap -i '/mnt' 'base' 'base-devel'
Configuration
fstab
genfstab -L '/mnt' >> '/mnt/etc/fstab'
chroot
arch-chroot '/mnt'
Time Zone
ln -s '/usr/share/zoneinfo/America/New_York' '/etc/localtime'
hwclock --systohc --utc
Locale
Set locale.gen
- Uncomment
en_US.UTF-8 UTF-8
inlocale.gen
nano '/etc/locale.gen'
Set locale.conf
echo LANG='en_US.UTF-8' > '/etc/locale.conf'
Easy .conf and .gen Set
- Useful for copy/paste over SSH
- This can be used instead of the two commands above
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' '/etc/locale.gen' && echo LANG='en_US.UTF-8' > '/etc/locale.conf'
Generate
locale-gen
Hostname
- Change
x
to desired hostname
echo 'x' > '/etc/hostname'
Pacman
- Uncomment
Color
andTotalDownload
- Uncomment
[multilib]
and its followingInclude
line on 64-bit installs if multilib is desired - Add
ILoveCandy
under Misc options
nano '/etc/pacman.conf'
pacman -Syyuu
NetworkManager
pacman -S 'networkmanager'
systemctl enable 'NetworkManager'
F2FS
- If root partition is F2FS, this is mandatory
pacman -S 'f2fs-tools'
OpenSSH
- This is needed for both the service and client
pacman -S 'openssh'
Intel Microcode
pacman -S 'intel-ucode'
Root Password
passwd
Create User
- Change
espionage724
to desired username
useradd -m -G 'wheel' -s '/bin/bash' 'espionage724'
passwd 'espionage724'
chfn 'espionage724'
Enable SSH
pacman -S 'openssh'
nano '/etc/ssh/sshd_config'
PermitRootLogin no
systemctl enable 'sshd.socket'
sudo
- Uncomment
%wheel ALL=(ALL) ALL
EDITOR='nano' visudo
%wheel ALL=(ALL) ALL
Nano as default editor
nano '/etc/sudoers.d/nano'
Defaults editor = /usr/bin/nano
Easy Defaults editor
- Useful for copy/paste over SSH
echo 'Defaults editor = /usr/bin/nano' > '/etc/sudoers.d/nano'
Allow nano text wrapping
nano '/etc/nanorc'
set nowrap
Easy set nowrap
- Useful for copy/paste over SSH
sed -i 's/# set nowrap/set nowrap/g' '/etc/nanorc'
Initramfs
- Modules line is needed only if root partition is F2FS
- Add
lvm2
betweenblock
andfilesystems
hooks if using LVM - Add
encrypt
betweenblock
andfilesystems
hooks, but beforelvm2
for encrypted root partition - Add
COMPRESSION=cat
to disable image compression
Options
nano '/etc/mkinitcpio.conf'
MODULES="f2fs crc32 libcrc32c crc32c_generic crc32c-intel crc32-pclmul"
HOOKS="base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck"
COMPRESSION=cat
Generate
mkinitcpio -P
Boot Loader
systemd-boot
- For GPT/EFI set-ups
Install
bootctl install
Entry
- Add
cryptdevice=/dev/sda2:lvm
to options if encrypted - Change
root=
to/dev/mapper/arch-root
if using LVM - Remove
initrd /intel-ucode.img
if not using an Intel processor
nano '/boot/loader/entries/linux-kernel.conf'
title Arch Linux (linux-kernel) linux /vmlinuz-linux initrd /initramfs-linux.img initrd /intel-ucode.img options root=/dev/sda2 rw quiet
Loader
nano '/boot/loader/loader.conf'
timeout 2 default linux-kernel editor 0
GRUB
- For MBR/Legacy set-ups
Install
pacman -S 'grub'
grub-install --target='i386-pc' '/dev/sda'
Settings
nano '/etc/default/grub'
GRUB_TIMEOUT 2
Finalize
grub-mkconfig -o '/boot/grub/grub.cfg'
Finalize
sync
exit
umount -R '/mnt'
poweroff
Continue
Notable Folders and Commands
Show CPU Frequency
grep 'MHz' '/proc/cpuinfo'
watch -n 0.1 grep \'cpu MHz\' '/proc/cpuinfo'
Partition Information
df -hT
hdparm Secure Erase
lsblk
hdparm -I '/dev/sda' | grep 'not'
hdparm --user-master u --security-set-pass 'x' '/dev/sda'
hdparm --user-master u --security-erase 'x' '/dev/sda'
/var/www/wiki/data/pages/linux/notes/arch_linux_install.txt · Last modified: by 127.0.0.1