Skip to content

Instantly share code, notes, and snippets.

@boostrack
Forked from exocode/xfs-on-hetzner.yml
Created February 1, 2021 23:37
Show Gist options
  • Save boostrack/64f158533bb64ff05ccd0b332f566c4b to your computer and use it in GitHub Desktop.
Save boostrack/64f158533bb64ff05ccd0b332f566c4b 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