Skip to content

Instantly share code, notes, and snippets.

@mrwormhole
Last active January 27, 2024 06:31
Show Gist options
  • Save mrwormhole/5d4de419193445027687685d2a9a51f3 to your computer and use it in GitHub Desktop.
Save mrwormhole/5d4de419193445027687685d2a9a51f3 to your computer and use it in GitHub Desktop.
XFS disk partitioning on Hetzner, please adjust the percentages carefully so that root partition can have at least 5GB, or it won't do partitioning from this script. 25%~30% is ideal for 40GB SSD, 10% won't work for 40GB SSD
#cloud-config
# Ubuntu 22.04+
resize_rootfs: false
write_files:
- content: |
path: /etc/growroot-disabled
runcmd:
- [ sgdisk, -e, /dev/sda ]
- [ partprobe ]
- [ parted, -s, /dev/sda, mkpart, primary, xfs, "25%", "100%" ]
- [ mkfs.xfs, /dev/sda2 ]
- [ growpart, /dev/sda, 1 ]
- [ resize2fs, /dev/sda1 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment