[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, 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: 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
 

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!