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](https://gparted.org/livecd.php) 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](https://rsnapshot.org/) on your machine and set up it to make backup into
17 /media/${your name}/${label of your USB partition}/${hostname}
19 Or whereever your desktop enviroment mountes removable disks.
21 If you have big usb HDD and several notebooks, you can backup all of
23 You should backup everything including /boot/efi, although you can
24 omit mozilla cache and other thinks which are likely to change during
27 5. Do first backup. Do:
29 echo p |fdisk /dev/nvme0n1 > partitions.layout
32 copy restore script into root of your backup partition.
37 Don't forget to insert this USB drive into your notebook and run
38 rsnapshot with appropraite argument as root on regular basis.
40 Use alpha/beta/gamma modes of rsnapshots, so you'll store daily backups
41 for last week, weekly ones for last month and several monthly ones.
43 Restore old files occasionaly
44 -----------------------------
46 Sometimes you'll find out that you have incedently removed or modified
47 some file. You can than plug your backup drive in and get yesterday's or
53 When your SSD drive dies, or have been irrepairable wiped out,
54 or hit by trojan or cryptolocker so it is easier to wipe out then do
57 1. Repair the hardware
58 2. Insert your backup drive in USB port and boot from it. Mount your
59 second partition under, say `/mnt`
60 3. From parted-live GUI create neccessary partitions. You can consult
61 partitions.layout file which you have created while preparing backup.
62 Don't forget create vfat partion for `/boot/efi`, if you are using uefi
64 4. Mount newly created root partition under, say `/target`
65 and if you unse separate partitions for `/home`, `/var` or anything else,
66 mount them on `/target/home`, `/target/var` etc.
67 Don't forget to mount `/target/boot/efi`
68 5. Cd to `/mnt` and run
72 IF you keep backup for several
73 compiters on one disk or want to restore not the latest daily backup,
74 specify backup directory
77 restore mynote/beta.1 /target
84 You can use this restoration procedure when you are upgrading your main
85 SSD - no need to search for USB SATA or USB NVME controller to copy data
86 from old disk. That is why we don't create partitions from script. User
87 may want to rearrange partition layout or just restore system on bigger