Skip to content

Timecapsule set up for large scale wireless backup using rpi

Notifications You must be signed in to change notification settings

alhockly/pi-wireless-drive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-wireless-drive

Options for large wireless backup using rpi

for small files consider a pi git repo:

https://github.com/alhockly/pi-gitserver


MacOS / Time Machine options: (This is just a samba (smb) server with config for TimeMachine on MacOS, it is also accessible on Windows as a network drive)

Samba docs: https://www.samba.org/samba/docs/current/man-html/samba.7.html

requires: pi zero (or pi zero wireless), usb hub, usb-ethernet adapter (or usb wifi), usb HDD You must you a ext4 file system for this method

pi

sudo apt-get install samba avahi-daemon say no in Samba config

SAMBA VERSION MUST BE 4.8 OR HIGHER. You can check your version using smbd -V If samba 4.8 or higher is not available for your distro/archtecture you may find it on launchpad: https://launchpad.net/~linux-schools/+archive/ubuntu/samba-latest/+packages or at the van belle apt repo http://apt.van-belle.nl/

alternatively it can be build from source but this is not for the faint of heart https://www.linuxsecrets.com/samba-wiki/index.php/Build_Samba_from_Source.html

  1. change the pi host name in sudo nano /etc/hostname and sudo nano /etc/hosts , format disk to ext4 e.g sudo mkfs.ext4 /dev/<disk parition>

  2. lsblk to show connected external devices and sudo parted -l to show disk partitions and file systems

  3. setup fstab to mount your external disk (ext4) https://askubuntu.com/a/165462 use sudo mount -av to mount e.g /dev/sda1 /media/disk ext4 defaults,auto,uid=1000,gid=1000,users,rw,nofail 0 0

  4. add sudo mount /dev/sda1 /media/disk to crontab. (crontab -e)

  5. configure samba sudo nano /etc/samba/smb.conf , use the one below as a template. You should only need to change the lines under the [Time Capsule] definition

    https://github.com/alhockly/pi-wireless-drive/blob/master/smb.conf

  6. check config is correct with sudo testparm -s

  7. restart samba sudo service smbd restart

  8. add user to samba sudo smbpasswd -a <username>

  9. enable new user sudo smbpasswd -e <username>

  10. copy timemachine.service from this repo to /etc/avahi/services

  11. shutdown pi and connect the disk to mac via usb

Mac

  1. check network in finder and you should see the samba share by its hostname. if not go to Finder > Go > Connect to server then enter smb:// <ip address>
  2. use diskUtility to save a sparsebundle image on the samba share
  3. mount the spare bundle
  4. run sudo tmutil setdestination /Volumes/<bundle name>
  5. add time machine backup in system preferences

(if using a spinning disk)

pi

  1. sudo apt install hdparm
  2. use blkid to find the uuid of the disk you are using
  3. sudo hdparm -S 120 /dev/disk/by-uuid/ \< uuid of disk\>
  4. We can make this permanent by adding a stanza to /etc/hdparm.conf:

eg.

/dev/disk/by-uuid/e613b4f3-7fb8-463a-a65d-42a14148ea65 { spindown_time = 120}

(if you want to make the enclosure) - requires (M2,7 or M3) & M5 bolts

  1. print the main body. The orientation should have the mouth of the drive enclosure pointing upwards
  2. print the pi cover
  3. connect power and usb hub cables to pi
  4. decide if you want to drill the mounting holes on your pi wider to accomedate M3 bolts (I did, with a hand drill)
  5. screw bolts through the pi cover, the pi itself and into the main body
  6. insert the hdd into the enclosure and screw in M5 bolts to stop it from falling out

some articles I used

[install samba on pi] https://mudge.name/2019/11/12/using-a-raspberry-pi-for-time-machine/ [time machine on remote share] https://www.imore.com/how-use-time-machine-backup-your-mac-windows-shared-folder https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X https://www.thedigitalpictureframe.com/installing-samba-on-your-raspberry-pi-buster-and-optimizing-it-for-macos-computers/ https://surrouter.asuscomm.com/surblog/2019/05/05/mac-timemachine-with-samba-4-8-on-ubuntu-18-10/

AFP is deprecated https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/APFS_Guide/FAQ/FAQ.html#//apple_ref/doc/uid/TP40016999-CH6-DontLinkElementID_1

About

Timecapsule set up for large scale wireless backup using rpi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published