curl -L https://downloads.raspberrypi.org/raspbian_lite_latest | bsdtar -xvf-
https://downloads.raspberrypi.org/raspios_lite_arm64/images/
Mount on MAC, and do following.
➜ cd /Volumes/boot
➜ touch ssh
➜ touch .metadata_never_index
- put SD-Card to the raspberry
- plug a network cable
- plug external hard-drive
- power the raspberry on
ssh -l pi 10.10.10.150
The authenticity of host '10.10.10.150 (10.10.10.150)' can't be established.
ECDSA key fingerprint is SHA256:lix2FjdBgB9b81S9g0am4LqU3kGQCXyPuXhAZ4qrOJs.
No matching host key fingerprint found in DNS.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.10.10.150' (ECDSA) to the list of known hosts.
pi@10.10.10.150's password:
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l
sudo apt-get update && sudo apt-get full-upgrade
sudo reboot
Add the arm_64bit=1
to the /boot/config.txt
.
sudo raspi-config
Needs to use fdisk first if proper partition is not used.
Create ext4 filesystem.
sudo mkfs.ext4 /dev/sda1
sudo tune2fs -m 1 /dev/sda1
Check for disk UUID.
sudo lsblk -o name,mountpoint,size,uuid
NAME MOUNTPOINT SIZE UUID
sda 894.3G ab61ef70-234e-40c6-9ab6-14cc0c2ecdc2
└─sda1 894.2G
Create a mount point
sudo mkdir /srv/tm
Update /etc/fstab
UUID=ab61ef70-234e-40c6-9ab6-14cc0c2ecdc2 /srv/tm ext4 defaults 0 2
Mount disk
sudo mount /srv/tm/
Create a shared directory
sudo mkdir /srv/tm/shared
sudo chmod 777 /srv/tm/shared
sudo apt-get install samba
/etc/samba/smb.conf
[timemachine]
comment = Time Machine
path = /srv/tm/shared
browseable = yes
writeable = yes
create mask = 0600
directory mask = 0700
spotlight = no
vfs objects = catia fruit streams_xattr
fruit:aapl = yes
fruit:time machine = yes
Start and enable samba
sudo systemctl start smbd
sudo systemctl enable smbd
Add a new samba user. Be sure that a system account exists for this user.
pdbedit -a -u pi
sudo apt-get install hdparm
Try to set 5 minute standby mode to the attached harddisk.
pi@tm:~ $ sudo hdparm -S 60 /dev/sda
/dev/sda:
setting standby to 60 (5 minutes)
Update the /etc/rc.local to set the idle mode during the startup.
/sbin/hdparm -S 60 /dev/sda
pi@tm:~ $ sudo rpi-eeprom-update -a
*** INSTALLING EEPROM UPDATES ***
BOOTLOADER: up-to-date
CURRENT: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
LATEST: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
VL805: update required
CURRENT: 00013701
LATEST: 000137ab
EEPROM updates pending. Please reboot to apply the update.
Restart the raspberry to be sure that all is setup correctly and working upon on system start.
sudo reboot
On MAC, just instruct TimeMachine to use out raspberry to backup.
sudo tmutil setdestination 'smb://pi:YOUR_PASSWORD@10.100.100.150/timemachine'
Before:
sudo sysctl debug.lowpri_throttle_enabled=0
After:
sudo sysctl debug.lowpri_throttle_enabled=1
https://kirb.me/2018/03/24/using-samba-as-a-time-machine-network-server.html#fnref:bzaffiliate
https://www.samba.org/samba/docs/current/man-html/vfs_fruit.8.html
https://blog.shawjj.com/speed-up-time-machine-backups-by-10x-f6274330dc6f