How can maas reinstall a system without formatting the hard disk other than the bootdisk?

I often need to reinstall my system, but I want to keep the data on the other disks.
If I manually go from release to deployed without changing anything, the original data disk will be formatted. I know I can workaround this by removing the machine disk from maas, but that’s not the best way to do it.
Is there a better solution? THX

Need help!!!!!!!!!!!!!!!!

Hi @maristelsksk .

The first thing that comes to my mind is to delete the disk from the machine using the UI or the CLI.
Then, when you deploy the machine you can use a cloud-init custom script like

#!/bin/sh

echo "== User custom script start =="
echo "UUID=<uuid> /data ext4 defaults 0 2" >> /etc/fstab
mkdir /data
mount -U <uuid> /data
echo "== User custom script done =="

You can retrieve the UUID by running

sudo blkid

Does this help? Of course you have to modify the script according to your setup.

Btw, In case you don’t know, Canonical provides enterprise support and consultancy for MAAS (you can read more here).

I know it is possible to retain disk data in this manual way.
I was expecting a more refined method, such as the option to retain data from a specified disk.
Is there a similar plan? I think it’s very common for bare metal reinstall to need to keep the data disk in place

No plans at the moment. I’ll mark this as feature request. Thank you for sharing your use cases!