1 Restoration script for full linux backup
2 ========================================
7 Before you'll be able to restore your system from backup, you have to do
10 1. Get an USB thumb drive or external HDD big enough to hold entire
11 content of our notebook's SSD.
12 2. Install gparted-live into beginning of this disk
13 3. Format rest of this disk (gparted would take no more than half of GB
14 at the beginning) as ext4 system
15 4. Install rsnapshot on your machine and set up it to make backup into
17 /media/${your name}/${label of your USB partition}/${hostname}
19 If you have big usb HDD and several notebooks, you can backup all of
21 You should backup everything including /boot/efi, although you can
22 omit mozilla cache and other thinks which are likely to change during
25 5. Do first backup. Do:
27 echo p |fdisk /dev/nvme0n1 > partitions.layout
29 copy restore script into root of your backup partition.
34 Don't forget to insert this USB drive into your notebook and run
35 rsnapshot with appropraite argument as root on regular basis.
37 Use alpha/beta/gamma modes of rsnapshots, so you'll store daily backups
38 for last week, weekly ones for last month and several monthly ones.
40 Restore old files occasionaly
41 -----------------------------
43 Sometimes you'll find out that you have incedently removed or modified
44 some file. You can than plug your backup drive in and get yesterday's or
50 When your SSD drive dies, or have been irrepairable wiped out,
51 or hit by trojan or cryptolocker so it is easier to wipe out then do
54 1. Repair the hardware
55 2. Insert your backup drive in USB port and boot from it. Mount your
56 second partition under, say /mnt
57 3. From parted-live GUI create neccessary partitions. You can consult
58 partitions.layout file which you have created while preparing backup.
59 Don't forget create vfat partion for /boot/efi, if you are using uefi
61 4. Mount newly created root partition under, say /target
62 and if you unse separate partions for /home, /var or anything else,
63 mount them on /target/home, /target/var etc.
64 Don't forget to mount /target/boot/ef
69 IF you keep backup for several
70 compiters on one disk or want to restore not the latest daily backup,
71 specify backup directory
74 restore mynote/beta.1 /target
81 You can use this restoration procedure when you are upgrading your main
82 SSD - no need to search for USB SATA or USB NVME controller to copy data
83 from old disk. That is why we don't create partitions from script. User
84 may want to rearrange partition layout or just restore system on bigger