You are not logged in.
Pages: 1
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
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.
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.
Jin, Jîyan, Azadî
Offline
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
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.
Jin, Jîyan, Azadî
Offline
Thanks. I will then use dd to backup /boot.
Long time Debian user who switched to Arch.
Offline
Why not just use rsync for /boot as well?
Jin, Jîyan, Azadî
Offline
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
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.
Jin, Jîyan, Azadî
Offline
Thanks for explanation. You've been very helpful!
Long time Debian user who switched to Arch.
Offline
Pages: 1