Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] Installation on existing LUKS+LVM [SOLVED]  (Read 2084 times)

Offline PerfMonk

  • Retired Computer Analyst
  • User
  • Posts: 5
[EN] Installation on existing LUKS+LVM [SOLVED]
« on: 2023/01/02, 18:15:05 »
Happy new year 2023 to all,

I would like to install siduction over another linux.  I have UEFI partition, a small boot, and a LUKS container with LVM. In the luks container I have a big LV (backup) that I want to keep.  Also the old OS is on a LV that I deleted and there is a swap partition.

Is is possible with the existing installer (I'm using the KDE ISO) to install the OS in the LUKS container  ?

here is my lsblk output :

sdc                8:32  0 931,5G  0 disk 
├─sdc1              8:33  0    1G  0 part  <=UEFI
├─sdc2              8:34  0  3,5G  0 part  <=boot (not encrypted, to delete)
└─sdc3              8:35  0  927G  0 part  <=the LUKS container
  └─cryptdisk    253:1    0  927G  0 crypt 
    └─data-backup 253:3    0  807G  0 lvm    <= the data I want to keep

So I have 110G for the OS to give and 17G for the swap

The installation program doesn't open the luks container to let me create new LV to install. It just want to re-encrypt the whole thing. 

Is there a way to install ?

Other usefull info ???
===========================
root@siduction:/home/siducer# vgdisplay data
  --- Volume group ---
  VG Name              data
  System ID           
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  11
  VG Access            read/write
  VG Status            resizable
  MAX LV                0
  Cur LV                1
  Open LV              0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size              923,00 GiB
  PE Size              4,00 MiB
  Total PE              236289
  Alloc PE / Size      206593 / 807,00 GiB
  Free  PE / Size      29696 / 116,00 GiB
  VG UUID              7...


root@siduction:/home/siducer# pvdisplay /dev/mapper/cryptdisk
  --- Physical volume ---
  PV Name              /dev/mapper/cryptdisk
  VG Name              data
  PV Size              <923,01 GiB / not usable <3,71 MiB
  Allocatable          yes
  PE Size              4,00 MiB
  Total PE              236289
  Free PE              29696
  Allocated PE          206593
  PV UUID              o...


I have tried to reduce the PV to give space to a new crypto container to install.
But the operation won't work until I move my data in a one big chunk.  I would need to do the equivalent of compressing the PV to have the free space all in one piece.  I haven't found yet how to to this.

« Last Edit: 2023/01/03, 18:24:36 by PerfMonk »

Offline towo

  • Administrator
  • User
  • *****
  • Posts: 2.920
Re: Installation on existing LUKS+LVM
« Reply #1 on: 2023/01/02, 18:56:05 »
You have to open your LUKS partition manually before starting the installer.
And you can't delete the boot partition, you need it too.
« Last Edit: 2023/01/02, 19:53:49 by devil »
Ich gehe nicht zum Karneval, ich verleihe nur manchmal mein Gesicht.

Offline PerfMonk

  • Retired Computer Analyst
  • User
  • Posts: 5
Re: Installation on existing LUKS+LVM
« Reply #2 on: 2023/01/02, 20:04:03 »
Thanks, I will try this.  First I'm going to recreate the root-LV and the swap LV.


Offline PerfMonk

  • Retired Computer Analyst
  • User
  • Posts: 5
Re: Installation on existing LUKS+LVM
« Reply #3 on: 2023/01/02, 20:43:10 »
OK I opened the LUKS container before and the installer take it for installation but it ignored the EFI partition.
I can install but it might be not bootable right after installation.  I'd have to change the fstab to add the EFI partition and generate the grub config.   I tried to alloc my partition to /target but it won't do the installation because the disk is mounted elsewhere.

Is there a way to have the EFI setup OK AND LUKS ?

Regards,
             BT

Offline towo

  • Administrator
  • User
  • *****
  • Posts: 2.920
Re: Installation on existing LUKS+LVM
« Reply #4 on: 2023/01/02, 21:14:28 »
You have an existing efi partition, so give it in the installer. You have to choose your boot as /boot (no formating) and your efi as /boot/efi (no formating), all can be done in the manual partitioning.
Ich gehe nicht zum Karneval, ich verleihe nur manchmal mein Gesicht.

Offline PerfMonk

  • Retired Computer Analyst
  • User
  • Posts: 5
Re: Installation on existing LUKS+LVM
« Reply #5 on: 2023/01/02, 22:23:56 »
I cannot enter the /boot/efi on /dev/sdc1 since all I can see from the installer is the content of the LUKS container, it denied that my disk /dev/sdc1 existed. 

Do I have to check the encryption box to let it figure I'm on a LUKS container or it will find out ??
Also I don't intent to use the /dev/sdc2 not encrypted partition for boot since I want everything to be encrypted.

I have stayed on the live iso after install and got in a chroot and then change the fstab to add the efi partition.
Then I mounted it on /boot/efi, installed grub and did an update-grub.

But at boot grub did not asked me the passphrase for the disk and tells me it didn't found the root disk.
It seem I still have stuff to do to make it boot ;=)  It might be the initrd that is not correct... I'm looking into this now.

Almost there :-X

Addon:  It seem that since I selected the LUKS container already decrypted it would see the PV, VG, LV but doesnt realize that the container is encrypted.  It also doesn't allow me to select anything outside the LUKS container (the efi partition in particular).

So the problem seems to be the fact that I'm using a LUKS container (not an LVM).  I haven't found exactly what part of the configuration is missing :  I have /etc/crypttab, /etc/default/grub , anything else I should configure to make the thing bootable ?


« Last Edit: 2023/01/03, 06:06:52 by PerfMonk »

Offline PerfMonk

  • Retired Computer Analyst
  • User
  • Posts: 5
Re: Installation on existing LUKS+LVM
« Reply #6 on: 2023/01/03, 18:21:46 »
I will close thread.  I have decided to install on a new USB disk over Ubuntu (I didn't use it often).
But  I think the case of installation over an encrypted LUKS+LVM+uefi is not very easy to handle with the install tool.

Thank you very much all for your help and Happy 2023!

Regards,
            BT

-----------------
Sending this from my new installation of siduction.

Code: [Select]
bt@siducter:~$ neofetch
                _aass,                    bt@siducter 
              jQh: =$w                    ----------- 
              QWmwawQW                    OS: Siduction (Debian bookworm) x86_64 
              )$QQQQ@(  ..              Host: VivoBook_ASUSLaptop X513UA_M513UA 1.0 
        _a_a.  ~??^  syDY?Sa,            Kernel: 6.1.1-4-siduction-amd64 
      _mW>-<$c      jWmi  imm.          Uptime: 1 hour, 7 mins 
      ]QQwayQE      4QQmgwmQQ`          Packages: 2606 (dpkg) 
        ?WWQWP'      -9QQQQQ@'._aas,      Shell: bash 5.2.2 
 _a%is.        .adYYs,. -"?!` aQB*~^3$c    Resolution: 1920x1080 
_Qh;.nm      .QWc. {QL      ]QQp;..vmQ/  DE: Plasma 5.26.4 
"QQmmQ@      -QQQggmQP      ]QQWmggmQQ(  WM: KWin 
 -???"        "$WQQQY`  __,  ?QQQQQQW!    Theme: [Plasma], Breeze [GTK2/3] 
        _yZ!?q,  -  .yWY!!Sw, "???^      Icons: [Plasma], breeze-dark [GTK2/3] 
      .QQa_=qQ      mQm>..vmm            Terminal: konsole 
        $QQWQQP      $QQQgmQQ@            CPU: AMD Ryzen 7 5700U with Radeon Graphics (16) @ 1.800GHz 
        "???"  _aa, -9WWQQWY`            GPU: AMD ATI 03:00.0 Lucienne 
              _mB>~)$a  -~~              Memory: 2518MiB / 15403MiB 
bt@siducter:~$ mQms_vmQ.
              ]WQQQQQP
                -?T??"