Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save geekcui/0c584090b979be9cf259d5f4607a0a4b to your computer and use it in GitHub Desktop.
Save geekcui/0c584090b979be9cf259d5f4607a0a4b to your computer and use it in GitHub Desktop.
Install growpart on CentOS 6.8 to support growing partition on boot in EC2.
#!/bin/bash
set -e
set -u
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
yum install -y \
cloud-init cloud-utils-growpart \
dracut-modules-growroot
# Update initramfs for all kernels ...
while read version; do
version=${version#*-}
dracut -f -H /boot/initramfs-${version}.img $version
done < <(rpm -qa kernel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment