Based on the screenshot and our discussion, it looks like testdisk
discovered your LUKS header and put it in it's own partition, leaving the rest of the LUKS container in the unallocated space. The LUKS header is stored at the beginning of the partition (or disk when not using partitions); unless you use a detached header.
LUKS format uses a metadata header and 8 key-slot areas that are
being placed at the beginning of the disk. https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions
So based on this, the solution is to resize sdb1 so that it encompasses the entire disk. There are a few things to keep in mind while resizing:
- The starting offset of the sdb1 partition must remain intact. In other words, you must not perform a move operation.
- Only resize the partition, not the filesystem.
- In reality, you're not resizing the partition, you're instead recreating it in the MBR. It's just that the GParted resizing operation makes it easier because it fills in the partition starting offset for you.
The instructions for resizing a partition with Gparted are here: https://gparted.sourceforge.io/display-doc.php?name=help-manual#gparted-resize-partition
There are a couple of things worth noting about the instructions. First as I mentioned earlier, the partition starting offset must remain intact. Here's the TIP from the instructions:
If you do not want the start of an existing partition to move, then do
not change the free space preceding value.
And there's a TIP about LUKS which doesn't apply because you're not really resizing, instead your recreating the partition as it once was:
A LUKS encrypted partition and the file system within can only be
resized when the encryption mapping is open.
After all this is set and done and your NTFS mounts OK, I recommend running a filesystem check to ensure your content is alright.
/mnt/backup
is a mounted filesystem without enough space, you can backup the disk into a file withdd
. Something like this:dd if=/dev/sdb of=/mnt/backup/mybackup.img
But first check thedd
man page because there are some options for controlling how much data to copy at a time. Copying only one byte at a time would be slow.bs=4M
will this be applicable in this situation? Also when it is put into.img
file will it be compressed? As I don't actually have enough space on my computer to save the backup onto it (that's why I got the 2TB drive xP)..img
file will not be compressed. While you can pipe the output ofdd
to something like bzip2, because the disk contains encrypted (random-looking) data it won't compress well. But it really depends on how much of the disk contains random-looking data. For example, if you wrote random junk to the disk prior to creating the LUKS container, as often recommended, then there's not much that can be compressed. On the other hand, if the disk was blank prior to creating the LUKS container, then the areas on the disk which have not been used will compress well.