Netatalk does everything Apple Time Capsule does, for a lot less money

Getting Ready

To begin, you should write the image file of the operating system onto the SD card. However, it is not sufficient just to unpack and copy the file onto the SD card. After following the detailed instructions on the eLinux website  [5], insert the SD card you have prepared into the SD Card slot and connect only the keyboard and monitor.

The Raspberry Pi does not have a power switch. Instead, the boot process begins as soon as you connect a power supply. If the LED power light is a weak red and nothing else is happening, then either the Rasp Pi has not been able to read the SD card that has been inserted, or the image file was not written correctly on the card. If the system boots, you land in the Raspberry Pi Software Configuration Tool (raspi-config).

Once the system is up and running, the user pi is automatically assigned the password raspberry. You should be careful when entering a new password because the system is pre-configured to start with an UK-style keyboard layout. As a result, some letters and symbols are interchanged. Therefore, it is a good idea to set up the keyboard first by choosing option  4 Internationalisation Options.

Under option  3, Enable Boot to Desktop/Scratch, you can select the option to start in the text console; the system does not need a graphical desktop. Additionally, you should activate the so-called Secure Shell under option  8, Advanced Options, so that you can maintain the computer without a keyboard and screen if you need to. After you have completed the setup, you can close the tool with Finish and restart the computer.

Installing Backup Storage

Connecting a single external hard drive is simple: Enter

sudo tail -f /var/log/syslog

then plug in the hard drive and watch the output on the screen until you see a line similar to:

sd 0:0:0:0: [sda] Attached SCSI Disk

Stop the listing with Ctrl+C. Provided your hard disk is sda, the list of partitions follows on another line. The SD card will be named mmcblk0, and the partitions on it are named mmcblk0p1 and mmcblk0p2, respectively.

Do not be concerned, even if nothing happens for more than 30 seconds. The Raspberry Pi can sometimes be fussy. Depending on the USB hub and hard disk, the Raspberry Pi may recognize the storage medium only after a reboot, so you should restart the computer while the hard disk is connected and enter lsblk.

At this point, the hard disk should appear as device sda with, as the case may be, further entries for partitions.

Now, you can call up the text-based fdisk partition program with:

sudo fdisk /dev/sda

The program might issue a warning, such as

Warning: invalid flag 0x0000 of partition table 4 will be corrected byw (rite)

which indicates that the hard disk is not yet partitioned, or, if text appears, that the original partition table has been discarded and no valid table is currently available.

You should press the next series of keys followed by Enter each time: O creates a new and empty partition table, N creates a new partition, and P makes it a primary partition.

To make this the first partition, assign it the number 1. Now confirm that the partition begins at the beginning of the hard disk (Enter) and that you would like to utilize all of the space on the hard disk.

You can assign partition type HFS+ (the Mac journaling filesystem) to the newly created partition by pressing T and typing af for the partition code; confirm this by pressing Enter. W writes the changes to the hard disk, and pressing Enter confirms and exits.

Before formatting the partition with a filesystem, make sure to read in the partition tables again with the command:

sudo partprobe

If the command does not cause any errors, then you can continue with formatting; otherwise, you should restart the system with

sudo reboot

Before formatting the partition, you will need the HFS tools. First, you should make sure the list of software packages is up to date by issuing:

sudo apt-get update

Now, you can install the suitable software programs with

$ sudo apt-get install hfsplus hfsprogs

and format the partition,

$ sudo mkfs.hfsplus -s -J -v <partition name> <device file>

naming the partition as desired. In this example, the name of the device file is /dev/sda1.

For your setup, you should change the device and the path name accordingly. Afterward, you should execute the commands:

$ sudo cp -v /etc/fstab{,.orig}
$ echo -e "UUID=$(sudo blkid -o value -s UUID /dev/sda1)\t/var/timemachine\thfsplus\tforce,rw\t0 0" | sudo tee -a /etc/fstab

Make sure to review carefully each character of the echo command line before executing it. The command creates an additional entry in the filesystem that defines the mountpoint of the partition created on /var/timemachine and declares the filesystem options. The last command creates a backup copy of the /etc/fstab file named /etc/fstab.orig.

The install command is better suited than the mkdir command for specifying access rights. Once you have created the directory, you can instruct the system to mount all of the partitions configured in the/etc/fstab file:

$ sudo install -o nobody -g nogroup -m 775 -d /var/timemachine
$ sudo mount -a

If all goes well, you are not presented with any output or errors. When you enter the command

$ sudo ls -la /var/timemachine

you should find at least one file called .journal in the directory. If this is not the case, there is a problem in the configuration.

Buy this article as PDF

Express-Checkout as PDF

Pages: 8

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content