Skip to contentSkip to conversation

deal with nfs in fstab-sys

PATCH In review Dave Young 2 participants 9 messages Jan 30, 2012 – Jan 31, 2012 6 messages not in the archive

lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 1/1 deal with nfs in fstab-sys

If we need to mount nonroot nfs in fstab we also need to launch rpc processes Add nfs-start-rpc code, also do not check and fsck $_dev in this case

---
 modules.d/95fstab-sys/mount-sys.sh |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
modules.d/95fstab-sys/mount-sys.sh +11 -6
Index: dracut/modules.d/95fstab-sys/mount-sys.sh
===================================================================
@@ -11,12 +11,17 @@ fstab_mount() {
     info "Mounting from $1"
     while read _dev _mp _fs _opts _dump _pass _rest; do
         [ -z "${_dev%%#*}" ] && continue # Skip comment lines
-        if [ ! -e "$_dev" ]; then
-            warn "Device $_dev doesn't exist, skipping mount."
-            continue
-        fi
-        if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
-            fsck_single "$_dev" "$_fs"
+        if [[ ! "$_fs" =~ "nfs" ]]; then
+            if [ ! -e "$_dev" ]; then
+                warn "Device $_dev doesn't exist, skipping mount."
+                continue
+            fi
+            if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
+                fsck_single "$_dev" "$_fs"
+            fi
+        else
+            . /sbin/nfs-start-rpc
+            nfsstart $_fs
         fi
         _fs=$(det_fs "$_dev" "$_fs")
         info "Mounting $_dev"
#1 lore raw
Quoted 2 lines · Dave Young

If we need to mount nonroot nfs in fstab we also need to launch rpc processes Add nfs-start-rpc code, also do not check and fsck $_dev in this case

Isn't it nfs module's responsibility to call nfs-start-rpc code? Why do you put it in fs-systab?

author
#2 lore raw
Quoted 6 lines · Cong Wang
Quoted 2 lines · Dave Young

If we need to mount nonroot nfs in fstab we also need to launch rpc processes Add nfs-start-rpc code, also do not check and fsck $_dev in this case

Isn't it nfs module's responsibility to call nfs-start-rpc code? Why do you put it in fs-systab?

nfs know nothing about fstab mount, it only deal with nfsroot thing. So I have to do this in fstab-sys

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Thanks
Dave
#4 lore raw
In reply to a message not in the archive
Quoted 6 lines · Dave Young
Quoted 4 lines · Cong Wang
Quoted 2 lines · Dave Young

If we need to mount nonroot nfs in fstab we also need to launch rpc processes Add nfs-start-rpc code, also do not check and fsck $_dev in this case

Quoted 6 lines
Quoted 2 lines

Isn't it nfs module's responsibility to call nfs-start-rpc code? Why do you put it in fs-systab?

nfs know nothing about fstab mount, it only deal with nfsroot thing. So I have to do this in fstab-sys

Sure, but nfs module knows it needs to start rpc before mounting NFS.

So, what's the problem if we call nfs-start-rpc script in pre-pivot hook of nfs module (before mount-sys.sh, of course)?

author
#6 lore raw
In reply to a message not in the archive
Quoted 12 lines · Cong Wang
Quoted 11 lines · Dave Young
Quoted 7 lines · Cong Wang
Quoted 3 lines · Dave Young

If we need to mount nonroot nfs in fstab we also need to launch rpc processes
Add nfs-start-rpc code, also do not check and fsck $_dev in this case

Isn't it nfs module's responsibility to call nfs-start-rpc code? Why do you put it in fs-systab?

Quoted 7 lines
Quoted 2 lines

nfs know nothing about fstab mount, it only deal with nfsroot thing. So I have to do this in fstab-sys

Sure, but nfs module knows it needs to start rpc before mounting NFS.

So, what's the problem if we call nfs-start-rpc script in pre-pivot hook of nfs module (before mount-sys.sh, of course)?

Actually nfs-start-rpc need to know the fs is nfs or nfs4, If add it as a hook, how does it accept the argument?

Quoted 4 lines
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Thanks
Dave
#8 lore raw
In reply to a message not in the archive
Quoted 17 lines · Dave Young
Quoted 15 lines · Cong Wang
Quoted 13 lines · Dave Young
Quoted 7 lines · Cong Wang
Quoted 3 lines · Dave Young

If we need to mount nonroot nfs in fstab we also need to launch rpc processes
Add nfs-start-rpc code, also do not check and fsck $_dev in this case

Isn't it nfs module's responsibility to call nfs-start-rpc code? Why do you put it in fs-systab?

nfs know nothing about fstab mount, it only deal with nfsroot thing. So I have to do this in fstab-sys

Quoted 8 lines
Quoted 4 lines

Sure, but nfs module knows it needs to start rpc before mounting NFS.

So, what's the problem if we call nfs-start-rpc script in pre-pivot hook of nfs module (before mount-sys.sh, of course)?

Actually nfs-start-rpc need to know the fs is nfs or nfs4, If add it as a hook, how does it accept the argument?

I think you can start rpc daemons unconditionally, no matter if it is nfs4 or nfs.

author
#10 lore raw
In reply to a message not in the archive
Quoted 25 lines · Cong Wang
Quoted 24 lines · Dave Young
Quoted 20 lines · Cong Wang
Quoted 8 lines · Dave Young
Quoted 6 lines · Cong Wang
Quoted 3 lines · Dave Young

If we need to mount nonroot nfs in fstab we also need to launch rpc processes
Add nfs-start-rpc code, also do not check and fsck $_dev in this case

Quoted 6 lines
Quoted 2 lines

Isn't it nfs module's responsibility to call nfs-start-rpc code? Why do you put it in fs-systab?

nfs know nothing about fstab mount, it only deal with nfsroot thing. So I have to do this in fstab-sys

Sure, but nfs module knows it needs to start rpc before mounting NFS.

So, what's the problem if we call nfs-start-rpc script in pre-pivot hook of nfs module (before mount-sys.sh, of course)?

Quoted 5 lines
Quoted 2 lines

Actually nfs-start-rpc need to know the fs is nfs or nfs4, If add it as a hook, how does it accept the argument?

I think you can start rpc daemons unconditionally, no matter if it is nfs4 or nfs.

This will means once nfs module is installed in initramfs, the rpc daemons will be started even if no nfs mount options in fstab or nfsroot

It looks not good to me :(

Signature · 2 lines
Thanks
Dave
#12 lore raw
In reply to a message not in the archive
Quoted 30 lines · Dave Young
Quoted 28 lines · Cong Wang
Quoted 26 lines · Dave Young
Quoted 13 lines · Cong Wang
Quoted 12 lines · Dave Young
Quoted 8 lines · Cong Wang
Quoted 3 lines · Dave Young

If we need to mount nonroot nfs in fstab we also need to launch rpc processes
Add nfs-start-rpc code, also do not check and fsck $_dev in this case

Isn't it nfs module's responsibility to call nfs-start-rpc code? Why do you put it in fs-systab?

Quoted 7 lines
Quoted 2 lines

nfs know nothing about fstab mount, it only deal with nfsroot thing. So I have to do this in fstab-sys

Sure, but nfs module knows it needs to start rpc before mounting NFS.

So, what's the problem if we call nfs-start-rpc script in pre-pivot hook of nfs module (before mount-sys.sh, of course)?

Actually nfs-start-rpc need to know the fs is nfs or nfs4, If add it as a hook, how does it accept the argument?

Quoted 6 lines
Quoted 2 lines

I think you can start rpc daemons unconditionally, no matter if it is nfs4 or nfs.

This will means once nfs module is installed in initramfs, the rpc daemons will be started even if no nfs mount options in fstab or nfsroot

Sure, but they will be killed soon, by nfsroot-cleanup.sh. :)

author
#14 lore raw
In reply to a message not in the archive
Quoted 34 lines · Cong Wang
Quoted 33 lines · Dave Young
Quoted 31 lines · Cong Wang
Quoted 29 lines · Dave Young
Quoted 18 lines · Cong Wang
Quoted 9 lines · Dave Young
Quoted 7 lines · Cong Wang
Quoted 4 lines · Dave Young

If we need to mount nonroot nfs in fstab we also need to launch rpc processes
Add nfs-start-rpc code, also do not check and fsck $_dev in this case

Quoted 7 lines
Quoted 2 lines

Isn't it nfs module's responsibility to call nfs-start-rpc code? Why do you put it in fs-systab?

nfs know nothing about fstab mount, it only deal with nfsroot thing. So
I have to do this in fstab-sys

Quoted 5 lines

Sure, but nfs module knows it needs to start rpc before mounting NFS.

So, what's the problem if we call nfs-start-rpc script in pre-pivot hook
of nfs module (before mount-sys.sh, of course)?

Actually nfs-start-rpc need to know the fs is nfs or nfs4, If add it as a hook, how does it accept the argument?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

I think you can start rpc daemons unconditionally, no matter if it is nfs4 or nfs.

This will means once nfs module is installed in initramfs, the rpc daemons will be started even if no nfs mount options in fstab or nfsroot

Sure, but they will be killed soon, by nfsroot-cleanup.sh. :)

Rethink about this, unconditionally start rpc daemons make more sense than do it in fstab-sys. Will change in v2

Signature · 2 lines
Thanks
Dave