Menu Close

Arch Linux Laptop for Software Development

In this post I describe how I installed Arch Linux on an old ASUS laptop. I prefer the Arch distribution because it is “a minimal base system, configured by the user to only add what is purposely required,”  which is ideal for a laptop. Arch makes it easy to minimize the number of services running, and maximize the amount of available storage space, by only installing the stuff I specifically need. High Speed. Low Drag. HOOAH! Anyway, let’s begin…

NOTE: This is no substitute for the official Arch Installation Guide.

Create Partitions

I used the cfdisk utility to delete all existing partitions on the hard drive /dev/sda, and to create the partitions as described in the table below.

DeviceSizeType
/dev/sda1550MEFI System
/dev/sda216GLinux swap
/dev/sda340GLinux filesystem
/dev/sda4*remainingLinux home

Verify Partitions

I then used the fdisk command to list the partitions on /dev/sda, and verify that they were created with the correct sizes and types.

$ fdisk --list /dev/sda
Device       ...    Size    Type
/dev/sda1    ...    550M    EFI System
/dev/sda2    ...     16G    Linux swap
/dev/sda3    ...     40G    Linux filesystem
/dev/sda4    ...    167G    Linux home

Format Partitions

$ mkfs.fat -F32 /dev/sda1
$ mkswap /dev/sda2 && swapon /dev/sda2
$ mkfs.ext4 /dev/sda3
$ mkfs.ext4 /dev/sda4

Mount Partitions

We create the filesystem by pointing directory names to the physical locations on a hard drive (mounting). In this way the directory /mnt points to the physical location of /dev/sda3, the directory /mnt/boot points to /dev/sda1 partition, and /mnt/home to /dev/sda4.

$ mount /dev/sda3 /mnt
$ mkdir /mnt/home
$ mount /dev/sda4 /mnt/home
$ mkdir /mnt/boot
$ mount /dev/sda1 /mnt/boot

Install Arch Linux!

$ pacstrap /mnt base base-devel linux linux-firmware
$ genfstab -U /mnt >> /mnt/etc/fstab
$ arch-chroot /mnt

Configure System

  • locale$ locale-gen $ echo LANG=en_US.UTF-8 > /etc/locale.conf
  • timezone$ ln -sf /usr/share/zoneinfo/US/Mountain /etc/localtime $ hwclock --systohc --utc
  • hostname$ echo phagelambda > /etc/hostnameInstall GRUB BootLoader$ pacman -Syu grub efibootmgr $ grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB $ grub-mkconfig -o /boot/grub/grub.cfg

Configure Root Password

$ passwd

Update Package Manager

$ pacman -Syu

New “sudo” user

It is better to create a new user with super-user privileges than to work on the system as root. Being forced to type sudo before potentially destructive commands may reduce the occurance of bad choices by making you think before you leap.

$ pacman -S sudo vim                       # install sudo package
$ useradd sbeagle                          # create new user
$ passwd sbeagle                           # set password
$ mkdir /home/sbeagle                      # create user's home directory
$ chown sbeagle:sbeagle /home/sbeagle      # change ownership to sbeagle
$ usermod -aG wheel sbeagle                # add to group wheel

Next I used vim /etc/sudoers to give the group wheel access to the sudo command by uncommenting this line:

%wheel ALL=(ALL) ALL

NetworkManager

I went with the NetworkManager service to connect to wifi when I re-booted into the main system. It was important to install it at this stage since this laptop has no ethernet port and I wouldn’t be able to get online without it. Truthfully, I realized that I needed this service after booting into my Arch installation, so I had to reboot to the Arch Installation USB, use wifi-xxx to get back online. Then I mount /mnt /dev/sda , arch-chroot /mnt and used pacman to install NetworkManager.

$ pacman -S networkmanager 
$ systemctl enable NetworkManager

Leave a Reply

Your email address will not be published. Required fields are marked *