Most current way to move a Linux installation from one SSD to another SSD?

So, for Christmas this year my parents got me a 2TB WD_BLACK SN850X NVMe SSD with a heatsink. I am currently running CachyOS with BTRFS on a Framework 16 with a 512GB SSD.

What is the current best way to move my Linux installation from one SSD to another? I already had to backup my user data to an external SSD last month when I switched from Tumbleweed to CachyOS, I do not want to do it again for my new SSD.

Thanks in advance, and sorry if I put this in the wrong category.

2 Likes

Clonezilla would be what I would use: https://clonezilla.org/

3 Likes

I tend to reinstall and copy forward only what I actually need onto any new media, just as an excuse to get rid of cruft from my old setup. But, if I really wanted to move the install exactly…

I would use dd if I could connect both to the same machine at the same time. Then use gparted to expand the partition to the size of the new disk.

If not, btrfs snapshot followed by btrfs send | btrfs receive would also get the job done, though subvol IDs can get a bit messy, depending on what you use as your boot system. rEFInd has been pretty good to me in this regard, should be able to manually specify the root subvol IDs right in rEFInd text config.

No matter what method you chose, don’t overwrite your old disk until you are 200% sure everything is available on the new disk AND your backup set…

1 Like

Agree with Clonezilla. But do NOT let it do a file system check on your BTRFS file system.

2 Likes

I suppose the main challenge will be plugging 2 nvme SSDs in at the same time. You probably need a usb enclosure or some nas to plug it into.
Once you do have the enclosure, I would configure some partitions on the new ssd and you should be able to copy all the needed files over. With “cp -a source destination”, taking care to avoid some directories such as /dev and /sys and /proc.
It is also generally a good idea not to boot from the ssd you are copying from. Boot from a separate usb stick so that you can mount and unmount partitions as needed on both source and destination disk.

But, I don’t think the above is the best approach. I think a better approach would be to test that your backup/restore procedure actually works, by backing up the first SSD, and then restoring it to the new SSD.

Second clonezilla here. Just did that to shuffle things: (i) a Fedora installation in my Framework to a new ridiculously fast NVME, (ii) then a dual boot system from an old NVME, to the one previously in the Framework (and the slowest, “decommissioned” NVME is being reused in an USB-C enclosure).

I didn’t know about the problems with BTRFS fs check mentioned by @Steve_Fishman but now I want to know more :nerd_face:

1 Like

dd works well. I didn’t feel like re-installing things, so I cloned the HD from the 4tb ssd in my 16" to an external hd, shrank the partition on the external, then cloned it to a 2tb ssd in the 13". It took some time, but everything worked great.

1 Like

Clonezilla and dd will also copy all UUIDs, then you have two identical disks. That could confuse a system, so you might want to not have both connected to the same system.

1 Like