This project has moved. For the latest updates, please go here.
This tutorial explains how you can add USB memory to your RPi to make a backup of SBFspot.db
Optional you can send an e-mail when finished.

Login via SSH to your RPi. Windows users can use Putty or my favorite SmarTTY

Part 1: Add USB memory

Insert the memory stick in an empty USB slot, and enter following commands:
pi@raspberrypi:~ $ sudo ls /dev/sd*
/dev/sda  /dev/sda1

In this case it's easy as there is only 1 device. USB memory is sda (sda1 is the first partition)
If you have more devices connected, you will see /dev/sdb, /dev/sdc and so on.

Find out which file system:

pi@raspberrypi:~ $ sudo blkid /dev/sda1
/dev/sda1: UUID="6F1A-ACE9" TYPE="vfat" PARTUUID="042ed38f-01"

File system = vfat (FAT32 - this is OK if you want to read it from Windows)

Mount the USB Memory:

pi@raspberrypi:~ $ sudo mkdir /mnt/usb_backup
pi@raspberrypi:~ $ sudo mount /dev/sda1 -t vfat /mnt/usb_backup

Make it auto mounting at boot:

Add a line at the end of /etc/fstab - Use TAB key to separate items
pi@raspberrypi:~ $ sudo nano /etc/fstab
/dev/sda1	mnt/usb_backup	vfat	defaults,noatime,uid=1000,gid=1000,umask=000	0	0

Add symlink to USB memory

pi@raspberrypi:~ $ cd smadata
pi@raspberrypi:~/smadata $ mkdir backup_usb
pi@raspberrypi:~/smadata $ ln -s /mnt/usb_backup backup_usb

Verify if everything is OK

pi@raspberrypi:~/smadata $ ls -al
drwxr-xr-x 3 pi pi     4096 Dec  6 21:11 2016
drwxr-xr-x 3 pi pi     4096 Mar 11 09:47 2017
-rwx------ 1 pi pi 36777984 May 18 21:30 SBFspot.db
lrwxrwxrwx 1 pi pi       15 Nov  4  2016 backup_usb -> /mnt/usb_backup
drwxr-xr-x 2 pi pi    20480 May 18 07:40 logs

Next: Compress and Backup

Last edited May 18 at 9:06 PM by SBF, version 4