[SOLVED] Change datastore locations with no data loss possible?

neuron

Active Member
Mar 15, 2019
25
3
43
43
I goofed when I first setup and configured my PBS server.

I have 10x 8TB drives that I am doing a RAID-10 mirror with ZFS for approximately 40TB of usable storage.

I set up a datastore called vm-backups that is using ALL of that available space, because that's the point right? The pool name and the primary datastore mount point for this is:

Code:
/mnt/datastore/vm-backups

I have my entire colo infrastructure of 4 PVE servers with about 30 VMs backing up to this location.

I have been deploying outside servers using Proxmox and opening up my colo PBS server to those outside servers to be able to backup VMs separately.

So I added another datastore called ges-backups at this mount point:

Code:
/mnt/datastore/vm-backups/ges-backups

At first I tried to actually use the "root" datastore vm-backups but it turned out that the VM IDs clashed. Oops. so that's why I created a nested datastore inside the main one. Now I'm seeing a lot of garbage collection warnings because it's "seeing" the ges-backups inside of the main vm-backups datastore and throwing thousands of warnings as they clash. I've done verifications of both datastores and all check out ok but clearly this isn't best practice.

So my main question is, is it possible to move the vm-backups into another sub-directory and have nothing lost? I want them both to be mounted on the same ZFS vm-backups pool, but move the mount points so it's all separate from each other. This is what I want:

Code:
/mnt/datastore/vm-backups
change to:
Code:
/mnt/datastore/vm-backups/pvecolo

Code:
/mnt/datastore/vm-backups/ges-backups
(leave as-is)
 
You could first create the ZFS at /mnt/datastore/vm-backups/pvecolo and create the datastore on top of this. Then configure a remote [1] using 'localhost' as the host and a user with with appropriate permissions, and pull the contents from the vm-backups datastore to pvecolo. Then after testing that the backups on pvecolo work, you can remove the vm-backups datastore.

[1] https://pbs.proxmox.com/docs/managing-remotes.html
 
you can also edit datastore.cfg and set the mountpoint properties of the two datasets in question, but that is not possible without downtime for obvious reasons ;)
 
@fabian this was the answer I was looking for. I just simply need to change this:

Code:
root@pbs:~# proxmox-backup-manager datastore list
┌─────────────┬───────────────────────────────────────┬─────────┐
│ name        │ path                                  │ comment │
╞═════════════╪═══════════════════════════════════════╪═════════╡
│ ges-backups │ /mnt/datastore/vm-backups/ges-backups │         │
├─────────────┼───────────────────────────────────────┼─────────┤
│ vm-backups  │ /mnt/datastore/vm-backups             │         │
└─────────────┴───────────────────────────────────────┴─────────┘

to this:

Code:
root@pbs:~# proxmox-backup-manager datastore list
┌─────────────┬───────────────────────────────────────┬─────────┐
│ name        │ path                                  │ comment │
╞═════════════╪═══════════════════════════════════════╪═════════╡
│ ges-backups │ /mnt/datastore/vm-backups/ges-backups │         │
├─────────────┼───────────────────────────────────────┼─────────┤
│ vm-backups  │ /mnt/datastore/vm-backups/pve-backups │         │
└─────────────┴───────────────────────────────────────┴─────────┘

So, how can I do this step-by-step, including the disabling of key services to allow me to change the mountpoint, move the actual files over into it, and restart everything to be done with it?
 
Ok, like a good admin, I RTFM and did it all by myself. Do I get a cookie?

This is what I did, and it was very simple lol

  1. SSH in directly to the machine, since stopping services will kill the GUI
  2. systemctl stop proxmox-backup
  3. cd /mnt/datastore/vm-backups
  4. mkdir pve-backups/
  5. mv vm pve-backups/
  6. mv .lock pve-backups/
  7. mv .chunks pve-backups/
  8. nano /etc/proxmox-backup/datastore.cfg
  9. Changed the path under datastore: vm-backups to /mnt/datastore/vm-backups/pve-backups
  10. Saved the file
  11. Restarted the proxmox-backup service: systemctl start proxmox-backup
  12. Logged into the GUI and saw everything check out ok under Content, GC & Verify, and even ran a manual verification of a single backup just to double-check
I don't believe I missed anything but if anyone sees something that I missed, please let me know. This should be added to the documentation under Datastore management IMHO because for sure, someone will need to move storages or paths for whatever reason (like I did with my mistake of creating a nested datastore inside one already which isn't best practice).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!