0

While following this answer: https://askubuntu.com/a/715310

I ran the command:

sudo ln -s /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/amdgpu_bl0/brightness /sys/class/backlight

and I got the error:

ln: failed to create symbolic link '/sys/class/backlight/brightness': Operation not permitted

Other commands like mkdir and touch return the same error: Operation not permitted

I have tried running chown -R root /sys/class/backlight and running all the commands threw root but that didn't help either.

How come sudo cannot perform this operation and how can I fix it?

can
  • 3
  • 1
  • That directory is not actually a directory you can create new links in - that directory isn't a 'normal' directory location. Why're you trying to create such a link? – Thomas Ward Jan 01 '19 at 21:30
  • I am just following the instructions in: https://askubuntu.com/a/715310 – can Jan 01 '19 at 21:34

1 Answers1

1

Files inside of /sys and /proc are virtual file systems like procfs where the files aren't real.

The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory.

More info see proc on Wikipedia

Also see man procfs

  • So if you can't create links in /sys how come the answer https://askubuntu.com/a/715310/909484 got accepted? – can Jan 01 '19 at 21:39
  • I believe the reason is that you can write and modify some contents of the pseudo-file system, but you cannot create new files within it, since they have nowhere to go. In this case it seems like you are trying to create a new file instead of symlinking to an existing file. Eg. try symlinking the amdgpu_bl0 directory not the specific brightness "file" – Kristopher Ives Jan 02 '19 at 00:39