Growing the root filesystem on Arch Linux ARM for the Raspberry Pi

Changes to the partition layout in the July 2013 image invalidate the information in this post, please see the comment section for details.

I run Arch Linux on my Raspberry Pi, this defaults to creating a 2GB partition for it’s data which I needed to extend to access the remaining space on my 16GB SD card. I’ll explain how I did this below but only do this on a newly installed Arch installation so if anything goes wrong you do not lose any data.

To start I’m assuming you’ve installed Arch on your SD card, if you haven’t follow this guide to show you how.

Boot Arch on your Raspberry Pi, log in as root on the console or via SSH, either way works fine. To start we will remove the partition containing Arch and replace it with another partition starting in the same location but ending at the end of the SD Card, this will vary depending on the size of the card you have.

[root@alarmpi ~]# fdisk /dev/mmcblk0

In fdisk,

  1. Press ‘p’ to print the partition table, take note of the number in the Start column of the row starting ‘/dev/mmcblk0p2’
  2. Press ‘d’ to delete a partition then enter ‘2’ to choose the second partition
  3. Press ‘n’ to create a new partition, all the default options are fine:
  • Choose ‘primary’ partition type
  • Partition number 2
  • The starting block should be same number you took note of in step 1
  • The default ending block should be the last available block on the SD card, this will vary depending on what size SD card you have

4. Press ‘w’ to write the new partition table and return to the bash prompt

Reboot now to force the kernel to recognise the new partition table.

[root@alarmpi ~]# reboot

After reboot we now we have the same two partitions we started with except that the second partition containing the root filesystem is now larger. However, the root filesystem is still only 2GB so we now need to resize the filesystem in order to fill the partition.

[root@alarmpi ~]# resize2fs /dev/mmcblk0p2

And there you go, you can now run ‘df -h’ to view your new partition sizes! Here’s mine…

[root@alarmpi ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  457M   14G   4% /
devtmpfs         51M     0   51M   0% /dev
tmpfs           105M     0  105M   0% /dev/shm
tmpfs           105M  260K  105M   1% /run
tmpfs           105M     0  105M   0% /sys/fs/cgroup
tmpfs           105M     0  105M   0% /tmp
/dev/mmcblk0p1   90M   24M   67M  27% /boot

PRISM round-up

Other commentary

What to do about PRISM?

It really should come as no surprise. For years the Internet has been consolidating so that billions of people now concentrate their online life onto a few “free” networks controlled by major US corporations, and now we find that Governments have been actively exploiting this in a mass domestic surveillance spying programme. The unfortunate truth is that this was just waiting to happen since it became apparent that too many people are putting too much of their private lives in the hands of too few companies. Companies whose interests, like any business, are towards serving their shareholders, their Governmental masters and their customers, who are not their non-paying users. So what can we do about this?

“When you are not paying for something, you are not the customer, you are the product.” – Internet Proverb

Decentralise

The Internet is big, there are many alternatives out there, they might be less convenient but by simply spreading out your online activity you are gaining a lot of your privacy back. Put your events, calendars, documents, photos, emails, instant messaging and status updates in several different places so that gathering them all together would require a much larger programme than we understand PRISM to be. Reinforce this by using smaller, independent web services that are less likely to get tapped, make the economies of scale work in your favour.

Federate

Decentralising does lose some of the benefits of integrated online applications, however that doesn’t need to be the case. Federation is the concept of using common standards to allow services to exchange data across the internet. It breaks down silos and enables a more diverse Internet that is more resilient against Government oppression and failure of individual online service providers. Email is the prime example, you can send an email to anyone using many different applications, operated by anyone and it works! Instant messaging is federated too using XMPP, Google federated Gtalk and Wave using it but now they are pushing their users onto their Hangouts service that is a walled garden as just more damning evidence of their falling interests in an free and open Internet.

Be demanding

Don’t blindly accept services which don’t support your freedom and privacy. Demand the ability to export your own data; demand the ability to communicate outside of their networks; demand open source so their software has no hidden surprises. If they don’t meet these demands, don’t use them and keep looking, there will be another one out there.

I’m not claiming to be perfect, but join me in retaking our privacy, I know what I’ll be doing and I’ll update this blog to explain how I’m doing it.