Change image storage directory of MAAS

Hi all

I’m using the snap. My server’s disk is getting full and I want it to use a directory under /mnt to store images. Is this possible? Should I just symlink the directory?

Hi, it’s not possible to configure it in MAAS

1 Like

Thanks for letting me know!

For future reference, I used a bind mount to use a different storage location.

I’ve changed the maas storage directory for images to /mnt, which has a larger disk.

# Stop the snap
systemctl stop maas
# Move the directory
mv /var/snap/maas/common/maas/image-storage /mnt/image-storage
# Create an empty directory in its place
mkdir /var/snap/maas/common/maas/image-storage

Then create the following bind mount config file in '/etc/systemd/system/var-snap-maas-common-maas-image\x2dstorage.mount'.

Note: the \ in the name is important. Always use single-quotes when using this filename to ensure it’s correct.

Change the “what” to the directory you want the images to be stored in.

[Unit]
Description=bind mount image storage from /mnt/ to /var/

[Mount]
What=/mnt/image-storage
Where=/var/snap/maas/common/maas/image-storage
Options=bind

[Install]
WantedBy=multi-user.target
RequiredBy=snapd.service

To test it out.

systemctl daemon-reload
systemctl start 'var-snap-maas-common-maas-image\x2dstorage.mount'

To turn it on at startup.

systemctl daemon-reload
systemctl enable 'var-snap-maas-common-maas-image\x2dstorage.mount'

The turn MAAS back on

systemctl start maas

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.