Skip to content

Instantly share code, notes, and snippets.

@vsoch
Created February 7, 2014 21:11
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 vsoch/8871917 to your computer and use it in GitHub Desktop.
Save vsoch/8871917 to your computer and use it in GitHub Desktop.
Startup script for pseq-instance on GCE
#!/bin/bash
# Key off existence of the "data" mount point to determine whether
# this is the first boot.
if [[ ! -e /mnt/data ]]; then
# Basic setup - get the JRE installed
apt-get update
apt-get install --fix-broken
mkdir -p /mnt/data
fi
# Get the device name of the "data" disk
DISK_DEV=$(basename $(readlink /dev/disk/by-id/google-pseq))
# Mount the data disk
/usr/share/google/safe_format_and_mount \
-m "mkfs.ext4 -F" /dev/$DISK_DEV /mnt/data
chmod 777 /mnt/data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment