Created
March 14, 2018 13:18
-
-
Save libussa/6df930d1a82d31338f7813de936e1681 to your computer and use it in GitHub Desktop.
shrinking lxc disk
This file contains hidden or 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
# Check file system | |
e2fsck -f vm-101-disk-2.raw | |
# Resize fs to new-size (will fail if not enough space empty) | |
resize2fs vm-101-disk-2.raw <new-size> | |
# Truncate image file, with some security (truncate will happen no matter what, +1GB is here to make sure we don't fck things up) | |
truncate -s <new-size + 1GB> vm-101-disk-2.raw | |
# Re-expand the fs to take up all the space (including the security from before) | |
resize2fs vm-101-disk-2.raw | |
# Edit container config to reflect new size | |
nano /etc/pve/lxc/101.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment