New VM never gets mounted

I typically use one OS and one data partition for my VMs on Verda. I keep the partitions saved when I destroy a VM, and then re-use OS partition for my new VM, and also use and mount data partition, under /data. However, for the new VM, data partition never gets mounted, even if I have startup script:

#!/bin/bash

mkdir -p /data
mount /dev/vdb /data

Is there some kind of problem with that?

Hi,

When you use a startup script in the cloud console, it runs only once (the first time the OS boosts)

So if you are reusing the OS volume, this script won’t run again

You can (from the startup script) add a record to fstab to mount /dev/vdb if it exists. Then it should try to mount it on every boot.

echo "/dev/vdb /mnt/data ext4 defaults,nofail 0 0" >> /etc/fstab

mount /mnt/data