Installation via chroot

Hello,

  • OpenMandriva Lx version:
    ROME (?)

  • Desktop environment (KDE, LXQT…):
    KDE Plasma 6

  • Description of the issue (screenshots if relevant):
    I have a harddisk that I don’t want to completely wipe out. I have regular backups of my data. But still I don’t want to erase the entire hard disk to install Mandriva.
    On my disk I have a gpt partition table.
    EFI
    Boot partition
    A luks encrypted partition
    Inside luks there is an LVM
    Inside LVM there is a partition where I want to install open mandriva.
    My usual way of installation (coming from debian) is to run some script to install the base system on the mounted partition and then chroot to the partition and install and configure all the rest. The script for debian is debootstrap. Is there such script for OpenMandriva?
    Is there any wiki page for installation via chroot?
    Should I do tricky steps like copying from the iso file directly into the partition and then chroot to it?
    Please help.
    Thanks in advance.

  • Relevant informations (hardware involved, software version, logs or output…):

1 Like

Welcome!

This is above my pay grade, but I’m sure someone here has the answer.

1 Like

Paygrade? I was lost at “Inside luks there is an LVM”. My eyes glazed over and my toes went numb.

Gonna need someone on the level of @bero or @zeroability to answer this one. Lol.

1 Like

Idk, maybe @rugyada would know?

1 Like

My instinct would be that install from a minimal image would be the starting point after the volume is decrypted and the volume is resized so the new volume can be added. From that point, you will probably have to build your system from scratch including any manual entries to grub2. @bero can give you better directions.

SATA SSD’s are also really cheap right now… Just sayin’

4 Likes

@UnkleBonehead nope.

Inside luks there is an LVM
Inside LVM there is …

Lost as well :crazy_face:
(Sorry, joking)
The fact is that I don’t have a clue on what it means.

2 Likes

There is currently no direct equivalent of debootstrap, but the install script from the server image could be used as a start.

Thanks guys. Actually, I ended up doing this:
Install inside a qemu instance using virtmanager.
Then running these commands to mount the virtual disk:

sudo modprobe nbd
sleep 1
sudo qemu-nbd --connect /dev/nbd0 mandriva.qcow2
sleep 1
sudo cryptsetup luksOpen /dev/nbd0p1 mandriva #I installed with encryption enabled
mkdir root
sudo mount /dev/mapper/mandriva root
sudo mv root/etc/resolv.conf root/etc/resolv.conf.bak
sudo cp /etc/resolv.conf root/etc/resolv.conf
sudo mount --bind /dev root/dev
sudo mount --bind /sys root/sys
sudo mount --bind /proc root/proc
sudo chroot root

Then once chroot inside the root folder, I can do the rest.
I’m planning to insatll all my favorite programs that I always use on the woke debian.
Then I’m going to copy the resulted root partition over to my actual disk on my root partition that I have for this purpose.
Then I will struggle to make grub and initramfs work with my crazy complicated setup of LUKS and LVM :slight_smile:
Hope everything goes well. It will be a long night for me here in Europe.

2 Likes

Also to make grub work with lvm and luks, modified the file:

/etc/default/grub

To have the line:

GRUB_CMDLINE_LINUX_DEFAULT='quiet rd.luks.uuid=<uuid of the luks partition> rd.lvm.lv=<name of the volume group>/<name of the volume for root> root=/dev/mapper/<name of the volume group>-<name of the volume for root> splash rd.lvm.lv=<name of the volume group>/<name of the volume for swap> resume=/dev/mapper/<name of the volume group>-<name of the volume for swap> logo.nologo audit=0 rd.timeout=120 dm_mod.use_blk_mq=1 rd.systemd.show_status=0 systemd.show_status=0'

Then ran:

dracut -f --regenerate-all
update-grub2 
grub2-install /dev/nvme0n1
3 Likes