Hi,
I recently needed to mount all my shares using nfsv4 instead of the classic nfs protocol.
Fortunately this is a simple patch, so I would like to contribute it in the hope it will get incorporated some time.
This patch works ONLY if ALL your shares are nfs4: as there's no provision in the gui for nfs/nfs4 distinction, the patch will simply mount all shares as nfs4. Manually mounted nfs3 shares will still be recognized.
The patch is on proxmox 1.6 but should be straightly portable to recent versions.
Hope this is usefull.
jinjer
I recently needed to mount all my shares using nfsv4 instead of the classic nfs protocol.
Fortunately this is a simple patch, so I would like to contribute it in the hope it will get incorporated some time.
This patch works ONLY if ALL your shares are nfs4: as there's no provision in the gui for nfs/nfs4 distinction, the patch will simply mount all shares as nfs4. Manually mounted nfs3 shares will still be recognized.
Code:
pvet:/usr/share/perl5/PVE# diff -u Storage.pm.org Storage.pm
--- Storage.pm.nfs 2011-06-10 11:32:28.000000000 +0200
+++ Storage.pm.nfs4 2011-06-10 11:32:11.000000000 +0200
@@ -2068,8 +2068,8 @@
my $source = "$server:$export";
$mountdata = read_proc_mounts() if !$mountdata;
-
- if ($mountdata =~ m/^$source\s$mountpoint\snfs/m) {
+
+ if ($mountdata =~ m/^$source\/?\s$mountpoint\snfs4?/m) {
return $mountpoint;
}
@@ -2081,7 +2081,7 @@
my $source = "$server:$export";
- my $cmd = ['/bin/mount', '-t', 'nfs', $source, $mountpoint];
+ my $cmd = ['/bin/mount', '-t', 'nfs4', $source, $mountpoint];
if ($options) {
push @$cmd, '-o', $options;
}
The patch is on proxmox 1.6 but should be straightly portable to recent versions.
Hope this is usefull.
jinjer