Automount Volume created from a snapshot

Using the API, I would like to attach a volume created from a snapshot and auto-mount it.

My original solution was to modify the script and save it back to the snapshot. This worked well, until an update to the Ubuntu image changed the script and added some checks which prevent this work working.

I have a solution, but maybe I’m missing something.

Is there a better approach to auto-mounting a volume created from a snapshot?


Just to clarify, I am looking at auto-mounting after immediately after creating and attaching via the DO API, rather than auto-mounting after start up.

In my environment, I am creating the storage, using it, then disposing of it in a single task.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Just be sure it’s assigned to your droplet and then edit /etc/fstab and add the volume there. Here is a tutorial on using fstab.