system installation – Clone Linux OS Btrfs disk and boot with cloned disk 2024?
Yes, using the following steps:
- Literally 1:1 clone the disk using
dd. - Remove the old disk.
- Boot the new disk.
- Use a partitioning tool to grow the main partition and/or to add extra partitions, to make use of the larger disk.
The answer hasn’t really changed since 2023, or 2022, or 2021, or 2020. For that matter, I don’t think it has changed any since 2000.
There are ways to improve it, e.g. by replacing the raw dd with:
- using
sfdisk --dumpto clone the partition table, - then using
partclone.btrfsorntfscloneto transfer large partitions more efficiently by avoiding the unnecessary copy of “unused” space, - then, if the disk is used for BIOS/CSM boot, using
head -c 440to transfer the boot sector code to the new disk’s MBR (not needed for EFI boot).
Read more here: Source link
