Are changes made to an Ubuntu Core 18 system outside of snaps permanent?

Hey there!
I’m currently running Ubuntu Core 18 on a Raspberry Pi 3 and noticed that many directories within the root directory are mounted read-only. I assume the core snap provides these.

Let’s say I need to run a service outside of any snap directly on the host. This service consists of a systemd service declaration in /etc/systemd/system/ and some Bash scripts stored somewhere else.

Would a refresh of the base snap (or any other snap) or any different situation overwrite these changes and “remove” the manually created service?

This question refers to the standard prebuild Ubuntu Core 18 images. The modifications mentioned above are made after the image has been flashed to a storage medium and the device has been setup.

while you should really just pack your scripts as a snap (given how trivial that is), the answer to your qustion is … it depends :slight_smile:

writable directories in Ubuntu core are managed via /etc/system-image/writable-paths depending on how the writable bind mount is treated, the dirs are synced from the readonly path, are mounted as tempdirs or are permanent …

info about the diferent columns in the /etc/system-image/writable-paths file can be found at

http://manpages.ubuntu.com/manpages/bionic/man5/writable-paths.5.html

1 Like

Thanks for your explanation! :slight_smile:

here are some examples of simple scripts packaged as snaps:

or

and a little more complex one:

1 Like

I appreciate you adding the links and helping me get started. Thanks again :slight_smile: