RPi BackUp
Zur Navigation springen
Zur Suche springen
1 #find device:
2 pi@raspberrypi:~ $ lsblk -p
3 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
4 /dev/mmcblk0 179:0 0 29.9G 0 disk
5 /dev/mmcblk0p1 179:1 0 60M 0 part /boot
6 /dev/mmcblk0p2 179:2 0 3.7G 0 part /
7
8 #remote backup command to win machine:
9 #first check local drive names! (/c/windows; /windrive/c/ etc. depending on terminal)
10 # -t option only use for (pseudo)tty
11 ssh -t pi@192.168.8.3 "sudo dd if=/dev/mmcblk0 bs=1M | gzip -" | dd of=~/winhome/Desktop/ASWPiBackup.gz
12 # sudo -S option is for forcing read sudo password from stdin
13 ssh pi@192.168.178.20 "sudo -S dd if=/dev/mmcblk0 bs=1M | gzip -" | dd of=/drives/e/Images/TurtlePiBackup.gz
14
15 #opt use pishrink to fit size of image:
16 #https://www.bachmann-lan.de/raspberry-pi-backup-image-mit-pishrink-verkleinern/
17 #https://github.com/Drewsif/PiShrink/
18
19 #playback:
20 #unmount SDCard first, then
21 gzip -dc ASWPiBackup.gz | sudo dd of=/dev/rdisk# bs=1m conv=noerror,sync