Skip to content

Instantly share code, notes, and snippets.

@glacion
Last active December 3, 2017 17:50
Show Gist options
  • Save glacion/fe3a14e71f681244aec2ff1f6bca4866 to your computer and use it in GitHub Desktop.
Save glacion/fe3a14e71f681244aec2ff1f6bca4866 to your computer and use it in GitHub Desktop.
Arch Linux installation
#Load keyboard layout.
loadkeys trq
#Establish internet connection through wifi.
wifi-menu
#Establish internet connection through ethernet.
dhcpcd
#Test internet connection.
ping google.com
#Prepare Hard Drive for Installation.
#Delete everything.
#(Avoid if you already have a GPT partitioned drive.)
gdisk /dev/sda
x
z
y
y
#Partition your drive.
cgdisk /dev/sda
#Make EFI partition.
[New]
First Sector: Leave This Blank
Size in sectors: 512M
Hex Code: EF00
Enter new partition name: boot
#Make Swap partition.
[New]
First Sector: Leave This Blank
Size in sectors: 18G
Hex Code: 8200
Enter new partition name: swap
#Make Root partition.
[New]
First Sector: Leave This Blank
Size in sectors: 20G
Hex Code: Leave This Blank
Enter new partition name: root
#Make Home partition.
[New]
First Sector: Leave This Blank
Size in sectors: Leave This Blank
Hex Code: Leave This Blank
Enter new partition name: home
#Create filesystems.
#Boot partition must be in FAT32 for UEFI systems.
mkfs.vfat /dev/sda1
#Creating and mounting swap.
mkswap /dev/sda2
swapon /dev/sda2
#Formatting Root filesystem.
mkfs.btrfs /dev/sda3
#Formatting Home filesystem.
mkfs.xfs /dev/sda4
#Blueprint for root FS.
sda3
|
|
- active
| |
| - root
| |
| - tmp
|
|
- snapshots
#Creating subvolumes.
mount /dev/sda3 /mnt
cd /mnt
btrfs subvolume create active
btrfs subvolume create active/root
btrfs subvolume create active/tmp
btrfs subvolume create snapshots
cd
umount /mnt
#Mount RootFS partitions properly.
mount -o compress=lzo,autodefrag,nobarrier,space_cache, \
discard,noatime,subvol=active/root /dev/sda3 /mnt
mkdir /mnt/{.snapshots,home,tmp,boot}
mount -o compress=lzo,autodefrag,nobarrier,space_cache, \
discard,noatime,subvol=active/tmp /dev/sda3 /mnt
mount -o compress=lzo,autodefrag,nobarrier,space_cache, \
discard,noatime,subvol=snapshots /dev/sda3 /mnt/.snapshots
#Mount home and boot partitions.
mount /dev/sda1 /mnt/boot
mount /dev/sda4 /mnt/home
#Installing base system and bootloader.
#Find the best server for you, move that line to top.
nano /etc/pacman.d/mirrorlist
#Alternatively you can find fastest
#server to your location automatically.
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
rankmirrors -n 4 /etc/pacman.d/mirrorlist.bak \
> /etc/pacman.d/mirrorlist
#Install Arch base.
pacstrap -i /mnt base base-devel
#Generate your fstab file.
genfstab -U /mnt >> /mnt/etc/fstab
#Check if your fstab shows your partitions appropriately.
nano /mnt/etc/fstab
#Unmount the subvolume and delete that folder in order
#to not have headaches with snapper.
umount /mnt/.snapshots
rm -rf /mnt/.snapshots
#Chroot into your new system.
arch-chroot /mnt
#Uncomment en_US.UTF-8 from below.
nano /etc/locale.gen
#Generate locale.
locale-gen
#Set your hardware clock to UTC.
hwclock --systohc --utc
#Enable multilib.
nano /etc/pacman.conf
##Uncomment these two lines below
#[multilib]
#Include = /etc/pacman.d/mirrorlist
#Obtain package list.
pacman -Sy
#Add password for root user.
passwd
#Create new user.
useradd -m -g users -G wheel -s /bin/bash glacion
#Add password for new user.
passwd glacion
#Configuring sudo.
#(/etc/sudoers file MUST be edited with visudo command)
EDITOR=nano visudo
##Uncomment this line.
#%wheel ALL=(ALL) ALL
#Installing the Bootloader.
pacman -S efibootmgr
efibootmgr -d /dev/sda -p 1 -c -L "Arch" -l /vmlinuz-linux \
-u 'root=PARTUUID=$(blkid -s PARTUUID -o value \
/dev/sda3) rw rootflags=subvol=active/root \
acpi_osi=! acpi_osi="Windows 2009" \
initrd=/intel-ucode.img initrd=/initramfs-linux.img \
quiet splash vt.global_cursor_default=0 \
loglevel=0 rd.udev.log-priority=0'
#Install required packages for your system.
#Graphics driver and bbswitch utility to disable \
#discrete graphics.
pacman -S xf86-video-intel bbswitch
#Desktop environment.
#GNOME.
pacman -S gnome file-roller gedit \
gnome-calendar gnome-music \
gnome-tweak-tools seahorse \
gnome-weather
#Cinnamon.
pacman -S cinnamon xfce4-terminal xorg-server
#Display Manager(Skip if you
#installed GNOME.
pacman -S lightdm lightdm-gtk-greeter \
lightdm-gtk-greeter-settings
#Utilities.
pacman -S gst-libav gst-plugins-ugly gstreamer-vaapi \
libva-intel-driver lib32-libva-intel-driver \
ntfs-3g tlp jdk8-openjdk jre8-openjdk firewalld \
intel-ucode gnome-keyring gedit file-roller \
chromium vim libreoffice-fresh android-tools \
snapper btrfs-progs the_silver_searcher \
gvfs-mtp adobe-source-code-pro-fonts \
noto-fonts noto-fonts-cjk noto-fonts-emoji \
gnome-screenshot
#Configure bbswitch.
echo "options bbswitch load_state=0 unload_state=0" \
> /etc/modprobe.d/bbswitch.conf
echo "bbswitch" >> /etc/modules-load.d/bbswitch.conf
echo "blacklist nouveau" >> /etc/modprobe.d/nouveau.conf
#Rebuild initramfs.
mkinitcpio -p linux
#Reboot to your new system.
reboot
#Post installation configs.
#Go superuser.
sudo -s
#Set locale.
localectl set-locale LANG=en_US.utf8
#Set Hostname.
hostnamectl set-hostname X550VX
#Set Timezone.
timedatectl set-timezone Europe/Istanbul
#Enable network time protocol.
timedatectl set-ntp true
#Set permanent keymap.
localectl set-keymap trq
#Enable NetworkManager.
systemctl enable NetworkManager
#Enable Firewall.
systemctl enable firewalld
#Snapper setup.
snapper -c root create-config /
#Create a snapshot.
snapper create -d "Post-Install backup"
#Add iGPU to early KMS.
nano /etc/mkinitcpio.conf
#Append these two modules
MODULES="intel_agp i915"
#Update initramfs.
mkinitcpio -p linux
#Enable display manager.
systemctl enable lightdm
#Enable tlp services
systemctl enable tlp
systemctl enable tlp-sleep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment