Removable datastore on zpool containing other datasets

daanw

Active Member
May 5, 2025
156
82
28
.nl
Is it possible to use a ZFS dataset on an external harddisk as removable PBS datastore?
The disk contains a zpool that holds a PBS datastore, say zpool/pbs-ds. The zpool also holds other zfs datasets, say zpool/data1, zpool/data2, etc.

Adding the datastore to PBS as a local datastore with the 'use existing datastore' option is working fine.
This however requires fully readding and removing the entire datastore and sync task(s) everytime the disk is connected.

The mountpoint of the zfs dataset can obviously be set to /mnt/datastores/pbs-ds, like PBS expects for removable datastores.
The GUI (PBS 4.2.2) currently cannot create a removable datastore because it wants a Device/UUID, which in this case should be the zfs dataset, not an entire disk.

Is this something that can be done using the datastore.cfg configuration file instead of the GUI maybe?
 
Last edited:
Adding the datastore to PBS as a local datastore with the 'use existing datastore' option is working fine.
This however requires fully readding and removing the entire datastore and sync task(s) everytime the disk is connected.

Meanwhile, a simple script to automate this procedure:

#create Datastore in PBS reusing existing datastore
proxmox-backup-manager datastore create <external_datastore_name> <external_datastore_path> --reuse-datastore true --overwrite-in-use true

#set permissions (might be different for your specific setup)
proxmox-backup-manager acl update /datastore/<external_datastore_name> DatastoreBackup --auth-id backup@pbs

#create sync job
proxmox-backup-manager sync-job create external --owner backup@pbs --remote-store <local_datastore_name> --store <external_datastore_name> --remove-vanished true

#run sync job
proxmox-backup-manager sync-job run external

#remove datastore
proxmox-backup-manager datastore remove <external_datastore_name>
 
Last edited:
Shouldn't these commands also contain --backing-device to mark the datastore as removable?
 
Unfortunately, this is still a non-removable datastore. These commands temporarily add an existing datastore on an external drive to PBS, syncs the main datastore to it and then removes the datastore again from PBS so you can then umount it.

The main question whether it is possible to use a zfs dataset as a removable datastore still remains.
 
  • Like
Reactions: Johannes S