LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-03-2024, 10:01 AM   #1
K.H.Braun
LQ Newbie
 
Registered: Dec 2019
Distribution: Slackware
Posts: 15

Rep: Reputation: Disabled
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?

Thanks in advance for your help!
 
Old 05-03-2024, 10:18 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,071

Rep: Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364
assuming you destroyed only / (root filesystem) boot another OS and restore it.
Would be nice to know what's going on, what's happening.

Another way can be to reinstall slackware and overwrite it from the backup, but again, would be nice to know what should be restored.
 
Old 05-03-2024, 11:02 AM   #3
rizitis
Member
 
Registered: Mar 2009
Location: Greece,Crete
Distribution: Slackware64-current, Slint
Posts: 714
Blog Entries: 2

Rep: Reputation: 523Reputation: 523Reputation: 523Reputation: 523Reputation: 523Reputation: 523
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
Code:
rsync -av /mnt/backup_efi/* /boot/efi/
rsync -av /mnt/backup_root/* /
rsync -av /mnt/backup_usr/* /usr/
Update /etc/fstab
 
Old 05-03-2024, 12:13 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,472

Rep: Reputation: 2354Reputation: 2354Reputation: 2354Reputation: 2354Reputation: 2354Reputation: 2354Reputation: 2354Reputation: 2354Reputation: 2354Reputation: 2354Reputation: 2354
Quote:
Originally Posted by K.H.Braun View Post
Hi Folks
I have just trashed my Slackware system. It refuses to let me login using known good passwords

I do have rsync backups ............
That funny familiar feeling of thrashing your system that so many of us have had...

It doesn't follow that just because you can't log in, every byte of your system is destroyed. So in light of this joke
Quote:
Originally Posted by Billy Connolly
Who discovered you could get milk from cows, and what did he think he was doing at the time?
What was going on at the time? Are you sure everything has to be redone? What did you think you were doing at the time?
 
Old 05-03-2024, 04:00 PM   #5
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,150
Blog Entries: 21

Rep: Reputation: 3484Reputation: 3484Reputation: 3484Reputation: 3484Reputation: 3484Reputation: 3484Reputation: 3484Reputation: 3484Reputation: 3484Reputation: 3484Reputation: 3484
Gee. No df -h posted in this thread.

No sudo parted -l either?

Maybe all the OP did was improper shutdown which corrupted the file system.

If so. Running a live gparted session and unmounting drives and doing checks on partitions Is how I fix that on my boxes.

business_kid probably hit the nail on the head.
 
Old 05-04-2024, 03:22 PM   #6
mrsam
LQ Newbie
 
Registered: Jan 2024
Distribution: Fedora, Ubuntu, Slackware
Posts: 13

Rep: Reputation: 11
Use a live image

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).
 
Old 05-04-2024, 03:30 PM   #7
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,399

Rep: Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595
IMHO, the problem is on / or /usr, leave the efi partition alone, attempt to fix the other two partitions.
 
Old 05-04-2024, 05:56 PM   #8
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,773

Rep: Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770
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.)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
UEFI Class 3 :: To use UEFI, or not to use UEFI? jheengut Slackware 19 12-30-2020 09:24 AM
[SOLVED] Install non-UEFI system from a UEFI USB? andrew.46 Slackware 10 04-08-2020 11:28 PM
[SOLVED] Backup and restore using rsync/ssh keirvt Linux - Security 4 12-26-2014 02:14 AM
[SOLVED] Full rsync restore from backup causing boot errors pobrika Linux - Server 4 01-16-2014 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration