I would use Clonezilla
Get a Clonezilla iso file, make a USB boot drive, and boot from it.
See the documentation on clonezilla.org.
Use Clonezilla to clone the whole drive. This will work if
the target drive is at least as big as the source drive. You can check that (if the sizes are nominally the same) with
sudo parted /dev/sdx u B p
where x can be for example a
(/dev/sda
) and b
(/dev/sdb
) for the two drives. The target drive should not be one single byte smaller than the source drive, otherwise you must shrink the last partition so that its tail end will be within the target drive.
the physical sector sizes of the two drives are the same. You can check that with
sudo parted -ls
Clonezilla is smart enough to copy/clone only the used data blocks on the drive and skip unused blocks, so it is faster than cloning with dd
, particularly when there is a lot of unused drive space (as in your case).
Clonezilla fixes the GPT backup partition table at the tail end of the drive. (If the drive sizes are different, and you use a simple raw cloning tool (for example dd
), and the partition table is GPT, you must repair the backup table at the end of the drive. You can do that manually with gdisk
or with the shellscript gpt-fix.)
Clonezilla is also safer than dd
, because it has a user dialogue that helps you to check and double-check that you will clone to the correct target device. dd
does what you tell it to do without questions. A minor typing error can make you overwrite the family pictures.
Please notice that Clonezilla can
- clone a drive to another drive of at least the same size
- create a compressed image (a directory with a number of files)
- clone a partition and create an image of a partition
- restore from a compressed Clonezilla image to a drive of at least the same size
- work locally or via a network