[ubuntu-cloud] On lucid/10.04: setting up /mnt ephemeral

Daniel Farina daniel at heroku.com
Sat Nov 5 03:47:57 UTC 2011


Hello List,

I have been stymied by an attempt to deterministically, correctly, and
cleanly create a directory on the ephemeral disk on boot-up on Ubuntu
Lucid (10.04) and set its permissions by using an additional upstart
file in /etc/init like:

# mounted-ephemeral-setup.conf - Set-up /mnt which is an ephemeral disk
#
# Sets up the layout and permissions of subdirectories in /mnt for use
# at run-time.

description	"Set up /mnt ephemeral"

start on mounted MOUNTPOINT=/mnt

task

script
    SUBDIR = "${MOUNTPOINT}"/adirectory
    mkdir "${SUBDIR}"/
    chown -R user:group "${SUBDIR}"
    chmod go-rwx "${SUBDIR}"
end script

I notice that I never seem to create the directory on a start/stop
cycle of my instance, although an operating system level "restart"
seems to do the trick.  I looked around for functionality in
cloud-init, but its exact functionality and intended hooks are still
pretty impenetrable.

My starting point was the /tmp cleaning upstart job, which is why I
believe this may have something to do with a ephemeral-disk specific
problem treated by cloud-init.

As a bonus, I'd like to format that ephemeral disk as btrfs rather
than use the ext3 default, but right now I'm just trying to prepare
/mnt in a non-hacky way.

Any ideas or advice?

-- 
fdr



More information about the Ubuntu-cloud mailing list