Debian: cannot remove symlink in /sys/: operation not permitted












10














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?










share|improve this question




















  • 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 '18 at 17:13
















10














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?










share|improve this question




















  • 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 '18 at 17:13














10












10








10


3





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?










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 3 '18 at 8:50









Stephen Kitt

164k24365444




164k24365444










asked Dec 2 '18 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 '18 at 17:13














  • 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 '18 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 '18 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 '18 at 17:13










1 Answer
1






active

oldest

votes


















28














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.






share|improve this answer























  • 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 '18 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 '18 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 '18 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 '18 at 19:28












  • Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
    – Joshua
    Dec 3 '18 at 19:35











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',
autoActivateHeartbeat: false,
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
});


}
});














draft saved

draft discarded


















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









28














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.






share|improve this answer























  • 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 '18 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 '18 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 '18 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 '18 at 19:28












  • Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
    – Joshua
    Dec 3 '18 at 19:35
















28














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.






share|improve this answer























  • 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 '18 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 '18 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 '18 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 '18 at 19:28












  • Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
    – Joshua
    Dec 3 '18 at 19:35














28












28








28






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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 3 '18 at 9:46

























answered Dec 2 '18 at 17:12









Stephen Kitt

164k24365444




164k24365444












  • 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 '18 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 '18 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 '18 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 '18 at 19:28












  • Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
    – Joshua
    Dec 3 '18 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 '18 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 '18 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 '18 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 '18 at 19:28












  • Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
    – Joshua
    Dec 3 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 at 19:28














Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 '18 at 19:35




Modules can add arbitrary nodes to sysfs and procfs with their own vfs handlers.
– Joshua
Dec 3 '18 at 19:35


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

AnyDesk - Fatal Program Failure

How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

QoS: MAC-Priority for clients behind a repeater