Feature Request: Expose is_mountpoint and mkdir options in Proxmox GUI for Directory Storage

thiagomespb

New Member
Nov 20, 2024
21
2
3
Hello Proxmox team,


I’m currently using the Directory storage type for backups on an external USB drive and noticed a recurring issue that could be risky in production environments:
If the external disk is not mounted, Proxmox silently creates the folder structure on the local disk (within the intended mount point) and proceeds to write backups there as if the mount were valid.


I found this discussed in the following thread:
https://forum.proxmox.com/threads/directory-storage-type-issues.50457/


The issue can be prevented by manually adding these options to the storage.cfg:


Code:
is_mountpoint 1
mkdir 0



These options work perfectly to:


  • Ensure Proxmox considers the storage offline if the mount is not present.
  • Prevent Proxmox from auto-creating directory structures on local storage and writing backups in the wrong place.



Suggestion:​


Please consider exposing these two options in the Proxmox GUI under the “Advanced” section when editing or adding Directory storage:


  • A checkbox for is_mountpoint
  • A checkbox for mkdir (create directory if missing)

Currently, is_mountpoint may be visible in certain configurations, but not consistently. And mkdir is completely missing from the GUI, requiring manual configuration — which introduces risk in multi-admin or automated environments.


Adding both options to the GUI would be a simple but highly impactful improvement, especially for users relying on fstab, USB drives, NFS mounts, or network-based storage that might not be immediately available during boot.


Thanks for your attention and for the great work on Proxmox!
 
It's probably even easier by using a backup hook script that checks, if this mountpoint is the one you expect.

Two examples:
  1. You could mark the disk with a touch /mnt/backuphdd/backup-disk-marker and only if that file exists, do your backups or try to mount the disk first and check again.
  2. Check in your script if the backup directory /mnt/backuphdd/dump exists and if it's a directory. Only in that case continue your backups.
There are several other things that a backup hook script does for you, just have a look at https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_hook_scripts
 
You're absolutely right — using a backup hook script with mountpoint validation (like checking for a marker file or ensuring the backup path exists) is a clean and reliable solution. I've used similar checks in shell scripts before backup jobs.


However, I believe it would be even more user-friendly and safer if Proxmox’s GUI offered built-in support for this kind of logic — either by exposing options like is_mountpoint and mkdir, or by allowing users to configure and manage hook scripts directly from the GUI (for example, selecting or uploading a script file per job).


Not all users are comfortable editing shell scripts or manually configuring storage.cfg, and GUI-based controls would reduce the risk of misconfiguration while making the platform even more robust for less experienced admins.


Thanks again for the input and for the documentation link!
 
Another (maybe simpler) solution for this problem or any mount & write problem in Linux, is to apply the immutable flag to the unmounted mountpoint. With this, root is not able to write and create the directory and the backup will fail, yet mounting and then writing is still possible:

Code:
chattr +i <mountpoint>