How to properly disable (temporarerly) a datastore?

epionier

New Member
Oct 21, 2024
15
0
1
Hello,
I have setup in a PBS an external USB-SSD-Disk as a datastore (name zfsbackupext) for offsite backups that are done once a week.
During the other days I want to disable the Datastore for the PBS because the USB disk is not connected to the PBS and reenable it when the USB disk is connected again.

I made a crontab with following commands:

/sbin/proxmox-backup-manager datastore update zfsbackupext --maintenance-mode=offline ->"disable before disconnection"
/sbin/proxmox-backup-manager datastore update zfsbackupext --delete maintenance-mode ->"enable after connection"

which works in terms of putting the datastore in maintenance mode and ending maintenance mode.

But now I receive every minute a log entry when the disk is not connected:

proxmox-backup-proxy[1762]: lookup_datastore failed - unable to open chunk store at "/mnt/datastore/zfsbackupext/.chunks" - No such file or directory (os error 2)

The USB disk was properly disabled/unmounted via crontab in following order:

/sbin/pvesm set PBS-localUSB -disable 1 -> disable PBS datastore storage in PVE
/sbin/proxmox-backup-manager datastore update zfsbackupext --maintenance-mode=offline -> put PBS datastore in maintenance mode
/sbin/zpool export zfsbackupext -> remove zfs file system (temporarerely)
root /usr/bin/echo 1 > /sys/block/sdc/device/delete 2>&1 -> disconnect USB disk / block device

Is there another way or even a better way to disable the USB datastore to prevent logging?
 
Last edited:
  • Like
Reactions: UdoB
@groque
Thank you for your input. Removable Datastores only work with EXT4 oder XFS disks, not ZFS formatted disks like mine.

I have PBS and PVE installed on the same host (direct installation) and tried it with "removable datastore" and EXT4 directory in advance.
Unfortunately I was not able to get it working. When I tried to add a datastore with removable option I received unspecified errors.

I now tried it again with XFS directory as a removeable storage. This works but now I receive every minute the following when the removable USB is properly unmounted and block deleted in advance:

proxmox-backup-proxy[1762]: lookup_datastore failed - datastore 'XFS-USB-SSD' is not mounted
 
Hello _gabriel,
as you can see in my first example with the ZFS I disabled PVE PBS Storage at first.
In the second try with XFS PVE was not involved. The message comes from PBS and not PVE.

As far as I can see the logging that occurs with removable datastores as well is a known "bug":

 
indeed, I was reading too fast.
Reproducible here.
For use case, where PBS Datastore is only USB, I only start PB-Proxy service during backup/sync/GC/verif then stop PB-Proxy service and unmount drive to allow hotplug.