Page 1 of 1

Using Isobooter & rsync to create a EFI and BIOS bootable backup of your current Puppy/Dog

Posted: Sun Apr 16, 2023 6:20 pm
by dancytron

Bill @rcrsn51 deserves most of the credit for isobooter and his deblive multi-installer script (deblive-multi-installer-4).

I just wrote the rsync backup script, which has zero safeties built into it other than warning you that you can nuke whole partitions at a time if you aren't careful. Feel free to use any other method to back up your main OS folder. I like to open and read the script and compare it to the names of the drives before I run it from a terminal. sdb2 can be sdc2 sometimes.

1. Follow Bill's @rcrsn51's instructions 1-7 here to create your ISObooter usb disk. viewtopic.php?p=3615#p3615 Make sure the Fat32 partition is big enough to hold a couple of puppy/dog .iso files. It can boot to either Bios or EFI computers!!!!!!!

2. For step 8 use Bill's multi installer to install from an .iso file whatever version of Dog or Puppy you are using, or at least close enough the grub entry will be the same, as a fresh install to an empty directory on sdb2. It will generate a /mnt/sdb2/YourDirectoryName/grubmenu.txt file like this one for DD or one for Puppy as the case may be (only tested for DD).

Code: Select all

set timeout=10

menuentry "10-5-22-.Clean.xz.ChromelessBullseyePulseDog-custom on sdb2" {
  echo "Booting ..."
  search --no-floppy --fs-uuid --set=root 4589394b-7d92-40d6-acc2-a7a043c369a5
  linux /PulseBullseyeDog/live/vmlinuz1 edd=off noauto from=UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/PulseBullseyeDog changes=EXIT:UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/PulseBullseyeDog
  initrd /PulseBullseyeDog/live/initrd1.xz
}

menuentry "10-5-22-.Clean.xz.ChromelessBullseyePulseDog-custom on sdb2 CleanMode" {
  echo "Booting ..."
  search --no-floppy --fs-uuid --set=root 4589394b-7d92-40d6-acc2-a7a043c369a5
  linux /PulseBullseyeDog/live/vmlinuz1 edd=off noauto copy2ram from=UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/PulseBullseyeDog
  initrd /PulseBullseyeDog/live/initrd1.xz
}

menuentry "Reboot" {
  reboot
}

menuentry "Power off" {
  halt
}

3. Cut and paste the entries into the /mnt/sdb1/EFI/grub/grub.cfg file. Edit the menuentry and "booting ..." lines so you know what everything is. To test on a bios machine, go to step 6 to edit /mnt/sdb1/menu.lst.

4. Then create a new directory on sbd2 and create a rsync script to copy your daily driver puppy or dog to it. In our example, we are copying sda6/First on my laptop to sdb2/LaptopFirst on the usb drive. See the script below which should be self explanatory. edit:sample of adding safety check to see if drives are mounted. thanks @jafadmin viewtopic.php?p=87067#p87067

Code: Select all

#!/bin/bash

#backup sda6/First to Isobooter Disk
#https://wiki.archlinux.org/index.php/Rsync#As_a_backup_utility
#see https://askubuntu.com/questions/98597/increase-verbosity-of-running-rsync-process for logging and verbose options

#MAKE SURE ALL DISKS ARE MOUNTED

echo MOUNT ALL DISKS 1ST backing up sda6/First to IsoBooter Disk


#copy changes folder and os folder separately

rsync -ai --progress --delete /mnt/sda6/First/changes /mnt/sdb2/LaptopFirst ; rsync -ai --progress --delete /mnt/sda6/First/live /mnt/sdb2/LaptopFirst

echo Backup Complete - Press Enter to Close
read 

5. Use leafpad search and replace construct 2 grub.cfg entries for the sdb2/LaptopFirst directory and put them into the grub.cfg file. Fill out menuentry and echo lines with detail to keep track of what's what.

Code: Select all

 menuentry "from sda6/First on sdb2/LaptopFirst" {
  echo "Booting sda6/First on sdb2/LaptopFirst ..."
  search --no-floppy --fs-uuid --set=root 4589394b-7d92-40d6-acc2-a7a043c369a5
  linux /LaptopFirst/live/vmlinuz1 edd=off noauto from=UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/LaptopFirst changes=EXIT:UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/LaptopFirst
  initrd /LaptopFirst/live/initrd1.xz
}

menuentry "sda6/First on sdb2/LaptopFirst CleanMode" {
  echo "Booting sda6/First on sdb2/LaptopFirst CleanMode ..."
  search --no-floppy --fs-uuid --set=root 4589394b-7d92-40d6-acc2-a7a043c369a5
  linux /LaptopFirst/live/vmlinuz1 edd=off noauto copy2ram from=UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/LaptopFirst
  initrd /LaptopFirst/live/initrd1.xz
}

6. Now convert the /mnt/sdb1/EFI/grub/grub.cfg entries into grub4dos and add them to the /mnt/sdb1/menu.lst using the "grub4dos" tab on the Deblive-multiinstaller, choosing the grub.cfg file, and cutting and pasting the entries that you need into the menu.1st.

This example is after I edited the titles.

Code: Select all

title from laptop sda6/First on to Isobooter sda2/LaptopFirst save on exit
uuid 4589394b-7d92-40d6-acc2-a7a043c369a5
kernel /LaptopFirst/live/vmlinuz1 edd=off noauto from=UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/LaptopFirst changes=EXIT:UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/LaptopFirst
initrd /LaptopFirst/live/initrd1.xz

title laptop sda6/First on to Isobooter sda2/LaptopFirst CleanMode
uuid 4589394b-7d92-40d6-acc2-a7a043c369a5
kernel /LaptopFirst/live/vmlinuz1 edd=off noauto copy2ram from=UUID:4589394b-7d92-40d6-acc2-a7a043c369a5/LaptopFirst
initrd /LaptopFirst/live/initrd1.xz

6. MAKE SURE ALL DRIVES ARE MOUNTED.

Run the rsync script from a terminal window (or from a startup script that runs a terminal window 1st).

7. test to see if it boots and saves changes on both EFI and bios machines if you have them. Boot to hard drive. Test rsync makes incremental changes correctly (including wiping out changes you make when you booted to the usb).

8. Done. You should be able to boot to the last backed up version of your daily driver on virtually any computer if your main computer goes down unless it is an EFI computer totally locked from using a different key.