Skip to content

Instantly share code, notes, and snippets.

View leocomelli's full-sized avatar
Working from home

Leonardo Comelli leocomelli

Working from home
  • Matão/SP - Brazil
  • 09:14 (UTC -03:00)
View GitHub Profile
leocomelli /
Created March 31, 2020 04:19 — forked from raj-saxena/
Use the following script to mount a persistent storage during startup. This is helpful when you provision the compute instance as well as the persistent disk using some automation tool like Terraform. StackOverFlow question -
set -euxo pipefail
if [[ -d "$MNT_DIR" ]]; then
sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb; \
sudo mkdir -p $MNT_DIR