Skip to content

Instantly share code, notes, and snippets.

@drewcassidy
Last active October 21, 2018 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewcassidy/150e0c0fc0703e39297ebe438c1af486 to your computer and use it in GitHub Desktop.
Save drewcassidy/150e0c0fc0703e39297ebe438c1af486 to your computer and use it in GitHub Desktop.
Steps taken to install Arch on a machine with BIOS using LVM and GRUB

Server Arch Installation

many steps taken from this tutorial

Connect to wifi

wifi-menu

(way easier than using wpa_supplicant)

Setup drive

Format Disk

using fdisk /dev/sda: - /dev/sda1: 1 MB “BIOS Boot” partition (type 4) - /dev/sda2: Linux LVM partition (type 31)

Create Volumes

create LVM physical volume:

pvcreate /dev/sda2

create volume group

vgcreate vg1 /dev/sda2

create logical volumes for boot, root, and swap

lvcreate -L 500M -n boot vg1
lvcreate -L 32G -n swap vg1
lvcreate -l 100G -n root vg1
Format Volumes

format root and boot volumes as ext4 using mkfs.ext4

mkfs.ext4 /dev/vg1/boot mkfs.ext4 /dev/vg1/root

enable swap

mkswap /dev/vg1/swap swapon /dev/vg1/swap

Mount Volumes

mount volumes using mount

/dev/vg1/root -> /mnt /dev/vg1/boot -> /mnt/boot

GRUB magic
mkdir /mnt/hostrun
mount —bind /run /mnt/hostrun

Install Linux

install base packages (plus any other packages like vim or wpa_supplicant):

pacstrap /mnt base base-devel

generate an fstab file

genfstab -pU /mnt >> /mnt/etc/fstab

change root to the new system

arch-chroot /mnt /bin/bash

Time Zone

set the time zone for the current region and city

ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

and regenerate adjusted time

hwclock —systohc

Locale

Uncomment en_US.UTF-8 UTF-8 and other needed locales in /etc/locale.gen, and generate them with locale-gen Set the LANG variable in /etc/locale.conf accordingly, for example:

LANG=/en_US.UTF-8/

Install the Bootloader

Setup LVM

mkdir /run/lvm
mount —bind /hostrun/lvm /run/lvm
pacman -S grub

Install the bootloader to the drive Arch was installed to (not partition!)

grub-install —target=i386-pc /dev/sda

In order for Grub to access the LVM partitions you must edit the default config prior to generating your Grub config at /etc/default/grub, add lvm to GRUB_PRELOAD_MODULES=‘ ‘

make the config with grub-mkconfig -o /boot/grub/grub.cfg

Create hostname

write hostname to /etc/hostname

Create password and users

create root password of passwd

create new user

useradd -m -g users -G wheel,storage,power [username]
passwd [username]

and add it to the sudoers file with visudo, and uncomment %wheel ALL=(ALL) ALL

and at this point, it fails to boot... it can boot to the emergency shell, but not mount the root filesystem

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