Created
April 14, 2024 07:51
-
-
Save reski-rukmantiyo/056443b0301217a97be11eede14adb14 to your computer and use it in GitHub Desktop.
Modify Partition via Cloud-Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
package_update: true | |
package_upgrade: true | |
resize_rootfs: false | |
write_files: | |
- content: | | |
# Any text | |
path: /etc/growroot-disabled | |
runcmd: | |
- [ sgdisk, -e, /dev/vda ] | |
- [ partprobe ] | |
# create partition for /var, /var/log, /tmp | |
- [ parted, -s, /dev/vda, mkpart, first, xfs, "50%", "80%" ] | |
- [ parted, -s, /dev/vda, mkpart, secondary, xfs, "80%", "95%" ] | |
- [ parted, -s, /dev/vda, mkpart, third, xfs, "95%", "100%" ] | |
# / | |
- [ growpart, /dev/vda, 1 ] | |
- [ resize2fs, /dev/vda1 ] | |
# create partition for /var, /var/log, /tmp | |
- [ mkfs.xfs, /dev/vda2 ] | |
- [ mkfs.xfs, /dev/vda3 ] | |
- [ mkfs.xfs, /dev/vda4 ] | |
# /var | |
- [ mkdir, -p, /mnt/vda2-newvar ] | |
- [ mount, /dev/vda2, /mnt/vda2-newvar ] | |
- [ rsync, -aqxP, /var/, /mnt/vda2-newvar/ ] | |
- [ umount, /mnt/vda2-newvar ] | |
- [ mount, /dev/vda2, /var ] | |
# /var/log | |
- [ mkdir, -p, /mnt/vda3-newlog ] | |
- [ mount, /dev/vda3, /mnt/vda3-newlog ] | |
- [ rsync, -aqxP, /var/log/, /mnt/vda3-newlog/ ] | |
- [ umount, /mnt/vda3-newlog ] | |
- [ mount, /dev/vda3, /var/log ] | |
# /tmp | |
- [ mkdir, -p, /mnt/vda4-newtmp ] | |
- [ mount, /dev/vda4, /mnt/vda4-newtmp ] | |
- [ rsync, -aqxP, /tmp/, /mnt/vda4-newtmp/ ] | |
- [ umount, /mnt/vda4-newtmp ] | |
- [ mount, /dev/vda4, /tmp ] | |
- [ systemctl, restart, systemd-journald ] | |
ssh_authorized_keys: | |
- ssh-rsa BBAAB3NzaC1yc2EAAAADAQABAAABgQCqNFLLu3x6NGwIbacglQ/m3k3Wo6953rkbE8ZOfa+V6zLdfD9NZmjU2Yc5lJLcIMLz7HZYs3RILNnjYqlMLW6BohoOUiFT7FokGfdzStEmT7BbQMHxXD315DHRYWsQx9o1RWVP1O2mQTT7iAoljxxGJ5CL7qcQhrWbkg7fBv/C6ICum8BIiLGueuulWUjkJNS2upkSjTE2xAZVpHgeoqr2peHo/0MIRWy713+YZ5eOeQ8Ns8mqL5AY+KsuTVe9zBrRlDmOSSFvcr7UHvLvNIPR2FbejwIrcUEuvFKMwUTw60OkBPuj+xKdFJTxjH7mYLLkaoQ7qV/0cfLNHQum/tXdoGwHNEv/30gX3XrsZFSfA0RzLl0ndqWVlyRnRF1Mq7FTXMN5nhtan0q7JohG/zfIWKQ6+QmcLtrYkjDFMpHlkOlSiyVcpzZZeLY9AHRLiVzIv9Ae/1ag6ezVZQC6CENn37SkzDAT5jaA8hRT43+jaGj/EypaoZL6cPvv+mm/j68= funky@Reskis-MacBook-Pro-2.local | |
password: rootPassword | |
chpasswd: { expire: False } | |
ssh_pwauth: False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment