Clone NVME with only one M.2 slot

I have only one M.2 slot and I am about to upgrade my NVME drive to a larger one.

I am running Ubuntu 20.04 with the encryption that’s built into Ubuntu.

I have an external HDD.

How would I go about making an image of the NVME to the external - Then taking that image and putting it into the new NVME?

I’m assuming a LIVE USB will be needed in some way.

1 Like

Sounds like a good play- make a live USB thumb stick of Ubuntu,
boot to the stick and either use the built in disk image writer to make an image of the drive, or a harder tool like DD or gparted or whatever to your liking,
then switch the NVMe sticks, boot back to the USB stick and write the image out to the new drive.

You already susses the hard bits- and external HDD to hold the image in the mean time (has to be larger than current drive) and the replacement SSD is larger than the source.

Even though the current drive is encrypted, I suspect the disk image writer in gnome-disks will still make a direct copy, else you might have to get your hands dirty…

yeah gnome disks works like dd I used it to clone a LUKS2 drive

So I attempted to use the gnome disks ustility and ran into an issue.

I used a USB live of Ubuntu 20.04 and clicked to create a disk copy of my NVNE. After unlocking it , I was informed it was unable to copy as the drive was busy?

Did the system mount it or anything after unlocking it?

That’s what I thought but apparently it did not.

You could try Clonezilla, otherwise I guess it might have to be DD, or DDRescue on the CLI from the live image.
I’m sure there has been a post on here about using DD with encrypted drives…

Okay, have found one guy that did it. He did a drive to drive copy, but you would need to do a drive-to image copy, then an image to new drive, then a resize.

Clonezilla is the too he used to copy, and I am pretty sure it can copy to an image on the USB

By unlocking it, you sort of mount the drive, so you’d have to make an image of the unlocked but unmounted partition that’s on top of the luks drive in disks

So I attempted to clone the image onto the new drive and then resize the partition and then boot - It failed so I decided to start from scratch.

I loaded a live Ubuntu 20.04 USB - Formatted all partitions and Installed with encryption enabled.

Now when I check DISKS, it does not look like my old NVME did.

My old one had - Filesystem Partition 1 537 MB FAT | Filesystem Partition 5 767 MB Ext 4 | 250GB LVM 2 PV | Partition 6 250 GB LUKS

Now this new drive is exactly the same, apart from disk size of course, as this one is 500GB, but also has a partition called “Extended Partition Partition 2 500GB”

I thought this was just from when I extended it after attempting to clone, so I deleted it and rebooted. That completely messed my Ubuntu so I re-installed fresh again, and the same thing has happened; I have “Extended Partition Partition 2 500GB”

Hi, anybody able to assist?

boot into a live usb and use the nvme and external hdd
mount them and format the external hdd
dd if=/dev/nvme of=/mnt/hdd/outputfile.img status=progress
make sure you have enough space to do the operation
once you have completed swap the nvme
dd if=/mnt/hdd/outputfile.img of=/dev/new_nvme status=progress
after you have finish start gparted and grow partition AT THE END OF THE DISK otherwise your third partition will over write your fourth
best bet is to dd each partition to a separate file and gparted grow individually each partition and add partitions after each copy

if you dont have the extra space you can also use compression on the images