dm-crypt/LUKS, won't mount encrypted drive. Requested offset is beyond real size of device

2

I screwed up my partition table the other day but had recovered it with TestDisk. After re-writing the partition table, I'm able to boot up into GRUB and subsequently the interface for entering my password to decrypt the encrypted partition.

However, after entering in the password, I get an error:

Requested offset is beyond real size of device /dev/disk/by-uuid/..."UUID string here".

Before entering in my password, the following errors are reported:

lvmetad is not active yet, using direct activation during sysinit
Volume group "ubuntu-vg" not found
Cannot process volume group ubuntu-vg

Can anyone point me in the right direction to fix this?

Moo

Posted 2017-04-25T14:52:58.203

Reputation: 51

I'm guessing someone at security.se suggested this Q belongs here, so you posted a new Q here ( https://superuser.com/questions/1203146/luks-encrypted-drive-not-booting-after-modifying-partition-table-with-testdisk ) and then this Q was migrated here too, now there's two. I'm not sure, but is just deleting one the right move? Anyone?

– Xen2050 – 2017-04-26T07:05:56.773

Answers

0

!!! Make full backup of your hdd, before trying this !!!

I was able to fix equivalent problem with correcting partition parameters manually in TesDisk.

Quick search found following first:

Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

 1 P Linux                    0  32 33 0       97 33  4096
 2 P Linux                63741  45 49 121601  57 56  929521664

The first partition is the LUKS encrypted partition I was trying to restore. After writing this table, I got same error as you: "cryptsetup Requested offset is beyond real size of device". So I started TesDisk again and changed partition table as follow (start quick search > immediately abort it > add partition):

Current partition structure:
     Partition                  Start        End    Size in sectors

 1 P Linux                    0  32 33 63741   45 48 1024000000
 2 P Linux                63741  45 49 121601  57 56  929521664

Note: I just changed the end of the partition to one sector before next partition start from 0 97 33 to 63741 45 48. After writing this table, I was able to open LUKS partition again.

rogri

Posted 2017-04-25T14:52:58.203

Reputation: 1