Bug 815738

Summary: mkinitrd fails to create working system for nfs boot
Product: [openSUSE] openSUSE 12.3 Reporter: Forgotten User irjyoQXji2 <forgotten_irjyoQXji2>
Component: InstallationAssignee: Neil Brown <nfbrown>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: fabian, forgotten_ghcFYO_ifG, nfbrown, ohering
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 12.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User irjyoQXji2 2013-04-17 16:43:47 UTC
Issuing the command:
mkinitrd -k vnlinuz-3.7.10-1.1-desktop -i initrdnfs -d /dev/nfs -f nfs -D eth0 -B

results in a initrdnfs which fails on boot at the stage of mounting the root file system, with error report "mount.nfs: Protocol not supported".

I believe it is because nfs_v3 and nfs_v4 have been made separate kernal modules. Applying some wild guess work, I was able to fix the problem by adding " nfsv3" to the end of the line "#%modules: nfs" in file /lib/mkinitrd/scripts/boot-nfs.sh
Comment 1 Olaf Hering 2013-08-02 14:32:16 UTC
Neil,

is it safe to include nfsv2,nfsv3,nfsv4 into initrd and load them all in advance in initrd?

I have not tested a nfsv4 share, what it takes to drive such a share.
Does nfsv4 have extra dependencies?
I see nfs-layouttype4-1.ko, is that module required as well?
Can the setup scripts easily detect an nfsv4 share and create the required setup in initrd?

Can the server easily change its version across client reboots (v3 becomes v4) and could the unmodified client cope with such a change?
Comment 2 Neil Brown 2013-08-05 07:09:29 UTC
Yes, it is safe to include those 3 nfs modules.
nfsv4 has fewer dependencies than v3 (e.g. locking is not an issue).

nfs-layouttype4-1.ko is for 'pNFS'.  You don't need that in the initrd.

The NFS server will normally support all versions.  However if it does stop supporting one, the client should cope.

There should be no difference in the initrd. Simply try to mount the appropriate directory from the appropriate server.  mount.nfs will try various protocols until it works.
Comment 3 Olaf Hering 2013-08-05 13:38:13 UTC
I will submit this change to nfs-utils, its also required for 12.3
mount.nfs4 is probably needed, I did not test this part.

Paul, please re-test this change for /lib/mkinitrd/scripts/boot-nfs.sh

Index: mkinitrd-boot.sh
===================================================================
--- mkinitrd-boot.sh    (revision bbc170fc5de5dd1d808d5e9b785c0a54)
+++ mkinitrd-boot.sh    (working copy)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #%stage: block
-#%modules: nfs
-#%programs: /sbin/mount.nfs
+#%modules: nfsv2 nfsv3 nfsv4
+#%programs: mount.nfs mount.nfs4
 #%if: "$rootfstype" = "nfs" -o "$need_nfs"
 #
 ##### Network FileSystem
Comment 4 Bernhard Wiedemann 2013-08-05 18:00:29 UTC
This is an autogenerated message for OBS integration:
This bug (815738) was mentioned in
https://build.opensuse.org/request/show/185979 Factory / nfs-utils
Comment 5 Olaf Hering 2013-08-08 08:34:36 UTC
*** Bug 823671 has been marked as a duplicate of this bug. ***
Comment 6 Forgotten User irjyoQXji2 2013-08-11 15:08:05 UTC
(In reply to comment #3)
> I will submit this change to nfs-utils, its also required for 12.3
> mount.nfs4 is probably needed, I did not test this part.
> 
> Paul, please re-test this change for /lib/mkinitrd/scripts/boot-nfs.sh
> 
> Index: mkinitrd-boot.sh
> ===================================================================
> --- mkinitrd-boot.sh    (revision bbc170fc5de5dd1d808d5e9b785c0a54)
> +++ mkinitrd-boot.sh    (working copy)
> @@ -1,7 +1,7 @@
>  #!/bin/bash
>  #%stage: block
> -#%modules: nfs
> -#%programs: /sbin/mount.nfs
> +#%modules: nfsv2 nfsv3 nfsv4
> +#%programs: mount.nfs mount.nfs4
>  #%if: "$rootfstype" = "nfs" -o "$need_nfs"
>  #
>  ##### Network FileSystem

Yes Olaf, that works just fine, thank you.
Comment 7 Olaf Hering 2013-08-12 19:35:31 UTC
The patch above should go into 12.3
Comment 8 Bernhard Wiedemann 2013-08-14 02:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (815738) was mentioned in
https://build.opensuse.org/request/show/186986 Maintenance / 
https://build.opensuse.org/request/show/186987 Maintenance /
Comment 9 Swamp Workflow Management 2013-08-21 13:04:22 UTC
openSUSE-RU-2013:1365-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 815738
CVE References: 
Sources used:
openSUSE 12.3 (src):    nfs-utils-1.2.7-2.14.1
Comment 10 Forgotten User ghcFYO_ifG 2013-08-21 14:54:25 UTC
*** Bug 834458 has been marked as a duplicate of this bug. ***
Comment 11 Neil Brown 2013-09-02 02:56:14 UTC
This is in 11.3 and Factory, so resolving as Fixed.