#2722 Issue closed: Failed to create parition table with LVM and LUKS

Labels: support / question, fixed / solved / done

Quixus opened issue at 2021-12-03 16:24:

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"):
    Relax-and-Recover 2.5 / Git

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
    Ubuntu 20.04.3 LTS

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
    Default configuration

  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR):
    Source for mkrescue: x64 PC
    Target of rear recover: VM in HyperV

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
    x86 compatible

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
    EFI and GRUB

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
    Source: Local Disk with LVM and LUKS

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT"):

NAME                                    KNAME      PKNAME    TRAN   TYPE  FSTYPE        SIZE MOUNTPOINT
/dev/loop0                              /dev/loop0                  loop  squashfs     55.5M /snap/core18/2246
/dev/loop1                              /dev/loop1                  loop  squashfs     55.5M /snap/core18/2253
/dev/loop2                              /dev/loop2                  loop  squashfs     61.9M /snap/core20/1169
/dev/loop3                              /dev/loop3                  loop  squashfs     70.3M /snap/lxd/21029
/dev/loop4                              /dev/loop4                  loop  squashfs     42.2M /snap/snapd/14066
/dev/loop5                              /dev/loop5                  loop  squashfs     32.5M /snap/snapd/13640
/dev/loop6                              /dev/loop6                  loop  squashfs     61.9M /snap/core20/1242
/dev/loop7                              /dev/loop7                  loop  squashfs     67.2M /snap/lxd/21835
/dev/sda                                /dev/sda             sata   disk              931.5G
|-/dev/sda1                             /dev/sda1  /dev/sda         part  vfat          512M /boot/efi
|-/dev/sda2                             /dev/sda2  /dev/sda         part  ext4            1G /boot
`-/dev/sda3                             /dev/sda3  /dev/sda         part  crypto_LUKS   930G
  `-/dev/mapper/dm_crypt-0              /dev/dm-0  /dev/sda3        crypt LVM2_member   930G
    `-/dev/mapper/ubuntu--vg-ubuntu--lv /dev/dm-1  /dev/dm-0        lvm   ext4          200G /
/dev/sr0                                /dev/sr0             sata   rom                1024M
  • Description of the issue (ideally so that others can reproduce it):
    After creating the ISO and mounting it as boot device on the VM, the writing of the partitions fails at the step where the LUKS password should be entered.
Please enter the password for LUKS device dm_crypt-0 (/dev/sda3):
UserInput -I LAYOUT_CODE_RUN needed in /usr/share/rear/layout/recreate/default/200_run_layout_code.sh in line 127
The disk layout recreation script failed
  • Workaround, if any:
    I haven't found one

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):
    Unfortunately I cannot get the log out of the VM.

pcahyna commented at 2021-12-07 10:32:

Hello, is it LUKS 2 ? I am no LUKS expert, but this sounds similar to bug #2204. If so, LUKS 2 support was added by a colleague of mine (@vcrhonek) in PR #2504, but it is not yet present in any released version. Can you please try the current development version?

Quixus commented at 2021-12-07 10:48:

Yup, it is indeed LUKS2. I will see if I can use the dev version. Is there an ETA for LUKS2 support in the release?
[Edit]I installed rear with apt. how do I get the dev branch and which branch is the LUKS2 support in [/Edit]

pcahyna commented at 2021-12-07 13:57:

how do I get the dev branch and which branch is the LUKS2 support in

See the first part of https://github.com/rear/rear#quick-start-guide "how to run Relax-and-Recover from the git checkout". Note that the configuration file for running from git checkout is indeed etc/rear/local.conf, not /etc/rear/local.conf (the path is relative to the root of the checked-out tree). The dev branch is the default master one, the LUKS2 support branch has been already merged into it.
EDIT you can of course skip the part about preparing your USB media and configuring USB output, you can configure the Git version just as you do with your current version, only the config file path is different.

Quixus commented at 2021-12-08 13:38:

The partition table was created. Unfortunately I did not include the necessary information about the restic backup that has the rest of the disk content and I cannot get to it from the rescue image, but that is not part of the issue

I consider this issue closed.

Thanks everyone

pcahyna commented at 2021-12-08 17:30:

@Quixus thank you for verifying the fix in the development version.


[Export of Github issue for rear/rear.]