Bare metal restore

Hello,
sorry to reopen this thread.

but i try to backup my linux with server and restore with bare metal restore as you described.

can you explain, please?
i’m lost in various steps…

backup “server” with restic my server is ok
create VM (for testing i use virtualbox) and attach system rescue CD (similar to rescue mode on cloud)
format disk and create primary partition (ext4)
mount /dev/sda1 /mnt/restore

restic -r rclone:… restore latest -v --target /mnt/restore

change uuid in
/mnt/restore/etc/fstab

but i can’t understand
“grub2-install, grub2-mkconfig, dracut -f”

thank you
Alex

Hi,
The last ones are just the steps to initialize the bootloader (grub2) and rebuild initramfs (dracut). I did this in a centos System, steps may vary on other distributions but can usualy be googled for others.

Not sure if you need also help with other steps…?

sorry but i try to restore Centos too but i have problem.

these are the steps that i did

on systemrescue cd after restore with restic i try to
-before restic restore
mount /dev/sda1 /mnt/restore
-after restic restore

nano /mnt/restore/etc/fstab
-change uuid and save

mkdir -p /mnt/restore/dev
mount --bind /dev /mnt/restore/dev
mkdir -p /mnt/restore/proc
mount --bind /proc /mnt/restore/proc
mkdir -p /mnt/restore/sys
mount --bind /sys /mnt/restore/sys
chroot /mnt/restore bash

[root@sysrescue /]# grub2-install
Installing for i386-pc platform.
grub2-install: error: install device isn’t specified.

[root@sysrescue /]# grub2-mkconfig
/usr/sbin/grub2-probe: error: failed to get canonical path of `/dev/sda1’.

[root@sysrescue /]# dracut -f
dracut: No ‘/dev/log’ or ‘logger’ included for syslog logging
dracut: Cannot find module directory /lib/modules/5.10.22-2-lts/
dracut: and --no-kernel was not specified

after search in google i found this
dracut --no-hostonly --force --regenerate-all --verbose

seems generate initramfs but when boot my VM i have grub error “minimal BASH …”

thank you in advance

Your steps Look valid to me.
Your issue is grub related, it’s not able to write the Master Boot record. Unfortunately I am not sure why.

One thing I noticed it that you should mention the disk (not the partition) to grub2-install.

Maybe you find something helpful here

https://www.linuxsysadmins.com/grub-rescue-in-centos-and-rhel-7/

Beginning from “chroot…”

grub2-install should be grub2-install /dev/sda in this case. That’s the only thing I can say for certain as I don’t use CentOS.

sorry,
maybe i found…

i must create a efi partition …
anyway, i check better and test it from start to finish and then write here…

ps. is there a way to save partition layout / mbr ???

thank you again