[SOLVED] How to remove Datastore (Directory)

Ok. Some things like renaming can often done without recreating everything, that's why I asked.

If you want to clear the disk completely (delete all data on it again), you can zap the disk:

Bash:
# WARNING: below is dangerous, wipes disk partitions, use with care!
sgdisk --zap-all /dev/sdX

Replace the /dev/ path with the respective device, triple check you got the right one and hit enter. After that, it should be useable again for creating a new storage+datastore with it.
How can i remove a unit from the GUI? because a erased after a tecnical problem with the hardware. But i dont find the GUI any option to remove it so it doesnt have more alerts from the old disk
 
How can i remove a unit from the GUI? because a erased after a tecnical problem with the hardware. But i dont find the GUI any option to remove it so it doesnt have more alerts from the old disk
Sorry i found it and use this command in the Console...
proxmox-backup-manager datastore remove (Name of the Unit)
 
Bonjour pour ma part j'ai effacer le contenu du fichier datastore.cfg et tout est redevenu normal dans l'interface graphique.
Hello, for my part I deleted the contents of the datastore.cfg file and everything is back to normal in the graphical interface.
 
Hello, for my part I deleted the contents of the datastore.cfg file and everything is back to normal in the graphical interface.
That deletes no data though. We recommend avoiding editing configuration files directly but use the web UI and/or API, which provides a vetted and synchronized safe way to either just delist a datastore, keeping the underlying data, or purge it completely including its data.
 
Ok thank you for your information but how do we through the graphical interface I did not find the information
 
Ok thank you for your information but how do we through the graphical interface I did not find the information
See the previously posted screenshot:
remove-datastore-png.42179


If that doesn't show up you have an outdated PBS version and should upgrade.
 
Let me sum up things (anyone can correct me if I'm wrong):
  • you can add a Directory from GUI using an unused disk, this will add a mount under /mnt/datastore and add a datastore too (you can optionally uncheck the flag to create a datastore
  • you can remove the datastore from the GUI
  • you CANNOT remove the mountpoint from the GUI, to do this I did through a Console with the "test" Directory/mountpoint
    systemctl stop /etc/systemd/system/mnt-datastore-test.mount rm /etc/systemd/system/mnt-datastore-test.mount now you can reuse or remove the device
 
  • Like
Reactions: i_am_jam
Sorry for necroposting, but I have the same issue. Trying to follow the instructions here doesn't work. I want to remove "PVE" from both GUI and CLI:


Bash:
root@proxmox-backup-server:/etc/systemd/system# ls -l
total 41
lrwxrwxrwx 1 root root 34 Nov 29  2022 chronyd.service -> /lib/systemd/system/chrony.service
drwxr-xr-x 2 root root  4 Jan  3  2023 getty.target.wants
lrwxrwxrwx 1 root root 38 Jan  3  2023 iscsi.service -> /lib/systemd/system/open-iscsi.service
drwxr-xr-x 2 root root 20 May  4 00:47 multi-user.target.wants
drwxr-xr-x 2 root root  3 Jan  3  2023 network-online.target.wants
lrwxrwxrwx 1 root root  9 Jan  4  2023 postfix.service -> /dev/null
drwxr-xr-x 2 root root  3 Jan  3  2023 remote-fs.target.wants
lrwxrwxrwx 1 root root 41 Jan  3  2023 smartd.service -> /lib/systemd/system/smartmontools.service
drwxr-xr-x 2 root root  5 Jul  4  2023 sockets.target.wants
lrwxrwxrwx 1 root root 31 Jan  3  2023 sshd.service -> /lib/systemd/system/ssh.service
drwxr-xr-x 2 root root 10 May  3 23:08 sysinit.target.wants
lrwxrwxrwx 1 root root 35 Jan  3  2023 syslog.service -> /lib/systemd/system/rsyslog.service
drwxr-xr-x 2 root root  4 May  3 23:08 systemd-resolved.service.wants
drwxr-xr-x 2 root root 10 Jul  4  2023 timers.target.wants
lrwxrwxrwx 1 root root 35 Jan  3  2023 zed.service -> /lib/systemd/system/zfs-zed.service
drwxr-xr-x 2 root root  4 Nov 29  2022 zfs-import.target.wants
drwxr-xr-x 2 root root  3 Nov 29  2022 zfs-volumes.target.wants
drwxr-xr-x 2 root root  7 Jan  3  2023 zfs.target.wants

Bash:
root@proxmox-backup-server:/backupstorage# ls -l
total 39
drwxr-xr-x 4 backup backup 5 May  4 01:31 HOSTS
drwxr-xr-x 4 backup backup 6 May  4 11:05 PBS
drwxr-xr-x 2 backup backup 2 May  4 11:26 PVE
drwxr-xr-x 6 backup backup 8 May  4 00:25 REMOTE


Bash:
root@proxmox-backup-server:/backupstorage# rm -R PVE/
rm: cannot remove 'PVE/': Device or resource busy


Bash:
root@proxmox-backup-server:/backupstorage# ls -la PVE/
total 1
drwxr-xr-x 2 backup backup 2 May  4 11:26 .
drwxr-xr-x 6 root   root   6 May  4 01:28 ..
 
Sorry for necroposting, but I have the same issue. Trying to follow the instructions here doesn't work. I want to remove "PVE" from both GUI and CLI:


Bash:
root@proxmox-backup-server:/etc/systemd/system# ls -l
total 41
lrwxrwxrwx 1 root root 34 Nov 29  2022 chronyd.service -> /lib/systemd/system/chrony.service
drwxr-xr-x 2 root root  4 Jan  3  2023 getty.target.wants
lrwxrwxrwx 1 root root 38 Jan  3  2023 iscsi.service -> /lib/systemd/system/open-iscsi.service
drwxr-xr-x 2 root root 20 May  4 00:47 multi-user.target.wants
drwxr-xr-x 2 root root  3 Jan  3  2023 network-online.target.wants
lrwxrwxrwx 1 root root  9 Jan  4  2023 postfix.service -> /dev/null
drwxr-xr-x 2 root root  3 Jan  3  2023 remote-fs.target.wants
lrwxrwxrwx 1 root root 41 Jan  3  2023 smartd.service -> /lib/systemd/system/smartmontools.service
drwxr-xr-x 2 root root  5 Jul  4  2023 sockets.target.wants
lrwxrwxrwx 1 root root 31 Jan  3  2023 sshd.service -> /lib/systemd/system/ssh.service
drwxr-xr-x 2 root root 10 May  3 23:08 sysinit.target.wants
lrwxrwxrwx 1 root root 35 Jan  3  2023 syslog.service -> /lib/systemd/system/rsyslog.service
drwxr-xr-x 2 root root  4 May  3 23:08 systemd-resolved.service.wants
drwxr-xr-x 2 root root 10 Jul  4  2023 timers.target.wants
lrwxrwxrwx 1 root root 35 Jan  3  2023 zed.service -> /lib/systemd/system/zfs-zed.service
drwxr-xr-x 2 root root  4 Nov 29  2022 zfs-import.target.wants
drwxr-xr-x 2 root root  3 Nov 29  2022 zfs-volumes.target.wants
drwxr-xr-x 2 root root  7 Jan  3  2023 zfs.target.wants

Bash:
root@proxmox-backup-server:/backupstorage# ls -l
total 39
drwxr-xr-x 4 backup backup 5 May  4 01:31 HOSTS
drwxr-xr-x 4 backup backup 6 May  4 11:05 PBS
drwxr-xr-x 2 backup backup 2 May  4 11:26 PVE
drwxr-xr-x 6 backup backup 8 May  4 00:25 REMOTE


Bash:
root@proxmox-backup-server:/backupstorage# rm -R PVE/
rm: cannot remove 'PVE/': Device or resource busy


Bash:
root@proxmox-backup-server:/backupstorage# ls -la PVE/
total 1
drwxr-xr-x 2 backup backup 2 May  4 11:26 .
drwxr-xr-x 6 root   root   6 May  4 01:28 ..
in the meanwhile someone more expert will answer, can you tell if PVE is a ZFS mountpoint?
 
My problem was fixed in a recent update to PBS. My PBS is 3.1-5, and I'm using the non-subscription repository.

Edit: I just did my monthly upgrade on PBS. It's now at 3.2-2.
 
Last edited:
I have found that to re-add a "deleted" datastore, I've had to manually add it to the datastore.cfg file. When adding a device that already has a datastore, the GUI will refuse to do it.

Below, I've added an external USB drive as storage PBS22:
Code:
datastore: PBS
    gc-schedule mon 00:15
    path /mnt/threeamigos/PBS
    verify-new true

datastore: archive
    path /mnt/threeamigos/archive
    verify-new true

datastore: PBS22
    path /mnt/22tb/PBS22

To put the updated .cfg into effect, simply save it. PBS will automatically see the change. It's very picky about syntax, and won't give any error messages if something is wrong.

Like someone above said, it's always better to use the GUI. But, in this case, the GUI falls short.
 
I just created the Storage from GUI in Proxmox Backup Server, I don't know if that automatically means it's a ZFS mountpoint?

All my systems are pure ZFS if that helps?
when you create a ZFS storage it:
  • creates data structures on disk
  • mounts ZFS via a mountpoint, which ZFS does automatically without fstab editing
  • add storage to Datastore unless you uncheck relative option
If you removed the datastore "only" maybe ZFS pool still exists and need to be destroyed from ZFS view - burger menu on the right

Anyway, can you post the output of zfs list command so we can make sure mountpoint still exists and is active? That's probably because deleting the directory gives you resource busy error
 

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!