Menu

Clone to LUKS encrypted partition

Afiro Nari
2024-08-10
2024-08-22
  • Afiro Nari

    Afiro Nari - 2024-08-10

    Hi!

    I have two partitions

    $ lsblk
    NAME       MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
    sda           8:0    0 931.5G  0 disk
    └─sda1        8:1    0 931.5G  0 part
    nvme0n1     259:0    0 931.5G  0 disk
    └─cpart     254:1    0 931.5G  0 crypt
    

    I want to copy unencrypted sda1ext4 partition into the LUKS encrypted cpart partition.

    I tried to run part_to_local_part mode but there was no cpart option but only nvme0n1 in the target list. I chose nvme0n1 option and I wasn't asked for LUKS part open or something like that so I was scared to press ENTER because I think it can overwrite the whole nvme0n1 device.

    After this I tried to enter shell mode and run # cryptsetup open /dev/nvme0n1 cpart and run part_to_local_part again, but the target options were the same.

    I am confused why nvme0n1 is shown in part_to_local_part mode because it is the device and not a partition.

    Please, help me understand how to do it right

     
  • Steven Shiau

    Steven Shiau - 2024-08-22

    In that case, I suggest you after running:
    cryptsetup open /dev/nvme0n1 cpart
    You can use partclone to clone that.
    For more info about using partclone, check https://partclone.org.

    Steven

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.