Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created March 5, 2013 22:42
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save roxlu/5095034 to your computer and use it in GitHub Desktop.
Save roxlu/5095034 to your computer and use it in GitHub Desktop.
Install arch-linux - work in progress gui

Installing ARCH linux

Preparation:

  • Get an empty USB disk
  • Create 2 partitions:
    • ARCH - filesystem FAT
    • FAT - filesystem FAT
  • Downlaod Arch linux from: www.archlinux.org/download and put on your USB ARCH partition
  • Make sure you have an Ubuntu install somewhere (VMware would work)

Fix the iso to be usable for UEFI:

$ sudo su $ mkdir -p /mnt/arch $ [ go to your USB ARCH partition ] $ mount -o loop archlinux-2012.12.01-dual.iso /mnt/iso $ cd /mnt/arch/loaded/entries $ cat archiso-x86_64.conf

  • copy the name behind archisolabel=[THIS ONE]. you need to rename the partition of the USB onto which you want to install the arch linux iso. In my case it was ARCH_201303
  • Disconnect the USB, connect it do a Mac again and then rename the USB partition to something like: ARCH_201303
  • Connect the USB to your ubuntu computer after renaming the partition
  • Mount again: mount -o loop archlinux-2012.12.01-dual.iso /mnt/iso
  • Disconnect the USB drive
  • Put the USB drive in the computer onto which you want to install ARCH

modprobe efivars

Partitioning


Check what disks you have using: fdisk -l I have:

  • /dev/sda SSD - 256GB
  • /dev/sdb HD - 1TB

I’m going to partition like: – - 200 MB - /dev/sda1 - EFI / (root) - 250 GB - /dev/sda2 /boot - 100 MB - /dev/sda3 /home - 300 GB - /dev/sdb

Partition the SSD + HD


$ gdisk /dev/sda

  • type ‘p’ to see all paritions which are going to remove
  • type ‘d’ to delete the partitions (you need to enter the partition number too)

Creating new partitions:


  • First we need to create the book UEFI partition (this must be the first one!)
    • type ‘n’ Partition number: 1 First sector (blabla): [PRESS ENTER] Last sector (blabla): +200M Hex code or GUID: ef00 // ef00 makes it an EFI partition which is necessary for UEFI boot
  • Create the /boot parittion
    • type ‘n’ Partition number: 2 First sector (blabla): [PRESS ENTER] Last sector (blabla): +100M Hex code or GUI: 8300 (linux filesystem)
  • Create the root / partition
    • type ‘n’ Partition number: 3 First sector (blabla): [PRESS ENTER] Last sector (blabla): [PRESS ENTER] // this will use the entire disk Hex code or GUI: 8300 (linux filesystem)
  • Write partition to disk, press ‘w’
  • Create the partitions on the other big harddisk, but first delete the existing ones
    • type ‘d’ if you want to delete the partitions. I removed all partitions
    • type ‘n’ to create the ‘/home’ partition: Partition number: 1 First sector (bla bla): [PRESS ENTER] Last sector (bla bla): [PREFF ENTER] Hex code or GUI: 8300 (Linux filesystem)
    • write to disk, press ‘w’

Formatting the partitions


$ pacman -S dosfstools $ mkfs -t vfat /dev/sda1 $ mkfs -t ext4 /dev/sda2 $ mkfs -t ext4 /dev/sda3 $ mkfs -t ext4 /dev/sdb1

Show paritions:


$ parted -l $ lsblk /dev/sda $ lsblk /dev/sdb

Mounting the filesystem


$ mkdir /mnt $ mount /dev/sda3 /mnt

$ mkdir /mnt/boot $ mkdir /mnt/home $ mount /dev/sda2 /mnt/boot $ mount /dev/sdb1 /mnt/home

$ mkdir /mnt/boot/efi $ mount /dev/sda1 /mnt/boot/efi

Installing the files


$ pacstrap /mnt base base-devel

Configuring the sytem


  • create fstab: $ genfstab -U -p /mnt > /mnt/etc/fstab
  • open your /mnt/etc/fstab, and remove all options from the /dev/sda1 partition. the only option you need to add is “noatime” /dev/sda1 is your EFI partition. For the other SDA (SSD harddisk) partitions you need to remvoethe relatime as it performs a write on your SSD card which you don’t want, so change them to noatime,discard, like:

    $ nano /mnt/etc/fstab

    • I have:

UUID=66c7fe57-17e1-4e57-9475-7de0a9c25308 / ext4 rw,noatime,discard,data=ordered 0 1

UUID=0ce4a0c4-c8f6-4f6e-bf2e-15322b76c7f4 /boot ext4 rw,noatime,discard,data=ordered 0 2

UUID=07BC-FAE8 /boot/efi vfat noatime 0 2

UUID=3b5a2762-0738-48c5-9f9c-22b66ce92a22 /home ext4 rw,relatime,data=ordered 0 2

  • chroot into your mounted system: $ arch-chroot /mnt
  • set locale: $ nano /etc/locale.gen
    • uncomment: en_US.UTF-8 UTF8

    $ locale-gen $ echo LANG=en_US.UTF-8 > /etc/locale.conf $ export LANG=en_US.UTF-8

  • set better looking font: $ setfont Lat2-Terminus16 $ nano /etc/vconsole.conf
    • add: FONT=Lat2-Terminus16
  • create a initial user $ useradd -m -g users -s bin/bash roxlu $ gpasswd -a roxlu wheel / add roxlu to wheel, necessary for sudoers later on
  • set the root password: $ passwd
  • install the nvidia dirvers: pacman -S nvidia pacman -S emacs pacman -S net-tools pacman -S sudo pacman -S vim
  • configure network card: $ ifconfig ( find your ethernet card, mine is: enp5s0) ( or use $ip link, to find your card)

    $ systemctl enable dhcpcd@enp5s0 $ systemctl start dhcpcd@enp5s0 // (didn’t test this)

  • configure SUDO $ /usr/bin/vim -p -X /etc/sudoers
    • uncomment: %wheel ALL=(ALL) ALL

Configuring the bootloader


$ mkdir -p /boot/efi/EFI/arch $ cp /boot/vmlinuz-linux /boot/efi/EFI/arch/vmlinuz-arch.efi $ cp /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img $ cp /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img

  • Install the boot menu + copy the files

$ pacman -S refind-efi efibootmgr

$ mkdir -p /boot/efi/EFI/refind $ cp /usr/lib/refind/refind_x64.efi /boot/efi/EFI/refind/refind_x64.efi $ cp /usr/lib/refind/config/refind.conf /boot/efi/EFI/refind/refind.conf $ cp -r /usr/share/refind/icons /boot/efi/EFI/refind/icons

  • Edit the configuration $ nano /boot/efi/EFI/arch/refind_linux.conf

    “Boot to X” “root=/dev/sda2 ro rootfstype=ext4 systemd.unit=graphical.target” “Boot to console” “root=/dev/sda3 ro rootfstype=ext4 systemd.unit=multi-user.target”

  • Add the refind menu:

$ efibootmgr -c -g -d /dev/sdX -p Y -w -L “rEFInd” -l ‘\EFI\refind\refind_x64.efi’

REBOOT


First reboot, then login with this user

CONTINUE THE SETUP


Configure pacman


$ emacs /etc/pacman.conf

  • scroll to the Repositories section (with [core], [extra], [community])
  • uncomment the [multilib] (not the testing), like so:

    [multilib] Include = /etc/pacman.d/mirrorlist

  • save the changes and run:

$ pacman -Sy

Install some more packages:


$ pacman -S wget $ pacman -S base-devel $ pacman -S yajl $ pacman -S openssh $ pacman -S cmake $ systemctl start sshd $ systemctl enable sshd.service

$ wget https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz $ tar -zxvf package-query.tar.gz $ cd package-query $ makepkg $ pacman -U package-query-1.1-2-x86_64.pkg.tar.xz

$ wget https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz $ tar -zxvf yaourt.tar.gz $ cd yaourt $ makepkg $ sudo pacman -U yaourt-1.2.2-1-any.pkg.tar.xz

Install window manager


$ pacman -S xorg-server xorg-xinit xorg-server-utils $ pacman -S xorg-twm xorg-xclock xterm $ pacman -S haskell-haskeline $ pacman -S xmonad $ pacman -S xmonad-contrib $ pacman -S xmobar $ pacman -S rxvt-unicode $ pacman -S git $ cd /home/roxlu $ mkdir .xmonad $ cd .xmonad $ emacs xmonad.hs

—- put this in xmonad.hs —– import XMonad

main = do xmonad $ defaultConfig { terminal = “urxvt” , modMask = mod4Mask , borderWidth = 3 }

—- put this in xmonad.hs —–

Put this in: ~/.xinit –

xsetroot -cursor_name left_ptr exec xmonad –

Then startx: $ startx

  • you should get a black screen
  • exit with ALT + SHIFT + Q

NOTES:

  • I had to reinstall the “systemd-sysvcompat” packages because I couldn’t enter my system, therefore I had to reboot with the USB boot disk connected and select “Arch Linux ArchISO UEFI USB” Then:
    • arch-chroot mnt
  • I had to “re-enable” my ethernet by first finding the name of my ethernet card: $ ip link
    • then I had to do:

    $dhcpcd [the name of the card]

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