Install Arch-Linux on a Raspberry Pi

Arch Linux is a very clean and lightweight Linux distribution. With the following steps you can install it on a SD-Card to run it on a Raspberry Pi:

  1. Get the device name (dev-path) of the SD-Card to run the operating system (see Get a list of partitions or List, partitioning and format drives)

    You should see some partitions named /dev/mmcblk0pX. X is a Number. Then the device to format is mmcblk0.
  2. Format the SD-Card:
    1. Unmount all partitions currently mounted
    2. $> sudo fdisk /dev/mmcblk0 # run fdisk to create partitions
    3. That opens a commandline tool that accepts further commands to manage the device partitions.
      Here is the command order, that creates two partitions on the device (boot- and root-partition) :

      • p -> shows all existing partitions
      • o -> deletes all existing partition on the SD-Card (you can check it with p afterwards)
      • n -> to create a new partition:
        • p -> to create a primary partition
        • 1 -> to set the partition number to 1
        • press enter to confirm the default value for the first sector
        • enter +100M for the second prompt. Its the last sector value. So the first partition will be 100M in size.
        • set the type of the partition to W95 FAT32 (LBA) with t followed by c (To get a List of all supporter partition types you can use the l command.)
      • n -> to create a second partition
        • p -> to create a primary partition again
        • 2 -> to set the partition number to 2
        • two times enter to accept the default values for first and last sector -> the second partition will use all the remaining space on the drive.
        • we don’t set a type -> so the default type is 83 (Linux)
      • w -> will write the newly created partition information to the partition table of the device
  3. Format partitions and mount them to local folders:
    1. change to media directory of your user:

      That isn’t really necessary but I prefer to have mounted folders all together there. (on Ubuntu)
    2. create mountpoints:
    3. format partitions:
    4. mount the partitions to previously created mountpoints
  4. Download Arch Linux and extract contents for root and boot filesystems:
    1. switch to root account (IMPORTANT!!! sudo is not enough):
    2. Go to media mount folder again:
    3. Download Arch Linux archive:
    4. Extract contents to root partition:
    5. Copy boot filesystem to boot partition:
  5. Unmout partitions:
  6. Now you could remove the SD-Card and put it into your Raspberry Pi. That’s it! You’ll have a lot of fun with Arch! The default credentials are root for the user and root as password.

Leave a Reply

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

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.