01-30-2021, 10:46 AM
(01-25-2021, 11:41 AM)nas Wrote: Is there any way of doing this without copying gigabytes of mostly empty space?You'd need a tool that's aware of the filesystem, partitioning and possibly the bootloader. Partimage used to do that sort of thing, but doesn't support the more recent filesystems, and may not do the bootloader correctly. I don't know of anything else that does it, so you might have to write something that creates an image file, partitions it, formats the partitions to match, mounts source read-only and target read-write, and uses rsync or similar to transfer content. And the bootloader. I suppose another option would be to use one of the partition-shrinking tools so you can copy a nearly-full partition rather than a mostly empty one.