framps / raspiBackup

Backup your Raspberry
https://raspibackup.linux-tips-and-tricks.de
GNU General Public License v3.0
751 stars 73 forks source link

Allow to specify for partition oriented backup which partitions should be restored #749

Open framps opened 2 months ago

framps commented 2 months ago

As of now all partitions are restored. Similar to option -T (DEFAULT_PARTITIONS_TO_BACKUP) which is used to define the number of partitions which should be saved the same option should define the partitions to restore when a restore is executed.

Default will be to restore the first two partitions only (Option DEFAULT_PARTITIONS_TO_RESTORE="1 2") which is identical to DEFAULT_PARTITIONS_TO_BACKUP. All partitions will be restored with parameter *

Example: sudo raspiBackup -d /dev/sda -T "1 2 3" will restore the first two partitions and the third partition and will keep all other partitions untouched.

Note: If not all partitions are restored the partitions have to exist already on the restore device and no partitioning is done. The partitions are allocated if either parameter * is used or the partitions to restore match the partitions included in the backup.

If existing partitions are reused the partitions are formatted first to clean the partition.