From 61901fd66ee38fb38d360b06559cc219e4c0f27b Mon Sep 17 00:00:00 2001 From: Jan Orel Date: Fri, 3 May 2019 14:27:36 +0200 Subject: [PATCH] B #148: Use findmnt to find / device --- src/etc/one-context.d/loc-05-grow-rootfs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/etc/one-context.d/loc-05-grow-rootfs b/src/etc/one-context.d/loc-05-grow-rootfs index d3504aa..94bb2eb 100755 --- a/src/etc/one-context.d/loc-05-grow-rootfs +++ b/src/etc/one-context.d/loc-05-grow-rootfs @@ -18,9 +18,9 @@ if [ $? -ne 0 ]; then exit 1 fi -if [ $(grep mapper /etc/fstab |grep ' / ' |wc -l) -eq 0 ]; then - DEVICE=$(readlink -f "$DEVICE") - DISK=$(echo "$DEVICE" | sed 's/.$//') +if [ $(lvdisplay ${DEVICE} 2>/dev/null | wc -l) -eq 0 ]; then + DEVICE=$(findmnt -ln -o SOURCE /) + DISK=$(echo "$DEVICE" | sed 's/[0-9]*$//') PARTITION=$(echo "$DEVICE" | sed "s|^$DISK||") LVM="no" fi