rUser75 / qnap-recovery-kernel

A minimal QTS kernel running under qemu with lvm support
2 stars 0 forks source link

Cryptsetup tools #1

Open alexjfinch opened 3 weeks ago

alexjfinch commented 3 weeks ago

Thank you so much for this, I've been able to boot it and recognise my drive and activate the volumes, but sadly I can't mount any of the volumes because the filesystem isn't recognised.

Unfortunately "blkid" and "lsblk" aren't available in this environment, however using https://github.com/thanosz/qnap-kernel-lvm I was able to determine that I believe the paritions are locked with LUKS.

I've tried to use cryptsetup to unlock the volumes, but there is a missing shared library;

cryptsetup: error while loading shared libraries: libgcrypt.so.11: cannot open shared object file: No such file or directory

Is there a way I can get the correct cryptsetup tools and libraries into your kernel?

rUser75 commented 2 weeks ago

Hi, yes I can try to add the missing library, but I need I need some free time to do the activity. Please wait I come back as soon is possible.

rUser75 commented 2 weeks ago

please use, in the command, this initrd image initrd-lvm-libgcrypt-3.12.6.img instead of initrdC.boot.

alexjfinch commented 5 days ago

Thanks for the above, I ended up with a kernel panic when trying to boot the above..

[ 1.051160] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0) ]---

Did I need to unpack the above .img as the previous file was a .boot file and not a .img file

rUser75 commented 5 days ago

Hi @alexjfinch

please use the following command (where I've changed the name the initrd img file)

/usr/libexec/qemu-kvm \
-kernel bzImage \
-initrd initrd-lvm-libgcrypt-3.12.6.img  \
-append "root=/dev/ram0 rw init=/bin/busybox console=ttyS0" \
-nographic -m 1024M \
-serial mon:stdio 

and add the drive block in according with the readme file

-drive file=sdb3.img,format=raw \
-drive file=/dev/disk_were_copy,format=raw \

This new initrd img files works on my lab but I'm unable to test the mount of luks partition because I don't have any such test volume.

If you share with me how do you do for create this volume I can try to reproduce and test it with the image.

let me know.