summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Lane <iain.lane@canonical.com>2016-02-19 09:51:13 (GMT)
committerIain Lane <iain.lane@canonical.com>2016-02-19 09:52:20 (GMT)
commit055ab0887fedd8bbfef82751d6c75f106700b964 (patch)
treec88947e8f6323a9c9223da731a5fb2e888cd1356
parent425944cbf7c5c1cab6571093164d74fb9e2521ea (diff)
mirror-mounted: Write the volume into fstab so that it is mounted when we reboot
-rwxr-xr-xcharms/trusty/appstream-dep11/actions/mirror-mounted4
1 files changed, 3 insertions, 1 deletions
diff --git a/charms/trusty/appstream-dep11/actions/mirror-mounted b/charms/trusty/appstream-dep11/actions/mirror-mounted
index dbffb73..ebfaed7 100755
--- a/charms/trusty/appstream-dep11/actions/mirror-mounted
+++ b/charms/trusty/appstream-dep11/actions/mirror-mounted
@@ -17,7 +17,9 @@ chown ubuntu:ubuntu /srv/data
if ! mount -t ext4 ${device} /srv/data; then
juju-log 'No filesystem - creating...'
mkfs.ext4 ${device}
- mount -t ext4 ${device} /srv/data
+ UUID=$(blkid -s UUID -o value ${device})
+ echo "UUID=${UUID} /srv/data ext4 defaults 0 0" >> /etc/fstab
+ mount /srv/data
else
juju-log 'mounted'
fi