Skip to content

Instantly share code, notes, and snippets.

@mjrider
Created March 10, 2018 19:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjrider/b236c51c53a47694c5283893edd61eb6 to your computer and use it in GitHub Desktop.
Save mjrider/b236c51c53a47694c5283893edd61eb6 to your computer and use it in GitHub Desktop.
user-config for hetzner cloud, to get a smaller root partition
#cloud-config
# do not reisze, we are going to do that our self. Because the resizefs will run before the disk setup
resize_rootfs: false
# setup disk, overwriting our live partition scheme
# results in a 4G/16GB split on a cx11
# overwrite needs to be true because we are going to change the layout of an existing drive
disk_setup:
/dev/sda:
table_type: 'mbr'
layout:
- 20
- 80
overwrite: True
# run commands cloud-init to finish the changes
# reload partition table
# resize rootfs
runcmd:
- [ partx, --update, /dev/sda ]
- [ resize2fs, /dev/sda1 ]
@ctron
Copy link

ctron commented Mar 29, 2018

I was unable to reproduce a change in disk size with this setup. I brought me up the CX11 with a single partition of the full disk size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment