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

mcx808

New Member
Feb 7, 2024
4
2
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:
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.
 
Hi.
I am new to Proxmox.
I wanted to do exactly this, mount a R/O file system, which is shared from somewhere outside Proxmox, and where I will find some ISOs for example.

Thank you for the explanation, that's clear.
However IMHU of an IT person with more that 35 years of practice, this seems... insane ? absurd ?
Not only Proxmox will demand a specific folder layout for the mounted share, but it will also lookup only at the 1st directory level ?
You will probably not believe me, but my ISOs are organized by type of products, sometimes major versions, etc...

Moreover when I edit a VM, I found that I can't even browse the file system to select the ISO I want to mount ?
I guess that this is done to "make things easier" to the VM admin.
:cry: :cry: :cry:
 
Yah, look into the script I posted above. In a pinch you can copy/scp a specific ISO into /var/lib/vz/template/iso and use it ad-hoc, or designate another storage to be able to use "ISO Image" and put it there as an alternate source.

Datacenter / Storage / (click ID) / (Modify Content dropdown)

You just need to get used to the way Proxmox does things, or think outside the box and devise a workaround.
 
Yah, look into the script I posted above. In a pinch you can copy/scp a specific ISO into /var/lib/vz/template/iso and use it ad-hoc, or designate another storage to be able to use "ISO Image" and put it there as an alternate source.

Datacenter / Storage / (click ID) / (Modify Content dropdown)

You just need to get used to the way Proxmox does things, or think outside the box and devise a workaround.
What I did is create a Directory storage for ISO and then manually symlink a few isos of interest from the mounted share to this... I am not sure of why the share is mounted in the 1st place but that's my 1st VM on this and I simply wanted to get quicly a Linux ISO...

Edit: So now the 1st VM is installed, I added a r/o NFS mount in fstab and changed the symlinks to that mount in order to get something stable.
 
Last edited:
  • Like
Reactions: Kingneutron
I see this question has repeatedly come up in many other forums as well. I think many people use RO NFS ISO shares as a one-way-street to allow hosts and VMs to mount installation media files. I have a pile of ISOs over 15 years old and this same NFS mount is being presented to hosts running XenCenter, VMware, plain linux, etc. with zero problems. RO, so I know I can't accidentally delete or overwrite my archives. It's a really simple, basic usecase and I'm very surprised that proxmox can't (or won't) do it. It's like just mounting a CD... it's always gonna be read-only. Is there a way to make a feature request for this in proxmox? For now I guess I'll use the symlink hacks mentioned but boy... this is a waste of time for the admin.