Search code examples
bashmkdirprocfs

Cannot mkdir /proc/sys/somedir, though /proc/sys exists


Trying to create a dir. with the following commands (as root)

$mkdir -p /proc/sys/sunrpc

Note that /proc/sys already exists. Yet getting error

mkdir: cannot create directory ‘/proc/sys/sunrpc’: No such file or directory

Getting similar errors, even when trying

$cd /proc/sys
$mkdir sunrpc (or sunrpc/ or ./sunrpc or ./sunrpc/ or using sudo)

Ultimately, I am trying to follow instructions, here, for setting rpc request quotas for nfs clients (an a commercial hadoop system). The point at which being able to create a directory becomes an issue is where I need to run the commands:

echo 128 > /proc/sys/sunrpc/tcp_slot_table_entries 
echo 128 > /proc/sys/sunrpc/tcp_max_slot_table_entries

and the directory sunrpc does not yet exist in the parent file system /proc/sys.

Has anyone had this kind of problem before (could not find other posts where the parent directory are confirmed to exist)? What could be happening here? Thanks.


Solution

  • On Linux, entries in /proc other than those which relate directly to PIDs (which exist only if and when a process with the given ID exists) are created by kernel modules either on load or on hardware attach (more rarely -- most of these uses have moved to /sys).

    If you're trying to configure modules used in support of the Linux in-kernel NFS implementation, you'll want to ensure that that implementation's related kernel modules are loaded and working ahead-of-time. You can either identify their names and load them with modprobe -- or just start up the NFS server or client (as appropriate to the current machine); if the service is able to start, the modules it depends on will necessarily be loaded.