I need to replace my system SSD drive. I would like to do an exact mirror of the entire drive, include all partitions / sectors etc, so that I can simply swap out the old drive with the new drive, and have everything working like before.
nvme2n1 is my system drive:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme2n1 259:0 0 232,9G 0 disk
├─nvme2n1p1 259:1 0 300M 0 part /boot/efi
└─nvme2n1p2 259:2 0 232,6G 0 part
└─luks-22c33ed5-bf14-4137-947e-ea101ee86678 254:0 0 232,6G 0 crypt /
I have a SSD enclosure that I plan to use for connecting the new SSD to my system via USB. Then, I plan to boot the system using a Live CD (USB).
I plan to mirror the entire drive using dd, like:
dd if=/dev/nvme2n1 of=/dev/sda bs=1M
Since this is a system drive, is there something else I need to be aware of?
Take into consideration the UUID and encryption. If you clone UUID and then at any point connect the 2 drives at the same time it will be a mess. If you change it - you will have to change the uuid in fstab and maybe grub if you use hibernate. And if you change it, i do not know if it will affect the encryption. Also, a grub reinstall maybe needed.
So if you are NOT going to connect old+new it is probably easier to clone as you intend. With the uuid.
Good input. I completely forgot about the possible UUID confusion, and potential de-/encryption issues.
Using dd the UUID will be cloned (related superuser q&a). Hence, my new SSD will get the same UUID as my old drive and I do not need to change fstab nor grub as long as I will NOT use the old and new SSD at the same time.
I am not planning to use the two drives at the same time. So, no UUID problems should arise. And, if I by some reason should need to use the old drive I guess I can format it, to make sure it gets a new UUID.
Thank you. The drive is still fine, and it is a good idea to keep a backup drive.
To elaborate: The problem is that I have a Samsung model: SSD 980 PRO 250GB drive. I am unable to do a firmware update, and the drive’s firmware has a critical problem, as discussed here. To be proactive I want to change my drive before it stops working.
I have now successfully changed my system drive. I cloned it, after having booted using a “Live CD”, using dd. It was a good idea with some progress / status output, so I used the following command: