FATAL: Could not open ‘kernel/fs/nfs/nfs.ko’: No such file or directory

 

Ou comment monter un partage NFS sur une "vieille" Debian Etch avec un noyau récent.

J'ai donc une machine virtuelle Xen 4 avec un kernel récent 2.6.32-5, mais j'ai besoins d'une Debian Etch, le problème c'est que la version de modprobe est incompatible avec cette génération de noyau.

Il faut bien sûr installer nfs-common sur la machine cliente nfs.

Si on essaie de charger le module nfs voici les erreurs :

# modprobe nfs
WARNING: Could not open 'kernel/net/sunrpc/sunrpc.ko': No such file or directory
WARNING: Could not open 'kernel/net/sunrpc/auth_gss/auth_rpcgss.ko': No such file or directory
WARNING: Could not open 'kernel/fs/nfs_common/nfs_acl.ko': No such file or directory
WARNING: Could not open 'kernel/fs/fscache/fscache.ko': No such file or directory
WARNING: Could not open 'kernel/fs/lockd/lockd.ko': No such file or directory
FATAL: Could not open 'kernel/fs/nfs/nfs.ko': No such file or directory

Par contre si on charge un par un chaque module à la main avec insmod pas de problèmes.

Une solution (peut-être pas la meilleure mais elle fonctionne) est de ce faire un petit script qu'on rajoutera dans les init :

#!/bin/bash
# Script for load nfs modules on Debian Etch
# with 2.6.32-5-xen-amd64 kernel
# because of modprobe uncompatible version
# with this kernel.
# Errors when you try to load nfs module
# # modprobe nfs
# WARNING: Could not open 'kernel/net/sunrpc/sunrpc.ko': No such file or directory
# WARNING: Could not open 'kernel/net/sunrpc/auth_gss/auth_rpcgss.ko': No such file or directory
# WARNING: Could not open 'kernel/fs/nfs_common/nfs_acl.ko': No such file or directory
# WARNING: Could not open 'kernel/fs/fscache/fscache.ko': No such file or directory
# WARNING: Could not open 'kernel/fs/lockd/lockd.ko': No such file or directory
# FATAL: Could not open 'kernel/fs/nfs/nfs.ko': No such file or directory
#
# Don't forget
# update-rc.d mount_nfs defaults
#
# Guillaume Chéramy
# http://blog.cheramy.name
# 08 October 2010

case "$1" in
start)
   # load modules
   /sbin/insmod /lib/modules/2.6.32-5-xen-amd64/kernel/net/sunrpc/sunrpc.ko
   /sbin/insmod /lib/modules/2.6.32-5-xen-amd64/kernel/net/sunrpc/auth_gss/auth_rpcgss.ko
   /sbin/insmod /lib/modules/2.6.32-5-xen-amd64/kernel/fs/nfs_common/nfs_acl.ko
   /sbin/insmod /lib/modules/2.6.32-5-xen-amd64/kernel/fs/fscache/fscache.ko
   /sbin/insmod /lib/modules/2.6.32-5-xen-amd64/kernel/fs/lockd/lockd.ko
   /sbin/insmod /lib/modules/2.6.32-5-xen-amd64/kernel/fs/nfs/nfs.ko
   # mount nfs
   /bin/mount $IP_SRV:$PARTAGE -t nfs $PATH
   ;;

stop)
   # umount nfs
   umount $PATH
   # unload modules
   /sbin/rmmod nfs
   /sbin/rmmod lockd
   /sbin/rmmod fscache
   /sbin/rmmod nfs_acl
   /sbin/rmmod auth_rpcgss
   /sbin/rmmod sunrpc
   ;;
*)      log_action_msg "Usage: /etc/init.d/mount_nfs {start|stop}"
        exit 2
        ;;
esac
exit 0

Remplacez les variables par l'IP de votre serveur, le partage et le point de montage