You are not logged in.

#1 2022-02-27 11:10:40

menteith
Member
Registered: 2022-01-18
Posts: 18

[SOLVED] Reinstall Arch from backup

Hi guys,

I've just made backup of root and home partitions using rsync. I didn't backup /boot partition.

Let's consider scenario when I would like to use my backup. Say I formatted root, home, boot and swap partitions and set the exact UUID as these had before formatting.

What should I do to have Arch up and running? Will it be enough if I reinstall GRUB in chroot environment the following way?

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch
grub-mkconfig -o /boot/grub/grub.cfg

Or is it possible to reinstall GRUB without having to chroot before? That would be quicker and hassle-free.

Thanks!

Last edited by menteith (2022-02-27 12:00:31)


Long time Debian user who switched to Arch.

Offline

#2 2022-02-27 11:40:02

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,457

Re: [SOLVED] Reinstall Arch from backup

menteith wrote:

Will it be enough if I reinstall GRUB in chroot environment the following way?

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch
grub-mkconfig -o /boot/grub/grub.cfg

No. You also need to install the kernel package again to place the kernel & initramfs images under /boot. The same applies for the CPU microcode package.

menteith wrote:

Or is it possible to reinstall GRUB without having to chroot before?

You could use the --boot-directory option to run grub-install without using (arch-)chroot but grub-mkconfig wouldn't work. If the (filesystem) UUIDs are the same then you could probably just copy the old /boot/grub/grub.cfg over to the new system.

If you backup /boot as well then just restoring the system with the same UUIDs for the root, /home & swap partitions and the same PARTUUID for the EFI system partition (/boot) would be enough. No need to run grub-install or grub-mkconfig at all.

Offline

#3 2022-02-27 11:56:48

menteith
Member
Registered: 2022-01-18
Posts: 18

Re: [SOLVED] Reinstall Arch from backup

Thanks for this. I need to backup /boot partition as well then.

Reinstalling kernel requires Internet access, which is a scenario I'd like to avoid. Is there an offline solution?

Last edited by menteith (2022-02-27 11:59:21)


Long time Debian user who switched to Arch.

Offline

#4 2022-02-27 11:58:40

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,457

Re: [SOLVED] Reinstall Arch from backup

If you backup /boot then you won't need to reinstall the kernel. Given the frequent regressions encountered with Linux I would think that would be the preferred option anyway.

Offline

#5 2022-02-27 12:00:10

menteith
Member
Registered: 2022-01-18
Posts: 18

Re: [SOLVED] Reinstall Arch from backup

Thanks. I will then use dd to backup /boot.


Long time Debian user who switched to Arch.

Offline

#6 2022-02-27 12:07:41

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,457

Re: [SOLVED] Reinstall Arch from backup

Why not just use rsync for /boot as well?

Offline

#7 2022-02-27 12:11:42

menteith
Member
Registered: 2022-01-18
Posts: 18

Re: [SOLVED] Reinstall Arch from backup

Will Arch boot if I format /boot and then copy (using rsync) backup  files onto /boot partition?

Last edited by menteith (2022-02-27 12:12:02)


Long time Debian user who switched to Arch.

Offline

#8 2022-02-27 13:09:13

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,457

Re: [SOLVED] Reinstall Arch from backup

As long as the PARTUUID for the /boot partition is the same then the NVRAM boot entry will point to the same location. Use gdisk(8) to modify the PARTUUID. The filesystem UUID will also have to match the /etc/fstab entry though, use mlabel(1) to change that.

Offline

#9 2022-02-27 13:22:56

menteith
Member
Registered: 2022-01-18
Posts: 18

Re: [SOLVED] Reinstall Arch from backup

Thanks for explanation. You've been very helpful!


Long time Debian user who switched to Arch.

Offline

Board footer

Powered by FluxBB