public inbox for dm-crypt@saout.de
 help / color / mirror / Atom feed
* [dm-crypt] Moving LUKS-LVM partition with KDE Partition Manager broke it
@ 2019-10-15  6:16 Hijack Eel
  2019-10-15  8:01 ` Michael Kjörling
  0 siblings, 1 reply; 2+ messages in thread
From: Hijack Eel @ 2019-10-15  6:16 UTC (permalink / raw)
  To: dm-crypt

[-- Attachment #1: Type: text/plain, Size: 2087 bytes --]

Hello,

I hope someone on this list can help me fix a stupid mistake I made. My
apologies if this is not the right place. This page made it sound like it
would be ok to ask for help here:
https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions

My computer is set up to dual boot Windows and Linux. Directly after the
main Windows partition, is a LUKS-encrypted partition containing 3 LVM
logical volumes, set up following this guide:
https://wiki.gentoo.org/wiki/Sakaki%27s_EFI_Install_Guide

In case it is useful information, I actually followed "Option 6" in the
guide (i.e. using a password only):
https://wiki.gentoo.org/wiki/Sakaki%27s_EFI_Install_Guide/Using_Your_New_Gentoo_System_under_OpenRC#Migrating_Off_the_Boot_USB_Key_.28Optional.29

Recently, I wanted to increase the Windows partition by 100 GB. This meant
shrinking my LUKS partition by 100 GB, and moving it to the right 100 GB,
to free up space on the left for Windows.

I successfully shrank the LUKS partition, and tested it by booting into
Linux and viewing my data.

However, things went wrong when I used KDE Partition Manager to move the
shrunken LUKS partition to the right. After that, the partition's type
showed up in partitionmanager and gparted as "unknown" instead of LUKS, and
trying to run cryptsetup luksOpen returned that the partition "is not a
valid LUKS device".

I did manage to recover the LUKS header from the freshly unallocated space
between the Windows and LUKS partitions by using hexdump and dd. Decrypting
the LUKS partition using the recovered header (i.e: sudo cryptsetup
--readonly --header /path/to/recovered/header/file luksOpen /dev/partition
<insert some name here>) seems to work in the sense that cryptsetup accepts
my password, and the mapping shows up in /dev/mapper. However, lvdisplay
and vgdisplay detect nothing, and mounting it fails.

In the worst case, I do have a qcow2 image of my entire disk that is
several months old that I may be able to use to recover most of my data,
but I would like to try that last.

Thanks in advance to anyone who can help!

[-- Attachment #2: Type: text/html, Size: 2730 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-15  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-15  6:16 [dm-crypt] Moving LUKS-LVM partition with KDE Partition Manager broke it Hijack Eel
2019-10-15  8:01 ` Michael Kjörling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox