gedankensplitter/backupNAS.md
2022-06-26 13:08:27 +02:00

2.5 KiB

keywords
IT

Backup odroid NAS

onsite backup

/dev/mmcblk0
http://www.fsarchiver.org/Main_Page
Full Backup, wöchentlich 
dd if=/dev/mmcblk0 bs=1M |pv | dd of=$backupDir/backup.img
MBR/EBR backup
sudo apt-get install sfdisk
sudo sfdisk -d /dev/mmcblk0 > $backupDir/partition_table.txt
sudo sfdisk /dev/mmcblk0 < $backupDir/partition_table.txt
#backup bootloader
#get first partition sector
sudo sfdisk -l /dev/mmcblk0

#backup bootloader
sudo dd if=/dev/mmcblk0 of=$backupDir/bootloader.bin bs=512 count=$BeginSektor
#restore bootloader
sudo dd if=$backupDir/bootloader.bin of=/dev/mmcblk0 bs=512 skip=1 seek=1
#Bootstrap restore
sudo dd if=$backupDir/bootloader.bin of=/dev/mmcblk0 bs=446 count=1

#backup ext4 partition while mounted
$ sudo fsarchiver -o -v -A -j 4 savefs $backupDir/partition_2.fsa /dev/mmcblk0p1

offline backup

# copy 'empty' blocks to preserve partition table, bootloader, second bootloader..
sudo dd if=/dev/mmcblk0 of=/dev/sdc bs=512 count=8192
# backup partition table separately
sudo sfdisk -d /dev/mmcblk0 > partition_table.txt
# restore partition table to match partitions uuids, patch different partitions size! (like whole sectors minus beginning sector)
sudo sfdisk /dev/mmcblk0 < partition_table.txt
#restore root partition after offsite image backup
sudo partclone.ext4 -d2 -b -s /dev/loop0p1  -o /dev/sdc1

/etc -inkrementelles Backup -merge Backups (welche Kriterien) -verschlüsselt (ssl keys) http://dar.linux.free.fr/doc/mini-howto/dar-differential-backup-mini-howto.en.html#the-backup-strategy dar -c /mnt/backup/etc_initial --compression=lzo -s 50M -M -R /etc --hash sha1 --user-comment "%d: %c" -Z ".gz" -Z ".bz2" -Z ".zip" -Z ".png" dar -C /mnt/backup/etc_date -I.cat /mnt/backup/etc_initial --user-comment "%d: %c" dar -c /mnt/backup/etc_initial --compression=lzo -s 50M -M -R /etc --hash sha1 --user-comment "%d: %c" -Z ".gz" -Z ".bz2" -Z ".zip" -Z ".png" -A /mnt/backup/etc_initial

/var/* -incrementelles Backup -merge Backups (welche Kriterien) -verschlüsselt (ssl keys) /home/* -syncthing --Fullbackup --täglich Datenbank und config sichern -verschlüsselt (ssl keys) /root --Fullbackup -verschlüsselt (ssl keys)

Nextcloud --täglich Datenbank Dump und cloud_data -verschlüsselt

duplicati backend

client

the data source aka client holds a local database to be fast. this db does not get copied to the remote target. the remote target only contains dlist.zip.aes, dindex.zip.aes and dblock.zip.aes files. duplicati-cli repair {filepath}