Created
November 21, 2018 12:28
-
-
Save fl64/559c7bb213e25dc635c02fae3c1061e3 to your computer and use it in GitHub Desktop.
Root partition extender
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
[Unit] | |
Description=Root partition extender | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/bash /usr/local/sbin/root-extend.sh | |
[Install] | |
WantedBy=multi-user.target |
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
#/usr/bin/env bash | |
flag=/root-extender | |
disk=/dev/sda | |
if [ ! -f $flag ]; then | |
parted ${disk} resizepart 2 100% | |
parted ${disk} resizepart 5 100% | |
pvresize ${disk}5 | |
lvextend -r /dev/vg00/lv_root -l +100%FREE | |
touch $flag | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment