error:" ln: failed to create symbolic link ‘./sys/kernel/config/nvmt’: Operation not permitted" even with root access

Viewed 5573

I am trying to setup NVMe over Fabrics using post "https://community.mellanox.com/s/article/howto-configure-nvme-over-fabrics". I could reach step 10, but when I try to create the soft link according to step 10 as a root user, I am getting error:

ln: failed to create symbolic link ‘./sys/kernel/config/nvmt/subsystems’: Operation not permitted

why creating soft link in /sys/kernel/config as a root user is not possible? is there any way to get this to work?

3 Answers

Having the same issue, I found that in my case the problem was with the OFED driver.

When trying to run the ln -s command, I would see in dmesg the error:

nvmet: transport type 1 not supported

Following this answer, I reinstalled OFED with the option --with-nvmf, and that allowed setting NVMeoF properly.

Are you including the initial period ('./') in the path? That would say from the current location.

I had similar problem and the reason turned out to be that the directory to be linked must be created BEFORE creating the link. I checked the instructions you are referring to, it seems that they have been updated. The step you are referring to seems to be step 9 now:

ln -s /sys/kernel/config/nvmet/subsystems/nvme-subsystem-name /sys/kernel/config/nvmet/ports/1/subsystems/nvme-subsystem-name

This will only work if both /sys/kernel/config/nvmet/subsystems/nvme-subsystem-name and /sys/kernel/config/nvmet/ports/1/subsystems/nvme-subsystem-name already exist. Now, I don't see the latter folder being created anywhere, so I would try creating that folder:

mkdir -p /sys/kernel/config/nvmet/ports/1/subsystems/nvme-subsystem-name

The -p option enables mkdir to create all the missing directories in the given path if they are missing, so you can directly type mkdir -p a/b/c instead of first mkdir a, then mkdir a/b, then mkdir a/b/c.

Related