Skip to content

Instantly share code, notes, and snippets.

@fl64
Created November 21, 2018 12:28
Show Gist options
  • Save fl64/559c7bb213e25dc635c02fae3c1061e3 to your computer and use it in GitHub Desktop.
Save fl64/559c7bb213e25dc635c02fae3c1061e3 to your computer and use it in GitHub Desktop.
Root partition extender
[Unit]
Description=Root partition extender
[Service]
Type=oneshot
ExecStart=/bin/bash /usr/local/sbin/root-extend.sh
[Install]
WantedBy=multi-user.target
#/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