Switched encrypted disk from 1TB to 2TB

Hi,
I have a 1 TB SSD installed and want to switch to a 2TB SSD.
I copied the disk with “dd”.
The newly copied disk had a 1TB unused space.
I have an encrypted disk, so my main partition and my Swap partition are encrypted.
Disk layout of my new 2 TB disk
EFI - 930 TB encrypted partition - 40 GB encrypted Swap - 1 TB unused.

To use the unused 1TB on my new disk, I wanted to expand the 930 TB partition.
Unfortunately, this is not possible with Gparted or fdisk.
I tried everything, but it didn’t work.

I would be really grateful, if somebody could explain to me how this works. My son, who uses Linux for years, could help me either.

Thanks, Matthias

Depends on filesystem and how you created the setup initially.

Without knowing anything about your setup - I’d say the logical steps are - roughly - more work may be necessary

  • Backup your critical data
  • Dump your physical to external media
  • Open your encrypted volume and dump the layout to external media
  • Boot a live ISO
  • Extend the initial parition to use all available space
  • Use cryptsetup to extend the encrypted container
3 Likes

What was / is the layout of the original?

plain luks encryption with several partitions
or
luks on lvm
or
lvm on luks

lsblk -f
should help to clarify that

look for (for example):
Arch luks resize
or similar search terms

I’d not have cloned the disk, but rather made new (encrypted) partition(s) on the new disk, with the correct size to begin with
and then simply copied the contents
and then adapted /etc/fstab and /etc/default/grub and one or two other files (/etc/crypttab could be one such)

1 Like

lsblk -f gives:

NAME                                          FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme1n1                                                                                                                   
├─nvme1n1p1                                   vfat        FAT32       47CD-3F8C                               299M     0% /boot/efi
├─nvme1n1p2                                   crypto_LUKS 1           e1c36d74-20f2-4235-8ee1-42507d066f75                
│ └─luks-e1c36d74-20f2-4235-8ee1-42507d066f75 ext4        1.0         76a08b89-3fd5-4a41-903a-6cc15ce1b44c   28,5G    92% /
└─nvme1n1p3                                   crypto_LUKS 1           e3fd7ffc-e5ea-4b5c-8339-c282a85e06f3                
  └─luks-e3fd7ffc-e5ea-4b5c-8339-c282a85e06f3 swap        1     swap  1f532172-3d44-4331-a91b-0b34423ac303                [SWAP]
nvme0n1                                                                                                                   
├─nvme0n1p1                                   vfat        FAT32       7A25-B338                                           
├─nvme0n1p2                                                                                                               
├─nvme0n1p3                                   ntfs                    0A9C273E9C2723A3                                    
└─nvme0n1p4                                   ntfs                    645E80585E802540

Unfortunately, I am a Linux beginner.

How would I create an empty disk with this setup? It is the setup Manjaro created for me.

Everyone is a beginner at the beginning.

The last two points @linux-aarhus made above describe the process -
the others are precautions, so you still have your data when something goes wrong,
but I assume you also still have the original as a backup.

Please use the formatting option of the editor window you used to past this into: </> (preformatted text).
I have done it for you now.

don’t take it personal, but:
Everyone is a beginner at the beginning and I’m not going to give step by step instructions.
No need.
Especially when you have the clone already and just need to follow what @linux-aarhus described.

Assuming you have not wiped the original disk - only duplicated the content to another bigger disk.

We are all beginners with something - but that something started easy (marriage and children excluded) and expanded our knowledge.

You are jumping in deep in freezing cold and expect to swim 1000m.

The process seems simple from a beginners perspective - but I can assure you it is not.

Even an old fox needs to think carefully before venturing into such task - and doing so by proxy (the forum) is next to impossible.

So I accept the fact that you would like handholding - I am sorry - I cannot do that.

What I can offer you is a prepaid consulting assistance and then perhaps I can do it remotely using Teamviewer. Such consultancy is €100/hour.

//EDIT:
I don’t think I would ever consider doing as you suggest, it would be easier to install fresh onto the new disk - then copy the relevant data from the old disk.

Another simple solution would be to create a /DATA partition in the unused space on the new disk and use that for more “static” data i.e. archiving, media you generally just add to but don’t edit or replace, etc. :wink:

Thanks for all your replies. I think I follow @linux-aarhus suggestion and fresh install Manjaro and then copy my data. I hoped there would be a faster solution.

There is - and likely much quicker than a re-install.

It was also mentioned at the beginning

  • expand partition (from the clone it is only as large as it was)
  • expand the encrypted container
    and the file system within it

to occupy the size of the now twice as large partition size

You can try it - risk free even, and be it only for the learning experience …
because you still have the original and can try again …

Okay, I give it a try on the weekend, during the week I am too busy. You are right, it is a good learning experience. Thanks.