Skip to content

Instantly share code, notes, and snippets.

@crmarques
Created February 17, 2018 16:44
Show Gist options
  • Save crmarques/168e3c7b0d9274fc21bc095c60b3166c to your computer and use it in GitHub Desktop.
Save crmarques/168e3c7b0d9274fc21bc095c60b3166c to your computer and use it in GitHub Desktop.
# Install ARCH Linux with LVM on UEFI System
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# On Windows, create a bootable usb with Rufus (https://rufus.akeo.ie)
# Boot from the usb
# Set portuguese-br keymap
loadkeys br-abnt2
# Configure wifi
wifi-menu
# Create partitions
parted /dev/sda
(parted) mklabel gpt
(parted) mkpart ESP fat32 1MiB 513MiB
(parted) set 1 boot on
(parted) name 1 efi
(parted) mkpart primary 513MiB 800MiB
(parted) name 2 boot
(parted) mkpart primary 800MiB 100%
(parted) name 3 lvm
(parted) print
(parted) quit
# Create LVM and File systems on partitions
parted /dev/sda set 3 lvm on
parted /dev/sda print
# Create volumes
pvcreate /dev/sda3
vgcreate arch-lvm /dev/sda3
lvcreate -n root -L 20G lvm
lvcreate -n swap -L 2G lvm
lvcreate -n home -l 100%FREE lvm
lvs
# Create file systems
mkfs.fat -F32 /dev/sda1
mkfs.ext2 /dev/sda2
mkfs.btrfs -L root /dev/arch-lvm/root
mkfs.btrfs -L home /dev/arch-lvm/home
mkswap /dev/lvm/swap
swapon /dev/lvm/swap
# Create mount points and mount the file systems
mkdir /mnt/{home,boot}
mkdir /mnt/boot/efi
mount /dev/lvm/root /mnt
mount /dev/sda2 /mnt/boot
mount /dev/sda1 /mnt/boot/efi
mount /dev/lvm/home /mnt/home
# Install the system also includes needed stuffs
pacstrap /mnt base base-devel grub-efi-x86_64 zsh vim git efibootmgr dialog btrfs-progs --noconfirm
# 'install' fstab
genfstab -pU /mnt >> /mnt/etc/fstab
# Enter the new system
arch-chroot /mnt /bin/bash
# Setup system clock
ln -s /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
hwclock --systohc --utc
# Set the hostname
echo MYHOSTNAME > /etc/hostname
# Update locale
echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo LANGUAGE=en_US >> /etc/locale.conf
echo LC_ALL=C >> /etc/locale.conf
# Set password for root
passwd
# Add real user remove -s flag if you don't whish to use zsh
useradd -m -g users -G power,audio,wheel,storage -s /bin/zsh MYUSERNAME
passwd MYUSERNAME
# Configure mkinitcpio with modules needed for the initrd image
vim /etc/mkinitcpio.conf
# Add 'lvm2' to HOOKS before filesystems
# Regenerate initrd image
mkinitcpio -p linux
# Setup grub
pacman -S grub --noconfirm
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg
grub-mkconfig -o /boot/efi/EFI/arch/grub.cfg
# Setup persistente wireless connection
cat <<EOF > /etc/netctl/<wifi-ssid>
Description='Wi-fi'
Interface=wlp0xxxx
Connection=wireless
Security=wpa
IP=dhcp
ESSID='aerolitos'
Key='*****'
EOF
netctl start wired
netctl enable wired
# Enable multilib
vim /etc/pacman.conf
# install pacaur
gpg --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53
git clone https://aur.archlinux.org/cower.git
cd cower
makepkg -si
cd ..
git clone https://aur.archlinux.org/pacaur.git
cd pacaur
makepkg -si
cd ..
# Install intel video drivers (I don’t have graphics card)
pacaur -S xf86-video-intel --noconfirm
# Install sound
pacaur -S alsa-utils --noconfirm
# Test sound
speaker-test -c 2
# Allow Wheel group to execute any command
echo "export EDITOR=vim" >> ~/.bashrc
source ~/.bashrc
visudo
# uncomment the line
%wheel ALL=(ALL) ALL
# Install Desktop
pacaur -S xorg-server xorg-xinit xorg-server-utils ttf-dejavu --noconfirm
pacaur -S gnome gnome-extra gnome-tweak-tool ttf-dejavu gdm --noconfirm
systemctl enable gdm
# Config keyboard
vim /etc/X11/xorg.conf.d/00-keyboard.conf
Section “InputClass”
Identifier “system-keyboard”
MatchIsKeyboard “on”
Option “XkbLayout” “br”
Option “XkbVariant” “abnt2"
EndSection
# Cleaning o pacman
pacaur -Scc
pacaur -Syy
pacaur -Syu
# Exit new system and go into the cd shell
exit
# Unmount all partitions
umount -R /mnt
swapoff -a
# Reboot into the new system, don't forget to remove the cd/usb
reboot
# Customize Desktop
pacaur -S gnome-shell-extension-dash-to-dock arc-gtk-theme numix-circle-icon-theme-git --noconfirm
git clone https://github.com/agajews/ArcticApricity.git
mv ArcticApricity/Arctic\ Apricity/ /usr/share/themes
Config steps (https://www.youtube.com/watch?v=T8ncsIc2ciE)
# Config Brazilian Banks' Plugin: Warsaw by GAS Tecnologia
pacaur -S warsaw --noconfirm
systemctl enable warsaw.service
systemctl start warsaw.service
# References
https://wiki.archlinux.org/index.php/Installation_Guide
http://computingforgeeks.com/install-arch-linux-with-lvm-on-uefi-system/
www.akitaonrails.com/2017/01/10/arch-linux-best-distro-ever
http://blog.ataboydesign.com/2012/08/29/installing-arch-linux-on-lvm/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment