Isn't there an option to mount an NFS share as read-only?

mcx808

New Member
Feb 7, 2024
4
1
3
I'm trying to mount a read-only NFS ISO store in PVE 8.1.4, however when trying to access this through the UI I get the error:
mkdir /mnt/pve/Images/template: Read-only file system at /usr/share/perl5/PVE/Storage/Plugin.pm line 1390. (500)

This is of course by design, I don't want PVE writing anything here, so how do I stop it?
I added options ro to my Images entry in /etc/pve/storage.cfg and I can actually ls /mnt/pve/Images and see the files, but it's not much use since the error appears whenever I try to attach an ISO to a VM.

Is there some way to achieve this?
 
Is there some way to achieve this?
Workaround:

1) give PVE write access
2) establish the storage. It will create some folders, that's why it needs write access...
3) disable the storage
4) switch to readonly
5) enable the storage

You should be able to access those .iso's now in this state.
 
It's read-only. So no write access at all, not even temporarily. Why does it need to create folders on a read-only volume and what are they for? Is it documented anywhere?
 
https://pve.proxmox.com/pve-docs/pve-admin-guide.html#storage_directory

See section 7.5:
We use a predefined directory layout to store different content types into different sub-directories. This layout is used by all file level storage backends.

There's a table that follows.

ETA: Maybe if you create the appropriate directory structure for the content type PVE won't try to write there.
 
The other option is to create a "Directory" type storage pool. PVE will create the structure as described in the documentation provided by @BobhWasatch . Then, you can RO NFS mount the ISO storage to the "path/template/iso" subfolder directly.

Keep in mind that PVE does not, currently, recursively search for ISOs.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:
  • Like
Reactions: mcx808
https://pve.proxmox.com/pve-docs/pve-admin-guide.html#storage_directory

See section 7.5:
We use a predefined directory layout to store different content types into different sub-directories. This layout is used by all file level storage backends.

There's a table that follows.

ETA: Maybe if you create the appropriate directory structure for the content type PVE won't try to write there.
This works for preventing the write error, but the root NFS share is already called Images and already contains the ISOs, so none are recognised presumable because they're not in the /images subdirectory.

This is an ISO store accessed by many other types of OS, it's an odd design choice to try and force proxmox' folder structure preference on it.
 
The other option is to create a "Directory" type storage pool. PVE will create the structure as described in the documentation provided by @BobhWasatch . Then, you can RO NFS mount the ISO storage to the "path/template/iso" subfolder directly.

Keep in mind that PVE does not, currently, recursively search for ISOs.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Thanks, after some experimentation I created the directory structure on my NFS store but symlinked templates/iso to .. on the actual NFS host. That way the NFS share can be defined in the Datacenter storage for all nodes but the ISOs in the root of my Images mount can be loaded by proxmox.
 
  • Like
Reactions: Kingneutron

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!