Question: Can I use dd to clone my luks encrypted lvm os drive?
-
I'll take a look at pvmove.
I can't have both installed. Plan is to dd the 128 nvme to a USB SSD I have, then dd the SSD to the 512 once it's installed in the laptop. All the xloning will be done by booting a USB ISO so no drives are in active use while being cloned.
-
I suspect your plan might be safer and less of a pain than pvmove. I've just never done that before so I can't say for sure.
Be sure you can open and mount the USB ssd after the first dd. Also check the status of the disk size of the luks container. I'm assuming your dd'ing the encrypted partition not the data inside.
-
Is it LVM2? If you need a GUI I recommend: Blivet-GUI from a bootable USB environment so as you said nothing is mounted, hope this helps!
-
Thanks. I’ll stick with
dd
then. You are correct, I think. I plan todd
the whole disk. The plan is:dd if=/dev/nvme0n1 of=/dev/sdb bs=4M status=progress oflag=sync
unless that's the wrong idea. once the usb ssd is done I will definitely check the luks container on the ssd. Size and data availability.
-
It is lvm2. Thank you for the recommendation! I'll check it out though I think I'm going to stick to the CLI for this one. I kind of want to do it manually.
I do plan to work from a bootsble USB for all the
dd
work so that nothing is mounted/in use. -
The other is not having the sync,noerror options and having a disk error. ddrescue is a lot more forgiving.
-
I recently read that luks containers don't actually know their size they will always adapt to the size of the entire disk (it makes shrinking them dangerous). So you should be good unless your SSD is bigger than your new nvme.
Very curious about how this goes. It might not work but it won't wipe the original nvme. I'd love to hear how it goes.
-
The first clone (to the interim usb ssd) was a success! I’ll report back after installing the new nvme and cloning from the ssd to the nvme.
-
Tip: don’t use
/dev/nvme0n1
or whatever, but use devices in/dev/disk/
. I prefer/dev/disk/by-id/
but maybe another works better in your case. -
-
That is actually what I did,
by-id
. The whole operation went off without a hitch. I'm up and running with my new 512GB nvme! -
Secnd clone was also a success! I cloned from the USB SSD to the NVMe, installed it, updated the UUIDs in
fstab
, and booted straight up! -
Filesystem sized is grown fine? If so wow that was easy.
-
I didn't expand it because I'm planning to dual boot NixOS. I've been wanting to wade in to NixOS and see what it's all about.
-
Congratulations!