Projekt

Allgemein

Profil

Aktionen

Raspi

als TimeMachine

Basis der Anleitung sind

pi hat selbstvertändlich ein sicheres Passwort bekommen.
Der Raspi heißt PiMachine.local

Time Machine aufsetzen

  • buster-lite auf SD-Card brennen
  • ssh (leere Datei) in boot anlegen
  • booten
  • sudo raspi-config (dort Password und Hostnoame setzten)
  • sudo update
  • sudo upgrade
Installation der Programme hfsutils hfsprogs netatalk
  • sudo apt install hfsutils hfsprogs netatalk
Konfiguration:
  • ls -lha /dev/disk/by-uuid
  • mkdir /media/tm

/etc/fstab:

UUID=b05d568d-89a3-33c3-a200-66f51cd59e3c /media/tm hfsplus force,rw,user,noauto 0 0

/etc/nsswitch.conf

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files
group:          files
shadow:         files
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

/etc/netatalk/afp.conf

;
; Netatalk 3.x configuration file
;

[Global]
; Global server settings
  mimic model = TimeCapsule6,106

; [Homes]
; basedir regex = /xxxx

; [My AFP Volume]
; path = /path/to/volume

[Time Machine]
  path = /media/tm
  time machine = yes

Passwort

Der user pi braucht ein Passwort, damit sich die Macs anmelden können

sudo passwd pi

CRON

Die Dienste und die USB-Platte werden nach dem Booten verzögert gestartet, da sonst die USB-Platte manchmal R/O ist:

sudo crontab -e

und in der root-Crontab:
@reboot sleep 30 && mount /media/tm && sleep 30 && umount /media/tm && sleep 30 && mount /media/tm && sleep 30 && service avahi-daemon start && service netatalk start

Spin Down Disk

hdparm kann zwar die Platte ausschalten, aber keine Advanced Power Level setzen.
Daher kommt hd-idle zum Einsatz.
Siehe https://www.htpcguides.com/spin-down-and-manage-hard-drive-power-on-raspberry-pi/

/etc/default/hd-idle

# defaults file for hd-idle

# start hd-idle automatically?
START_HD_IDLE=true

# hd-idle command line options
# Options are:
#  -a <name>               Set device name of disks for subsequent idle-time
#                          parameters (-i). This parameter is optional in the
#                          sense that there's a default entry for all disks
#                          which are not named otherwise by using this
#                          parameter. This can also be a symlink
#                          (e.g. /dev/disk/by-uuid/...)
#  -i <idle_time>          Idle time in seconds.
#  -l <logfile>            Name of logfile (written only after a disk has spun
#                          up). Please note that this option might cause the
#                          disk which holds the logfile to spin up just because
#                          another disk had some activity. This option should
#                          not be used on systems with more than one disk
#                          except for tuning purposes. On single-disk systems,
#                          this option should not cause any additional spinups.
#
# Options not exactly useful here:
#  -t <disk>               Spin-down the specfified disk immediately and exit.
#  -d                      Debug mode. This will prevent hd-idle from
#                          becoming a daemon and print debugging info to
#                          stdout/stderr
#  -h                      Print usage information.
HD_IDLE_OPTS="-i 0 -a sda -i 180 -l /var/log/hd-idle.log" 

Von Martin Meier vor etwa 1 Jahr aktualisiert · 5 Revisionen