Add existing directory back as datastore

ropeguru

Well-Known Member
Nov 18, 2019
39
2
48
66
I have an issue with my PBS and had to reinstall it from scratch. The datastore is on a different drive and all the data is intact still. It was mounted as a directory and I am trying to figure out how to add it back into PBS without wiping all the data. Do I use the normal process in the GUI? I added a test one and see where the datastore config is, but I cannot find where the config is stored that actually mounts the filesystem. It is not in the fstab.
 
Hi,
for filesystems like ext4 and xfs, systemd mount units are used to mount the filesystem in PBS. You can recreate one for your datastore under /etc/systemd/system. For example, to mount a datastore called test the mount unit would be called by filename mnt-datastore-test.mount with
Code:
[Install]
WantedBy=multi-user.target

[Unit]
Description=Mount datatstore 'test' under '/mnt/datastore/test'

[Mount]
Options=defaults
Type=ext4
What=/dev/disk/by-uuid/<your-uuid>
Where=/mnt/datastore/test

You can the mount via systemctl enable --now mnt-datastore-test.mount. Once mounted, you recreate the datastore via the WebUI, checking the Reuse existing datastore checkbox in the advanced section of the datastore create window and point the path to the correct location.
 
Last edited:
  • Like
Reactions: Johannes S