UEFI BIOS + GRUB Bootloader Debian Install



Making Clone/Backup of Working System


Many PC's have only UEFI bioses. Generally Debian boot USB sticks using Grub seem able to cope with most of the UEFI bios quirks.
It was helpful to duplicate existing installations rather than going through the rigmarole of package installation and configuration.
I have made a python3 script which duplicates an installed system and makes a bootable target copy or vice versa. It has proved useful so I am making it downloadable with no guarantees as two files here.
Main File and Includes
If the script is executed without parameters a helpfile is printed.
The script will overwrite any existing operating systems on the target device such as Windows and all data!
The target drive is divided into two partitions (boot and root) and assumes a swapfile is to be used. Packages gparted,initramfs-tools and util-linux are needed. The target partition is upgraded using apt and initramfs before executing grub.
After using this script to install a release on a pc the hostname needs to updated, and a swapfile generated. I may update the script to include this as an option.