[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Copying one drive to a smaller one.



On Tue, May 10, 2022 at 08:31:12AM -0400, paulf@quillandmouse.com wrote:
For all but the boot mechanism, copying files from source to
destination via rsync should work. For ext4, files are files.

Except when they have ACLs or extended attributes, hard links are messy to rsync, etc. Most of time this isn't an issue, but be aware that it's possible.

It's the
boot mechanism that can get tricky. That's what I'm unsure about.

The UEFI boot mechanism is actually one of the easiest parts of this: unlike the old PC boot sector which was very limited in size and required jumps into hard-coded blocks elsewhere on the disk, UEFI is just files on a FAT fs with a special partition type that is read by the BIOS. Copy the files, tell the BIOS to use those files, and you're good to go.

If you want to change the UUID of the root partition, then you need to change three configuration files: /etc/fstab, /boot/grub/grub.cfg, and /boot/efi/EFI/debian/grub.cfg. If you have a separate /boot then you'd need to account for that as well. Once you're in the new system future calls to update-grub will base the UUID on the running filesystem; the manual updating is a one-time job.


Reply to: