Last active
August 29, 2015 14:07
-
-
Save fxlv/a5b2782ca1735105b4d5 to your computer and use it in GitHub Desktop.
LVM based crypto filesystem extending
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET=/some/dir | |
CRYPTO_DEVICE_NAME=/dev/mapper/crypto_super_secure | |
LVM_VOLUME=/dev/SOMETHING/SOME_LVM_VOLUME | |
# | |
echo "Unmounting $TARGET" | |
umount $TARGET | |
echo "Extending" | |
lvextend -L +100g $LVM_VOLUME | |
echo "Resizing crypto" | |
cryptsetup --verbose resize $CRYPTO_DEVICE_NAME | |
echo "Checking the file system" | |
e2fsck -f /dev/mapper/$CRYPTO_DEVICE_NAME | |
echo "Resizing the file system" | |
resize2fs -p /dev/mapper/$CRYPTO_DEVICE_NAME | |
echo "All done, mounting back the filesystem" | |
mount /dev/mapper/$CRYPTO_DEVICE_NAME $TARGET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment