[SOLVED] datastore recovery

luphi

Renowned Member
Nov 9, 2015
82
5
73
Let's assume, I install the Server in that way, that I have one dedicated disk for the OS and one dedicated disk for the datastore.
When I have to replace the OS disk for any reason and reinstall from scratch, is there any way to import the datastore disk or are all the backups lost?

When I simply try to recreate it, it ends up with Error: unable to create chunk store 'ds1' subdir "/var/lib/vz/dump/.chunks" - EEXIST: File exists

Cheers,
luphi
 
When I have to replace the OS disk for any reason and reinstall from scratch, is there any way to import the datastore disk or are all the backups lost?

All important data, chunks and indexes are stored in the datastore path. So, just re-add it under the same path.
For now, you can simply add it to /etc/proxmox-backup/datastore.cfg:
Code:
datastore: name
        path /path/to/previous/ds

The respective add command will be enhanced to make such a process easier.
 
I agree with this post.
I have the opposite example.

I had to replace the data disk where the backups are saved. I copied everything from the old disk to the new one, I edited the cfg file but when I go to browse the contents of the datastore I get this error

Code:
Bad Request (400)
unable to detect file type

[SOLVED]
In case of data disk replacement, you need to change the folder permissions.

chown backup:backup .chunks ct vm .locks -R

solved my problem
 
Last edited:
All important data, chunks and indexes are stored in the datastore path. So, just re-add it under the same path.
For now, you can simply add it to /etc/proxmox-backup/datastore.cfg:
Code:
datastore: name
        path /path/to/previous/ds

The respective add command will be enhanced to make such a process easier.
Ok, and if the path is no longer known?
 
Ok, after i add these entries directly manualy in the configfile it works perfectly. a
 
Ok, and if the path is no longer known?
You could search for all directories containing a .chunks sub-directory, as those normally distinguishes datastores.

For example, by using the following command:
Bash:
find / -type d -path '*/.chunks/*' -prune -o -name '.chunks' -print
note that while this is already a bit optimized (doesn't enters any found .chunks avoiding to search lots of directories) it still searches the whole filesystem tree and all its mounted filesystems, so it may be quite slow.
 
  • Like
Reactions: Nanobug and fireon
You could search for all directories containing a .chunks sub-directory, as those normally distinguishes datastores.

For example, by using the following command:
Bash:
find / -type d -path '*/.chunks/*' -prune -o -name '.chunks' -print
note that while this is already a bit optimized (doesn't enters any found .chunks avoiding to search lots of directories) it still searches the whole filesystem tree and all its mounted filesystems, so it may be quite slow.
I edit the datastore.cfg
I can see the datastore in PBS.

I can create new backup to datastore from Proxmox
however i cant see all the previous backup data.

Update:
I notice datastore use some kind of encoding as it was mount from samba. Rename it seems to fix the issue .
I am sharing incase someone having same issue

Code:
PBS:/mnt/hdd/pbs/ct/111# ls -la
total 24
drwxrwxrwx 5 backup backup 4096 Oct 24 17:44  .
drwxrwxrwx 6 backup backup 4096 Oct 24 17:40  ..
drwxrwxrwx 2 backup backup 4096 Oct 23 22:34 '2022-10-23T09'$'\357\200\242''49'$'\357\200\242''16Z' <--- samaba
drwxrwxrwx 2 backup backup 4096 Oct 23 22:34 '2022-10-23T10'$'\357\200\242''17'$'\357\200\242''22Z'
drwxr-xr-x 2 backup backup 4096 Oct 24 17:44  2022-10-24T17:44:33Z   <- bindmount
-rw-rw---- 1 backup backup   10 Oct 23 09:49  owner
 
I can't make it running ...

I edited the cfg

1720467746931.png

but it allways state Datastore not available

1720467780781.png
 
check with mount command if your nas is mounted. nfs or samba require mount to be browsable.
 
Thanks for the hint. I found it .....

Now I can add the pbs to my storages, but still can't see the backups.

A verify show me this:

1720471836701.png

So it seems I'm on the right way, but still missing the backups

1720471872319.png
 
fix file system permissions with :
chown backup:backup -R /path/to/your/datastore
chmod -R 700 /path/to/your/datastore
 
I tried this:

touch /mnt/backup/test_file

and the file was created.

Tha datastore is on a Synology NAS.
 
@edwin_nl020 you just have to replace the "square characters" with ":" and the PBS should be able to read the folders again.
I guess, the filename encoding gets lost on the file share…
 
  • Like
Reactions: edwin_nl020

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!