Automount Volume created from a snapshot

Posted July 31, 2020 888 views
DigitalOcean Volumes

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?

1 comment
  • 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.

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.

Submit an Answer
1 answer

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.