One purpose of this blog is to have a convenient place for me and others to look up repeatable processes. In this case, it’s mostly about me. But you are welcome.
Minimal explanation here – There are good explanations of these steps elsewhere on the web. Double click the code boxes to copy (YMMV).
Situation: You spin up a Linux instance with an additional drive, which you would like to access as /data.
sudo -i #if necessary
lsblk #if necessary
mkfs -t ext4 /dev/xvdb
sudo mount /dev/xvdb /data
cp /etc/fstab /etc/fstab.orig
echo "/dev/xvdb /data ext4 defaults,nofail 0 2" >> /etc/fstab
mount -a #test
Basic Run Script
If your linux dist uses Upstart, put something like this into /etc/init/myapp.conf.
description "A Bamboo remote agent daemon job file for Upstart"
author "Your name"
start on runlevel 
stop on shutdown
logger "[`date`] Bamboo remote agent starting"
exec /etc/init.d/bamboo-agent.sh start
exec /etc/init.d/bamboo-agent.sh stop
logger "[`date`] Bamboo remote agent stopping"