Expand partitions/fs in linux

Resizing partitions

Sometimes necessary so lets write this down so I won't forget next time.

This is easy for expanding. If you want to shrink the size it is going to be a bit harder, and I am not covering it in this note.

fdisk -l /dev/sda

growpart --dry-run /dev/sda 2
# ^ device and then the partition to grow
# The partition on the disk is now expanded.
# now to expand the filesystem it contains

df -h
resize2fs /dev/sda2

Github authorized_keys into terraform list

I needed to create a list of my authorized keys from the Github source in terraform. The following will provide a list that you can use. Handy for cloud init.

data "http" "github-keys" {
  url = "https://github.com/ledakis.keys"
}

output "keys" {
    value = compact(split("\n",data.http.github-keys.body))
}

Gist here.

© Copyright 2019-2020 by Theocharis Ledakis.