From 2af0348fd3e635abaff04bf31b19ed183e407a5a Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Tue, 21 Jul 2015 14:06:59 -0700 Subject: [PATCH] Add element to disable cloud-init resizefs The resize module is problematic for using grub on very large root partitions. It is also extremely slow on large partitions, and users are likely better off creating new partitions in the empty space. Change-Id: Ic050c74aa71165b43c8908c4d6c7c0ea99ddafa3 Story: 2000175 --- elements/cloud-init-disable-resizefs/README.rst | 7 +++++++ .../post-install.d/50-cloud-init-disable-resizefs | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 elements/cloud-init-disable-resizefs/README.rst create mode 100755 elements/cloud-init-disable-resizefs/post-install.d/50-cloud-init-disable-resizefs diff --git a/elements/cloud-init-disable-resizefs/README.rst b/elements/cloud-init-disable-resizefs/README.rst new file mode 100644 index 00000000..0be8e28f --- /dev/null +++ b/elements/cloud-init-disable-resizefs/README.rst @@ -0,0 +1,7 @@ +Disable cloud-init's resizefs module +------------------------------------ + +The cloud-init resizefs module can be extremely slow and will also +unwittingly create a root filesystem that cannot be booted by grub if +the underlying partition is too big. This removes it from cloud.cfg, +putting the onus for resizing on the user post-boot. diff --git a/elements/cloud-init-disable-resizefs/post-install.d/50-cloud-init-disable-resizefs b/elements/cloud-init-disable-resizefs/post-install.d/50-cloud-init-disable-resizefs new file mode 100755 index 00000000..156abd7a --- /dev/null +++ b/elements/cloud-init-disable-resizefs/post-install.d/50-cloud-init-disable-resizefs @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +sed -ie 's/^ - resizefs$//' /etc/cloud/cloud.cfg