You are not logged in.

#1 2024-07-15 09:20:44

mrconfused
Member
Registered: 2023-06-17
Posts: 32

How to modify rsync script to back up new EFI partition?

I have arch installed on an external SSD, which I regularly backup to a USB using rsync, as follows:

sudo mount /dev/sdb2 /mnt
echo "Mounting...."

echo "Rsync with exclusions"
sudo rsync -aAXHv --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/etc/fstab","/boot/grub/grub.cfg"} / /mnt

echo "Umounting..."
sudo umount /mnt

Where: /dev/sdb2 is the root partition of the USB copy (sdb1 is for swap)

The problem now is that I have just converted my install (Both the SSD and USB) from a MBR bootloader to UEFI. So now, in addition to the root and swap partitions I have the EFI partition sdb3.

Using the same script now breaks the USB install.

My guess is that to fix this I have to add:

sudo mount /dev/sdb3 /mnt/boot

and

sudo umount /mnt/boot

To the above script. Is this correct? Is there a better alternative?

I want to make sure I get this right before I screw up my USB install again.

Appreciate some feedback, thanks.

Offline

#2 2024-07-21 09:06:37

ua4000
Member
Registered: 2015-10-14
Posts: 462

Re: How to modify rsync script to back up new EFI partition?

yes, but the order is important

sudo mount /dev/sdb2 /mnt
sudo mount /dev/sdb3 /mnt/boot
...
sudo umount /mnt/boot
sudo umount /mnt

umount can be simplified, it has an --recursive option.

And one remark: you exclude two important files from your backup
/etc/fstab
/boot/grub/grub.cfg
I assume you want to keep your backup USB  runable /bootable ?
You manage both files manually on the backup USB ?
I propose to back both file as well, a 2nd rsync line, only for fstab + grub, but to another folder on the backup.

Offline

Board footer

Powered by FluxBB