installing Arch Linux ARM in Raspberry Pi
This tutorial guides you through the process of installing the ARM flavour of Arch Linux in a RaspberryPi. This is a headless installation procedure, no monitor/tv or keyboard are required.
Get Arch Linux ARM
You can download the image using a direct download link or torrent. The latest version
available (at this time) is the archlinux-hf-2013-02-11
. After downloading the zip archive containing the
image verify the SHA-1 checksum. First download the archlinux-hf-2013-02-11.zip.sha1
file
in the same path as the zip archive and then run:
Install on SD card
The installation process is pretty straighforward. Insert the SD card in your computer
and transfer the image to the card using the dd
command as root. As always, pay attention
to the supplied destination device. Make sure you use the one corresponding to the SD card
or you could trash all your data on other devices. Also make sure that the destination device
is not mounted. You can use the lsblk
command to verity that. We will just use sdX
as an example.
Expanding the root partition
After the image transfer is complete two partitions are created. The sdX1
partition will be mounted
at /boot
and the filesystem is VFAT
. The other partition, sdX2
holds the root filesystem and is
formatted as ext4
.
The root filesystem is a little smaller than 2GB. If the SD card is bigger (it should be) we need to expand this partition to fill the remaining space. Alternatively we could create a second filesystem and mounted at a mount point of our choice. The creation of a new filesystem is really simple, so it is not covered here.
In order to utilize the remaining free space, first we expand the partition and then we expand the filesystem.
As always make sure that the partitions are not mounted and that you are altering the proper ones. The following
examples assume that the SD card is the device /dev/sdb
and the root partition the /dev/sdb2
.
Start fdisk
. The p
command lists the partitions in the device /dev/sdb
.
Then, we delete the the second partition (the roor):
and re-create it. We create the new partition as primary and we set the last sector at the end of the SD card. The default settings should be fine here.
The partition is already set to Linux (83) so there is no need to alter it. Finally, save the changes:
In order to expand the filesystem, first we run the checkdisk program to detect and fix inconsistencies and then use the resize program.
IP discovery and remote login
The Arch Linux ARM image has the ssh deamon enabled by default. In order to login we must first determine which IP the rpi has acquired from the local network. This assumes that there is a working DHCP server on the LAN. One way to get the IP address is to check the DHCP logs or the router logs if DHCP is running from a router. As an alternative, we can run a ping scan on the LAN using nmap. Assuming that the lan subnet is 192.168.0.0 with mask 255.255.255.0 run:
After finding the IP login using the username and password root
.
Post-install configuration
After you login, you should change the root password using passwd
. Also, it is a good idea to re-generate
the rsa and dsa keys.
Answer “yes” on prompt to overwrite. To run a full system upgrade run:
Memory allocation
Depending on the usage you are planning to do with the rpi it might be a good idea to adjust the RAM
split between the CPU and the GPU. Edit the file /boot/config.txt
file and change the value of the
variable gpu_mem_256
or gpu_mem_521
depending on the rpi model you have.
This post shows the valid memory values. Note that you
must also take into consideration the cma_lwm
and cma_hwm
variables. These variables allow dynamic
memory management at runtime. Make sure that gpu_mem_256
(or 512) value is higher than the high water mark
cma_hwm
. More info at the links on the bottom of this post.