1

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.

lampShadesDrifter
  • 3,925
  • 8
  • 40
  • 102
  • As an introduction to the topic: `man 5 proc` – Cyrus Dec 15 '17 at 20:04
  • 4
    You cannot create directories in `/proc`, which is a virtual filesystem that exposes btis of the kernel. If you tell us what you're *actually* trying to do we might be able to provide some suggestions. – larsks Dec 15 '17 at 20:09
  • @larsks Thanks, it would have taken a bit to figure out that the parent dir. was special. I have added my end goal of the problem to the post. – lampShadesDrifter Dec 15 '17 at 20:15
  • 1
    If those directories don't exist, then trying to create them and creating the files won't do you any good because there is nothing in the kernel that will do anything with them. Is the `sunrpc` module loaded on your system (look at the output of `lsmod`)? If you load it explicitly (`modprobe sunrpc`), do those entries appear? – larsks Dec 15 '17 at 20:21
  • Do you actually have NFS loaded and working, other than this adjustment? The `SUNRPC` kernel config flag is required for both `NFSD` and `NFS_FS`. If you're running NFS without it, then it's a non-kernel implementation in use. – Charles Duffy Dec 15 '17 at 20:23
  • 1
    @CharlesDuffy Not much experience with NFSs and did not mount the NFS on the clients before trying to echo into the files in the post. Creating the intended mount dir. in the clients and doing something like `clush -g nfsclients 'mount /mapr'` solved the problem (ie. the directories and files appeared). Thanks all. – lampShadesDrifter Dec 15 '17 at 20:37

2 Answers2

1

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.

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
1

The reason you can't mkdir a directory under /proc is because that is a virtual filesystem, one of several typically found under Linux (/sys is the other principle one).

Entries are populated by the kernel itself, frequently in response to loaded kernel modules. In your case, I suspect you want to have sunrpc kernel module, and possibly others, installed:

modprobe sunrpc

You can check for that with:

grep sunrpc /proc/modules

There's further documentation which may be relevant uncer Configure MapR for HP Vertica.

If that's not it, please restate your comment with the specific goal you're trying to accomplish.

The Mapr version 5 docs have a similar set of instructions to those you mention, and note specifically:

After the reboot of the node, if the /proc/sys/sunrpc directory is not available or if rpcidmapd is not running, start the rpcidmapd service using the following command: service rpcidmapd start.

Which I'd check if the kernel module itself doesn't address this.