How to clone a LUKS encrypted home/root/swap partition from a HDD to an SSD?

I have one partition luks installed manjaro ( home, root , swap… Is one partition)
I want to copy or clone luks partition hdd to ssd
How to make luks partion and clone or copy to ssd?

On the target, you need to partition - and then create the encrypted container(s),
open them (!)
create the filesystems in them,
mount the filesystems to the correct places.

On the source side
you also need open the encrypted container before you can access/mount the filesystem(s) inside it.

Then you can copy/rsync one to the other.

You’ll also have to adjust /etc/fstab to reflect the now different UUID of the partitions on the new drive.
Same goes for /etc/default/grub - the UUID there also needs to be adapted.

manjaro-chroot will not/cannot work, since you first need to open the encrypted container before the partitions inside it will be accessible.
The tool is not designed to do this AFAIK.
… maybe it will work once you first opened the container?
I don’t know.

1 Like

I did all the steps I mentioned carefully
The problem is that Grub does not install properly
I use grub-mkconfig -o /boot/grub/grub.cfg but, The grub.cfg will not be created properly and the root partition will not be called in grub

What you perhaps missed is that you first need to actually install grub to the new drive
before you can run grub-mkconfig?

I always use this as a reference:

dm-crypt/Encrypting an entire system - ArchWiki

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.