My Step-by-Step Process for Starting Arch Linux Live

In this blog post I will detail the steps I go through to bring an Arch Linux live distro from a minimal boot disk to a fully functional text-mode Linux system. All changes get deleted when I shut down, but this is the system I’m working with until I get around to actually installing Arch (don’t ask me when that will be).

Step 1: Add a non-root user (very important for security)

useradd -ms /usr/bin/zsh michaelwarren

I like to use zsh since I just like the idea of using different shells for different Unix systems. My native shell is bash.

passwd -d michaelwarran

Arch Linux starts each account with a default password that is selected at random. As far as I know, there is no simple way of finding this password, so in order to actually log in as that user you have to run passwd -d to clear the old password. The account now has essentially no security.

passwd michaelwarren

Specify a new password for the non-root account.

vim /etc/sudoers

Next you have to edit the sudoers file so that the non-root account can su to root. I add the following line:

michaelwarren ALL=(root) ALL

This file is read-only, so remember to type :w! instead of just :w when you save changes.
Now we’re ready to change to the non-root account:

su michaelwarren

Step 2: Expand available disk space
When you boot an Arch Linux Live CD, the entire filesystem is stored in a RAMdisk in main memory. A RAMdisk is just what its name suggests: a partition in main memory that stores a copy of a permanent filesystem. The RAMdisk used by the Arch Linux live distro is mounted on /run/archiso/cowspace. Since its default size is half the available memory (only 2GB on my system), it will not hold all the packages I want to install, so I have to change its size and store the rest of the RAMdisk on a swap space on an external SSD.

sudo mkswap /dev/sdb6

This configures a partition to be used as a swap space. You only need to do this once. In future boots you can skip this step.

sudo swapon /dev/sdb6

This tells Arch to use the partition as a swap space, effectively increasing the size of available memory and thus the potential size of the RAMdisk.

sudo mount -o remount,size=8G /run/archiso/cowspace

This tells Linux to remount the RAMdisk with a new size of 8 GB. I find this is good enough for my purposes.

Step 4: Set up networking
This part can be comparatively simple, provided you have a wired connection. I always connect my Arch Linux system through Ethernet, because connecting to WiFi is a lot more complicated and I haven’t entirely figured out how to do it. As long as there is a physical connection, all you have to do is send a request to the DHCP server to lease an IP address to this host, allowing it to use the network.

sudo dhclient

This program will take a couple seconds to run, but once it’s finished, Arch Linux is fully Internet-enabled.

Step 5: Mount my Windows filesystem so I can access locally stored files

sudo mount /dev/sda2 /mnt

Step 6: Install all my packages
I’m just going to give a sample command here:

sudo pacman -Sy lynx

I prefer Lynx to the default Elinks because it has prettier colors.
Actually, I’ve started saving packages locally to avoid bandwidth throttling. I wrote a script that unpacks the packages and installs them. Since pacman is a binary-based PMS, this mainly just involves automatically copying the files to the appropriate directories. Such a script is fairly easy to write.

Anyway, that’s my boot process for Arch Linux. Don’t ask me why I do this to myself.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s