5

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?

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Marjan Radi
  • 51
  • 1
  • 2
  • Note: For error `ln: failed to create symbolic link` and `: Operation not permitted ` itself, you might need `sudo chattr -i ` first before `ln -sf ` if used `chattr +i` to locked that file before. – 林果皞 Jan 30 '21 at 03:48

3 Answers3

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.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
0

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

Baledin
  • 43
  • 4
  • No, I just run: "ln -s /sys/kernel/config/nvmet/subsystems/mysubsystem /sys/kernel/config/nvmet/ports/1/subsystems" – Marjan Radi Feb 25 '20 at 20:37
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.

João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109
Juha Lipponen
  • 188
  • 1
  • 8
  • I have a similar problem when using `unsquash`: https://unix.stackexchange.com/questions/680219/why-is-unsquash-not-permitted-to-create-symlink-and-certain-files – bomben Dec 05 '21 at 16:37