Skip to content

Instantly share code, notes, and snippets.

@codeitlikemiley
Last active December 19, 2019 00:30
Show Gist options
  • Save codeitlikemiley/8a66419dc8a239e14806d20764c5234e to your computer and use it in GitHub Desktop.
Save codeitlikemiley/8a66419dc8a239e14806d20764c5234e to your computer and use it in GitHub Desktop.

Install

pacstrap /mnt base base-devel

Officially supported kernels

linux linux-hardened linux-lts linux-zen

file system

mkfs.btrfs btrfs-progs mkfs.fat dosfstools mkexfatfs exfat-utils mkfs.xfs xfsprogs

Partition Disk Layout

UEFI/GPT example layout

Mount point on the installed system Partition Partition type GUID
/boot or /efi /dev/sda1 C12A7328-F81F-11D2-BA4B-00A0C93EC93B: EFI system partition
/ /dev/sda2 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709: Linux x86-64 root (/)
[SWAP] /dev/sda3 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F: Linux swap
/home /dev/sda4 933AC7E1-2EB4-4F13-B844-0E14E2AEF915: Linux /home

BIOS/MBR example layout

Mount point on the installed system Partition Partition type ID Boot flag
/ /dev/sda1 83: Linux Yes
[SWAP] /dev/sda2 82: Linux swap No
/home /dev/sda3 83: Linux No

BIOS/GPT example layout

Mount point on the installed system Partition Partition type GUID Partition attributes
None /dev/sda1 21686148-6449-6E6F-744E-656564454649: BIOS boot partition1
/ /dev/sda2 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709: Linux x86-64 root (/) 2: Legacy BIOS bootable
[SWAP] /dev/sda3 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F: Linux swap
/home /dev/sda4 933AC7E1-2EB4-4F13-B844-0E14E2AEF915: Linux /home

BTRFS - BIOS MBR

TYPE 1

Mount point Label FileSystem
/dev/sdx1 ROOT Btrfs
/dev/sdx2 SWAP Linux Swap
  • BTRFS Subvolumes (grub-install /dev/sdx)
Label File System
@ /
@home /home
@log /var/log
@pkg /var/cache/pacman/pkg
@snapshots /.snapshots

TYPE 2

Mount point Label FileSystem
/dev/sdx1 ROOT Btrfs
/dev/sdx2 HOME Xfs
/dev/sdx3 SWAP Linux Swap
  • BTRFS Subvolumes (grub-install /dev/sdx)
Label File System
@ /
@log /var/log
@pkg /var/cache/pacman/pkg
@snapshots /.snapshots

BTRFS - UEFI System GPT Partionable

Mount point Label FileSystem
/dev/sdx1 EFI EFI
/dev/sdx2 ROOT Btrfs
/dev/sdx3 HOME Xfs
/dev/sdx4 SWAP Linux Swap
  • BTRFS Subvolumes
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
Label File System
@ /
@log /var/log
@pkg /var/cache/pacman/pkg
@snapshots /.snapshots

Single Partition or With Swap

Mount point Label FileSystem
/dev/sdx1 ROOT Btrfs
/dev/sdx2 SWAP Linux Swap
  • BTRFS Subvolumes (grub-install /dev/sdx)
Label File System
@ /
@home /home
@log /var/log
@pkg /var/cache/pacman/pkg
@snapshots /.snapshots
mkfs.btrfs -L ROOT /dev/sdx1
mkswap -L SWAP /dev/sdx2

mount /dev/sdx1 /mnt
btrfs sub cr /mnt/@
btrfs sub cr /mnt/@home
btrfs sub cr /mnt/@log
btrfs sub cr /mnt/@pkg
btrfs sub cr /mnt/@snapshots

umount /mnt
mount -o relatime,space_cache=v2,compress=lzo,subvol=@ /dev/sdx1 /mnt
mkdir -p /mnt/{boot,home,var/log,var/cache/pacman/pkg,btrfs}
mount -o relatime,space_cache=v2,compress=lzo,subvol=@home /dev/sdx1 /mnt/home
mount -o relatime,space_cache=v2,compress=lzo,subvol=@log /dev/sdx1 /mnt/var/log
mount -o relatime,space_cache=v2,compress=lzo,subvol=@pkg /dev/sdx1 /mnt/var/cache/pacman/pkg/
// this will optional
mount -o relatime,space_cache=v2,compress=lzo,subvolid=5 /dev/sdx1 /mnt/btrfs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment