1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-24 17:57:48 +03:00

fsadm: respect DM_DEV_DIR variable

This commit is contained in:
Ondrej Kozina 2017-10-10 17:43:45 +02:00
parent e02e5b0c5b
commit 74fd0dd6c4

View File

@ -584,14 +584,14 @@ resize_luks() {
NEWCBLOCKCOUNT=$((NEWBLOCKCOUNT - CRYPT_DATA_OFFSET)) NEWCBLOCKCOUNT=$((NEWBLOCKCOUNT - CRYPT_DATA_OFFSET))
NEWFSIZE=$(( NEWCBLOCKCOUNT * 512)) NEWFSIZE=$(( NEWCBLOCKCOUNT * 512))
VOLUME="/dev/mapper/$NAME" VOLUME="$DM_DEV_DIR/mapper/$NAME"
detect_device_size detect_device_size
test "$DEVSIZE" -le "$NEWSIZE" || SHRINK=1 test "$DEVSIZE" -le "$NEWSIZE" || SHRINK=1
if [ $SHRINK -eq 1 ]; then if [ $SHRINK -eq 1 ]; then
# shrink fs on LUKS device first # shrink fs on LUKS device first
resize "/dev/mapper/$NAME" "$NEWFSIZE"b resize "$DM_DEV_DIR/mapper/$NAME" "$NEWFSIZE"b
fi fi
# resize LUKS device # resize LUKS device
@ -599,7 +599,7 @@ resize_luks() {
if [ $SHRINK -eq 0 ]; then if [ $SHRINK -eq 0 ]; then
# grow fs on top of LUKS device # grow fs on top of LUKS device
resize "/dev/mapper/$NAME" "$NEWFSIZE"b resize "$DM_DEV_DIR/mapper/$NAME" "$NEWFSIZE"b
fi fi
} }