Problem :
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?
Solution :
!!! 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.