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

Fixing the non-moving mouse cursor in Chrome OS Vanilla builds for Virtualbox

I am able boot Hexxeh’s Chrome OS Vanilla builds in Virtualbox but I found the mouse cursor is stuck to the middle of the window.

I was able to solve this problem by selecting “Disable mouse pointer integration” from the Machine menu in Virtualbox’s display window.

You can also toggle this option using “Host” + I, the host is the right-ctrl button by default.

This problem seems to stem from Virtualbox’s feature that maps the cursor position from the host window, with this disabled you now need to click into the Window to allow the guest to capture the mouse and resume control from where you last left the cursor, which is not as nice but hopefully this bug will be fixed someday. However, if you find a better solution to the problem please leave a comment to let us know!

Fixing your preferred browser on (L)Ubuntu systems

I use Lubuntu on my trusty netbook, it’s become a nicely polished OS over the last few versions however it still has a few rough edges. One of which is defining a preferred browser.

The default browser on Lubuntu is Chromium, the unbranded version of Google Chrome. While it’s nice I’m still a hardened Firefox user and so I keep Chromium installed but I don’t use it unless diagnosing a browser-specific issue.

I have Firefox selected in “Preferences > Preferred Applications” as my default browser, however hyper-links in emails were still insisting on opening up in Chromium, which takes time as it’s rarely pre-loaded when I’m using the computer.

To fix this I ran this command in a terminal:

sudo update-alternatives --config x-www-browser

This provides some options for a preferred browser, I had two for Chromium and a third for Firefox, I entered the number for Firefox and from then on, no more closing unwanted browsers!

Installing SpiderOak client on a headless 64bit Ubuntu server

SpiderOak is a fine example of secure cloud backup done right, I’ve been a happy paying customer for 3 years and run their client on all my computers but when I came to install it on a new headless server however I ran into problems. For the uninitiated, “headless” means there is no screen, I’m connected via a terminal which cannot handle graphics. Normally the SpiderOak client is a graphical application but it will also run from a terminal, which is a bit of a nasty bodge but at least it works!

When I first installed the Debian package using dpkg, then ran the application for the first time I got this error:

ImportError: libkrb5.so.3: cannot open shared object file: No such file or directory

This should be simple enough to resolve installing libkrb.5-3 from the Ubuntu repositories, but it’s not that simple because although SpiderOak supplies both 32bit and 64bit packages, the software in both packages is 32bit, so you need to install the 32bit version of libkrb5-3, like this:

sudo apt-get install libkrb5-3:i386

Once complete you can continue the SpiderOak setup. Be warned though, running the application without the –setup parameter however will error due to other missing libs, but these are only necessary for running the GUI version of the application.

GTK theming QT apps

It’s becoming more common to run a mixture of apps using the QT toolkit (as seen in the KDE desktop) and the GTK toolkit (as seen in GNOME desktop). When using a GTK-based desktop, QT apps may appear out of place by not following the GTK theme settings, this can be fixed using ‘qtconfig’ as follows:

From a console run:

qtconfig qt4

From the graphical menu pull down the “Select GUI style” option and select “GTK+”. Click ‘file’ then ‘save’ and any running QT apps should instantly re-theme and look a lot better!

If ‘qtconfig’ is not installed, it can be installed on apt-based systems by entering:

sudo apt-get install qt4-qtconfig