system installation – Clone Linux OS Btrfs disk and boot with cloned disk 2024?

Yes, using the following steps:

  1. Literally 1:1 clone the disk using dd.
  2. Remove the old disk.
  3. Boot the new disk.
  4. 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:

  1. using sfdisk --dump to clone the partition table,
  2. then using partclone.btrfs or ntfsclone to transfer large partitions more efficiently by avoiding the unnecessary copy of “unused” space,
  3. then, if the disk is used for BIOS/CSM boot, using head -c 440 to transfer the boot sector code to the new disk’s MBR (not needed for EFI boot).

Read more here: Source link