From 508d3d69a50660b5a58406b8663ea03c8a45aeb6 Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Sun, 6 Jul 2025 16:56:15 +0200 Subject: [PATCH] =?utf8?q?Poprawienie=20skryptu=20immudex-crypt.=20Dopisan?= =?utf8?q?ie=20informacji=20o=20obs=C5=82ugdze=20LVM=20do=20funkcji=20pomo?= =?utf8?q?cy.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tools/sbin/immudex-crypt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/sbin/immudex-crypt b/tools/sbin/immudex-crypt index d951a5f..ec76d68 100755 --- a/tools/sbin/immudex-crypt +++ b/tools/sbin/immudex-crypt @@ -15,6 +15,12 @@ function help() { echo "# immudex-crypt create "; echo "# immudex-crypt open "; echo "# immudex-crypt close immudex-crypt[0-9] | ic[0-9] | [0-9]"; + echo "LVM prep:"; + echo "It's possible to mount EXT4 LV with your data, behind LUKS. For now"; + echo "only open function works, so you need prepare whole LVM structure on"; + echo "your disk or partition even with file system instalation. If there is"; + echo "only one EXT4 LV it will be mounted automaticly, but if there is more"; + echo "than one, you will be asked to choose which one shoud be mounted."; } function list() { @@ -29,12 +35,16 @@ function list() { if [ "$mapperDeviceList" ]; then for dmDevice in $mapperDeviceList; do if cryptsetup status /dev/mapper/${dmDevice} > /dev/null 2>&1; then - mountPoint=$(df --output=source,target /media/${USER}/${dmDevice} | tail -n 1 | awk '{printf $2}'); + mountPoint=$(df --output=source,target /dev/mapper/${dmDevice} | tail -n 1 | awk '{printf $2}'); device=$(sudo cryptsetup status /dev/mapper/${dmDevice} | grep "device" | awk '{printf $2}'); if [ "$mountPoint" ] && [ "$mountPoint" != "/dev" ]; then echo -e "$device\t /dev/mapper/${dmDevice}\t$mountPoint"; else - echo -e "$device\t /dev/mapper/${dmDevice}\tNot mounted"; + if $(sudo blkid | grep "${dmDevice}" | grep -q "LVM2_member"); then + echo -e "$device\t /dev/mapper/${dmDevice}\tNot mounted (LVM2_member)"; + else + echo -e "$device\t /dev/mapper/${dmDevice}\tNot mounted"; + fi fi fi done -- 2.39.5