Debian: cannot remove symlink in /sys/: operation not permitted
up vote
10
down vote
favorite
I ran some commands without completely understanding them while trying to get screen brightness working and now I'm stuck with a nasty symlink in '/sys/class/backlight/asus_laptop' that I am trying to get rid of.
I have tried
sudo rm /sys/class/backlight/asus_laptop
sudo rm '/sys/class/backlight/asus_laptop'
su root
rm /sys/class/backlight/asus_laptop
sudo rm /sys/class/backlight/asus_laptop
Going right into directory and typing rm asus_laptop
, changing ownership and using Thunar to try to remove it.
I get
rm: cannot remove '/sys/class/backlight/asus_laptop': Operation not permitted
Same goes for unlink, rmdir doesn't work, and Thunar fails.
The permissions on it are lrwxrwxrwx
How can I remove it?
linux permissions rm sysfs
add a comment |
up vote
10
down vote
favorite
I ran some commands without completely understanding them while trying to get screen brightness working and now I'm stuck with a nasty symlink in '/sys/class/backlight/asus_laptop' that I am trying to get rid of.
I have tried
sudo rm /sys/class/backlight/asus_laptop
sudo rm '/sys/class/backlight/asus_laptop'
su root
rm /sys/class/backlight/asus_laptop
sudo rm /sys/class/backlight/asus_laptop
Going right into directory and typing rm asus_laptop
, changing ownership and using Thunar to try to remove it.
I get
rm: cannot remove '/sys/class/backlight/asus_laptop': Operation not permitted
Same goes for unlink, rmdir doesn't work, and Thunar fails.
The permissions on it are lrwxrwxrwx
How can I remove it?
linux permissions rm sysfs
1
It is the permission on the directory, that matters when removing a file. However/sys
is special, I don't know if you can add or remove files.
– ctrl-alt-delor
Dec 2 at 17:13
add a comment |
up vote
10
down vote
favorite
up vote
10
down vote
favorite
I ran some commands without completely understanding them while trying to get screen brightness working and now I'm stuck with a nasty symlink in '/sys/class/backlight/asus_laptop' that I am trying to get rid of.
I have tried
sudo rm /sys/class/backlight/asus_laptop
sudo rm '/sys/class/backlight/asus_laptop'
su root
rm /sys/class/backlight/asus_laptop
sudo rm /sys/class/backlight/asus_laptop
Going right into directory and typing rm asus_laptop
, changing ownership and using Thunar to try to remove it.
I get
rm: cannot remove '/sys/class/backlight/asus_laptop': Operation not permitted
Same goes for unlink, rmdir doesn't work, and Thunar fails.
The permissions on it are lrwxrwxrwx
How can I remove it?
linux permissions rm sysfs
I ran some commands without completely understanding them while trying to get screen brightness working and now I'm stuck with a nasty symlink in '/sys/class/backlight/asus_laptop' that I am trying to get rid of.
I have tried
sudo rm /sys/class/backlight/asus_laptop
sudo rm '/sys/class/backlight/asus_laptop'
su root
rm /sys/class/backlight/asus_laptop
sudo rm /sys/class/backlight/asus_laptop
Going right into directory and typing rm asus_laptop
, changing ownership and using Thunar to try to remove it.
I get
rm: cannot remove '/sys/class/backlight/asus_laptop': Operation not permitted
Same goes for unlink, rmdir doesn't work, and Thunar fails.
The permissions on it are lrwxrwxrwx
How can I remove it?
linux permissions rm sysfs
linux permissions rm sysfs
edited Dec 3 at 8:50
Stephen Kitt
162k24358436
162k24358436
asked Dec 2 at 17:07
Jzuken
533
533
1
It is the permission on the directory, that matters when removing a file. However/sys
is special, I don't know if you can add or remove files.
– ctrl-alt-delor
Dec 2 at 17:13
add a comment |
1
It is the permission on the directory, that matters when removing a file. However/sys
is special, I don't know if you can add or remove files.
– ctrl-alt-delor
Dec 2 at 17:13
1
1
It is the permission on the directory, that matters when removing a file. However
/sys
is special, I don't know if you can add or remove files.– ctrl-alt-delor
Dec 2 at 17:13
It is the permission on the directory, that matters when removing a file. However
/sys
is special, I don't know if you can add or remove files.– ctrl-alt-delor
Dec 2 at 17:13
add a comment |
1 Answer
1
active
oldest
votes
up vote
28
down vote
accepted
The sysfs
file system, typically mounted on /sys
, just like the /proc
file system, isn’t a typical file system, it’s a so called pseudo file system. It’s actually populated by the kernel and you can’t delete files directly.
So, if the ASUS laptop support isn’t appropriate for you, then you have to ask the kernel to remove it. To do so, remove the corresponding module:
sudo rmmod asus-laptop
That will remove the relevant /sys
entry.
Small note: Some files can be removed, what triggers certain actions. I am not sure which ones are there in sysfs, but e.g. cgroupfs allows creating/removing cgroups with mkdir and rm.
– allo
Dec 3 at 9:36
3
@allo the distinction is subtle, but cgroupfs as its name suggests is a different file system. sysfs, which is mounted on/sys
, only supports reads and writes, it doesn’t support deletion.
– Stephen Kitt
Dec 3 at 9:44
1
@StephenKitt: If I as a kernel module writer wanted to add something to /sys I could very well provide my own directory node that has delete wired up. Create gives me the shivers though. mknod() is a special call after all.
– Joshua
Dec 3 at 18:30
@Joshua now you’ve got me intrigued — how would you go about that, without mounting a new kernfs (so nokernfs_create_root
) or any other fs?
– Stephen Kitt
Dec 3 at 19:28
Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 at 19:35
|
show 2 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485520%2fdebian-cannot-remove-symlink-in-sys-operation-not-permitted%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
28
down vote
accepted
The sysfs
file system, typically mounted on /sys
, just like the /proc
file system, isn’t a typical file system, it’s a so called pseudo file system. It’s actually populated by the kernel and you can’t delete files directly.
So, if the ASUS laptop support isn’t appropriate for you, then you have to ask the kernel to remove it. To do so, remove the corresponding module:
sudo rmmod asus-laptop
That will remove the relevant /sys
entry.
Small note: Some files can be removed, what triggers certain actions. I am not sure which ones are there in sysfs, but e.g. cgroupfs allows creating/removing cgroups with mkdir and rm.
– allo
Dec 3 at 9:36
3
@allo the distinction is subtle, but cgroupfs as its name suggests is a different file system. sysfs, which is mounted on/sys
, only supports reads and writes, it doesn’t support deletion.
– Stephen Kitt
Dec 3 at 9:44
1
@StephenKitt: If I as a kernel module writer wanted to add something to /sys I could very well provide my own directory node that has delete wired up. Create gives me the shivers though. mknod() is a special call after all.
– Joshua
Dec 3 at 18:30
@Joshua now you’ve got me intrigued — how would you go about that, without mounting a new kernfs (so nokernfs_create_root
) or any other fs?
– Stephen Kitt
Dec 3 at 19:28
Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 at 19:35
|
show 2 more comments
up vote
28
down vote
accepted
The sysfs
file system, typically mounted on /sys
, just like the /proc
file system, isn’t a typical file system, it’s a so called pseudo file system. It’s actually populated by the kernel and you can’t delete files directly.
So, if the ASUS laptop support isn’t appropriate for you, then you have to ask the kernel to remove it. To do so, remove the corresponding module:
sudo rmmod asus-laptop
That will remove the relevant /sys
entry.
Small note: Some files can be removed, what triggers certain actions. I am not sure which ones are there in sysfs, but e.g. cgroupfs allows creating/removing cgroups with mkdir and rm.
– allo
Dec 3 at 9:36
3
@allo the distinction is subtle, but cgroupfs as its name suggests is a different file system. sysfs, which is mounted on/sys
, only supports reads and writes, it doesn’t support deletion.
– Stephen Kitt
Dec 3 at 9:44
1
@StephenKitt: If I as a kernel module writer wanted to add something to /sys I could very well provide my own directory node that has delete wired up. Create gives me the shivers though. mknod() is a special call after all.
– Joshua
Dec 3 at 18:30
@Joshua now you’ve got me intrigued — how would you go about that, without mounting a new kernfs (so nokernfs_create_root
) or any other fs?
– Stephen Kitt
Dec 3 at 19:28
Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 at 19:35
|
show 2 more comments
up vote
28
down vote
accepted
up vote
28
down vote
accepted
The sysfs
file system, typically mounted on /sys
, just like the /proc
file system, isn’t a typical file system, it’s a so called pseudo file system. It’s actually populated by the kernel and you can’t delete files directly.
So, if the ASUS laptop support isn’t appropriate for you, then you have to ask the kernel to remove it. To do so, remove the corresponding module:
sudo rmmod asus-laptop
That will remove the relevant /sys
entry.
The sysfs
file system, typically mounted on /sys
, just like the /proc
file system, isn’t a typical file system, it’s a so called pseudo file system. It’s actually populated by the kernel and you can’t delete files directly.
So, if the ASUS laptop support isn’t appropriate for you, then you have to ask the kernel to remove it. To do so, remove the corresponding module:
sudo rmmod asus-laptop
That will remove the relevant /sys
entry.
edited Dec 3 at 9:46
answered Dec 2 at 17:12
Stephen Kitt
162k24358436
162k24358436
Small note: Some files can be removed, what triggers certain actions. I am not sure which ones are there in sysfs, but e.g. cgroupfs allows creating/removing cgroups with mkdir and rm.
– allo
Dec 3 at 9:36
3
@allo the distinction is subtle, but cgroupfs as its name suggests is a different file system. sysfs, which is mounted on/sys
, only supports reads and writes, it doesn’t support deletion.
– Stephen Kitt
Dec 3 at 9:44
1
@StephenKitt: If I as a kernel module writer wanted to add something to /sys I could very well provide my own directory node that has delete wired up. Create gives me the shivers though. mknod() is a special call after all.
– Joshua
Dec 3 at 18:30
@Joshua now you’ve got me intrigued — how would you go about that, without mounting a new kernfs (so nokernfs_create_root
) or any other fs?
– Stephen Kitt
Dec 3 at 19:28
Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 at 19:35
|
show 2 more comments
Small note: Some files can be removed, what triggers certain actions. I am not sure which ones are there in sysfs, but e.g. cgroupfs allows creating/removing cgroups with mkdir and rm.
– allo
Dec 3 at 9:36
3
@allo the distinction is subtle, but cgroupfs as its name suggests is a different file system. sysfs, which is mounted on/sys
, only supports reads and writes, it doesn’t support deletion.
– Stephen Kitt
Dec 3 at 9:44
1
@StephenKitt: If I as a kernel module writer wanted to add something to /sys I could very well provide my own directory node that has delete wired up. Create gives me the shivers though. mknod() is a special call after all.
– Joshua
Dec 3 at 18:30
@Joshua now you’ve got me intrigued — how would you go about that, without mounting a new kernfs (so nokernfs_create_root
) or any other fs?
– Stephen Kitt
Dec 3 at 19:28
Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 at 19:35
Small note: Some files can be removed, what triggers certain actions. I am not sure which ones are there in sysfs, but e.g. cgroupfs allows creating/removing cgroups with mkdir and rm.
– allo
Dec 3 at 9:36
Small note: Some files can be removed, what triggers certain actions. I am not sure which ones are there in sysfs, but e.g. cgroupfs allows creating/removing cgroups with mkdir and rm.
– allo
Dec 3 at 9:36
3
3
@allo the distinction is subtle, but cgroupfs as its name suggests is a different file system. sysfs, which is mounted on
/sys
, only supports reads and writes, it doesn’t support deletion.– Stephen Kitt
Dec 3 at 9:44
@allo the distinction is subtle, but cgroupfs as its name suggests is a different file system. sysfs, which is mounted on
/sys
, only supports reads and writes, it doesn’t support deletion.– Stephen Kitt
Dec 3 at 9:44
1
1
@StephenKitt: If I as a kernel module writer wanted to add something to /sys I could very well provide my own directory node that has delete wired up. Create gives me the shivers though. mknod() is a special call after all.
– Joshua
Dec 3 at 18:30
@StephenKitt: If I as a kernel module writer wanted to add something to /sys I could very well provide my own directory node that has delete wired up. Create gives me the shivers though. mknod() is a special call after all.
– Joshua
Dec 3 at 18:30
@Joshua now you’ve got me intrigued — how would you go about that, without mounting a new kernfs (so no
kernfs_create_root
) or any other fs?– Stephen Kitt
Dec 3 at 19:28
@Joshua now you’ve got me intrigued — how would you go about that, without mounting a new kernfs (so no
kernfs_create_root
) or any other fs?– Stephen Kitt
Dec 3 at 19:28
Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 at 19:35
Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 at 19:35
|
show 2 more comments
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485520%2fdebian-cannot-remove-symlink-in-sys-operation-not-permitted%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
It is the permission on the directory, that matters when removing a file. However
/sys
is special, I don't know if you can add or remove files.– ctrl-alt-delor
Dec 2 at 17:13