RPi BackUp: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
<syntaxhighlight lang="bash" line='line'> | <syntaxhighlight lang="bash" line='line'> | ||
+ | #find device: | ||
+ | pi@raspberrypi:~ $ lsblk -p | ||
+ | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | ||
+ | /dev/mmcblk0 179:0 0 29.9G 0 disk | ||
+ | /dev/mmcblk0p1 179:1 0 60M 0 part /boot | ||
+ | /dev/mmcblk0p2 179:2 0 3.7G 0 part / | ||
+ | |||
#remote backup command to win machine: | #remote backup command to win machine: | ||
− | ssh pi@192.168.8.3 "sudo dd if=/dev/mmcblk0 bs=1M | gzip -" | dd of=~/winhome/Desktop/ASWPiBackup.gz | + | #first check local drive names! (/c/windows; /windrive/c/ etc. depending on terminal) |
+ | # -t option only use for (pseudo)tty | ||
+ | ssh -t pi@192.168.8.3 "sudo dd if=/dev/mmcblk0 bs=1M | gzip -" | dd of=~/winhome/Desktop/ASWPiBackup.gz | ||
+ | # sudo -S option is for forcing read sudo password from stdin | ||
+ | ssh pi@192.168.178.20 "sudo -S dd if=/dev/mmcblk0 bs=1M | gzip -" | dd of=/drives/e/Images/TurtlePiBackup.gz | ||
+ | |||
+ | #opt use pishrink to fit size of image: | ||
+ | #https://www.bachmann-lan.de/raspberry-pi-backup-image-mit-pishrink-verkleinern/ | ||
+ | #https://github.com/Drewsif/PiShrink/ | ||
#playback: | #playback: | ||
#unmount SDCard first, then | #unmount SDCard first, then | ||
− | gzip -dc | + | gzip -dc ASWPiBackup.gz | sudo dd of=/dev/rdisk# bs=1m conv=noerror,sync |
</syntaxhighlight> | </syntaxhighlight> |
Aktuelle Version vom 13. Januar 2021, 10:43 Uhr
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