Mounting an additional partition

I would like to run a couple of lightweight containers on VyOS and I would like to keep their file systems separate from VyOS. I have added a separate SSD to the machine, partitioned and formatted it.

Now, I know I can mount the partition in /config/scripts/vyos-postconfig-bootup.script, but I was wondering if there’s a canonical mount point and maybe some CLI that I have completely missed. I scanned the documentation and searched it, but could not find anything.

Second question - how do I redirect the images downloaded with “add container image” to this new partition?

I assume you have already read through the stuff about containers over at Container — VyOS 1.4.x (sagitta) documentation ?

As far as I know everything you put in /config (including subfolders) will be migrated (aka copied) to new system image once you perform an upgrade through “add system image”.

If you choose to have your containers on separate drive then using “/config/scripts/vyos-postconfig-bootup.script” (or perhaps rather the /config/scripts/vyos-preconfig-bootup.script so the container files are available when the config is being compiled during boot) is the option to use so that partition is being mounted.

Personally I would mount that as /config/containers or /opt/containers or /mnt/containers, probably one of the two later since you use a dedicated drive for them.

Yes, I did, but I could not find the answers to my questions. Mounting of an additional partition is out of scope for that section of documentation.

It seems the container overlays are in /usr/lib/live/mount/persistence/container/storage/overlay. I can’t seem to find how to select my mount point for this, in case I run out of space on my main partition.

You should change /etc/containers/storage.conf

But it won’t be persist during updates/reboots
You could change template https://github.com/vyos/vyos-1x/blob/current/data/templates/container/storage.conf.j2

Add configurable storage on separate disk could be a good feature request, create it https://vyos.dev/

3 Likes

Good idea: ⚓ T5441 Add the ability to mount an external device and ⚓ T5442 Allow configuring where container overlays are stored