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

3

6

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?

Paddock answered 25/2, 2020 at 19:54 Comment(1)
Note: For error ln: failed to create symbolic link and : Operation not permitted itself, you might need sudo chattr -i <file1> first before ln -sf <file2> <file1> if used chattr +i to locked that file before.Newsy
R
1

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.

Rewrite answered 23/1, 2022 at 15:54 Comment(0)
M
0

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

Malediction answered 25/2, 2020 at 19:57 Comment(1)
No, I just run: "ln -s /sys/kernel/config/nvmet/subsystems/mysubsystem /sys/kernel/config/nvmet/ports/1/subsystems"Paddock
G
0

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.

Glanti answered 14/8, 2020 at 12:36 Comment(1)
I have a similar problem when using unsquash: unix.stackexchange.com/questions/680219/…Aphonia

© 2022 - 2024 — McMap. All rights reserved.