Skip to content

Instantly share code, notes, and snippets.

@fesplugas
Forked from exocode/xfs-on-hetzner.yml
Created May 29, 2020 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fesplugas/745c4760df2e8ab7958c5c40c305d374 to your computer and use it in GitHub Desktop.
Save fesplugas/745c4760df2e8ab7958c5c40c305d374 to your computer and use it in GitHub Desktop.
Create xfs partitions on Hetzner via cloud-init. It keeps root disk available again after rebooting. Simply change your desired sizes and filesystem to use it for your needs.
#cloud-config
resize_rootfs: false
disk_setup:
/dev/sda:
table_type: 'mbr'
layout:
- 25
- 75
overwrite: true
fs_setup:
- label: root_fs
filesystem: 'ext4'
device: /dev/sda
partition: sda1
overwrite: true
- label: data_disk
filesystem: 'xfs'
device: /dev/sda
partition: sda2
overwrite: true
runcmd:
- [ partx, --update, /dev/sda ]
- [ mkfs.xfs, /dev/sda2 ]
- [ partprobe ]
- parted /dev/sda set 1 boot on p
mounts:
- ["/dev/sda1", "/"]
- ["/dev/sda2", "/data_disk"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment