how to restore an entire UEFI system from an rsync backup
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to restore an entire UEFI system from an rsync backup
Hi Folks
I have just trashed my Slackware system. It refuses to let me login using known good passwords
I do have rsync backups of of the 3 filesystems that comprise this installation of Slackware64-14.0.
These 3 filesystems are mounted on /boot/efi, / and /usr.
SO:
Since the slackware on my box box is tentoesbellyupdead How can I
restore the entire system from the 3 backups?
something like this:
access the filesystems and perform the restoration without interference from the potentially corrupted system.
Mount the drives containing your backups. Since you have backups of the /boot/efi, /, and /usr filesystems, you'll need to mount these
Code:
mkdir /mnt/backup_efi
mkdir /mnt/backup_root
mkdir /mnt/backup_usr
mount /dev/sdX1 /mnt/backup_efi # Replace sdX1 with the appropriate partition for /boot/efi
mount /dev/sdX2 /mnt/backup_root # Replace sdX2 with the appropriate partition for /
mount /dev/sdX3 /mnt/backup_usr
The fact that this is apparently an UEFI-based system adds more excitement to this situation.
Boot a live ISO image. Any Linux distro live image would work, but if one insists on Slackware, a brief Google search finds https://download.liveslak.org/ Follow the live image's instructions to create a bootable USB stick with the live image. Shove in the USB stick. Go into your hardware BIOS and do whatever needs to be done to boot from the USB stick.
With this out of the way, after booting the live image you should be able to mount your USB stick with your backups, run fdisk to repartition your hard drive, mkfs the partitions, and rsync-restore them. Important: the /boot/efi partition must be a vfat partition, not ext4. Additionally, since this was, apparently, an EFI-based system you must use fdisk to create a GPT, and not legacy BIOS partitions.
Once everything has been rsync-ed over, you'll need to head back into your system's BIOS set up and figure out how to configure its EFI loader to boot from the rsynced system. It's fairly likely that playing with fdisk ended up generating new GPT partition table, which would invalidate any previous EFI configuration.
In desparate times one might choose to forget about EFI, and create a legacy BIOS partition. Note that this path will require mounting the hard disk partition, chroot-ing into them, and then running grub-install to install the grub bootloader (I forget the equivalent incantation for LILO).
And after he gets things working again perhaps learning how to do partition and device backups rather than just file backups. (BOTH together is far better than either one alone.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.