permanently disabling usb / mmc ports under linux

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












My BIOS does not have option to disable specific ports.



I want to disable permanently specific USB / MMC ports on my system ( x86_64, kernel 4.15+, debian-like). I started with USB ports.



  • Disabling : Port will be powered down just like unbind mechanism.

  • Permanent : Please someone help me to make this persistent via UDEV/KernelCMDLINE. I read almost all references on the net, but couldn't find an example to avoid kernel to create device nodes very early at initramfs !

I read: https://www.kernel.org/doc/html/v4.16/driver-api/usb/power-management.html
And with my current kernel ( 4.15+) except unbind mechanism, I couldn't find a way to poweroff specific port, while other ports still continue to have powered on.



And unfortunately, bind/unbind mechanism is not very friendly: Even without reboot, if you remove/re-insert the device, your settings for that port are get lost.



Is there a way to achive permanently disable specific port under linux ?










share|improve this question





















  • A possible duplicate
    – RubberStamp
    18 mins ago














up vote
0
down vote

favorite












My BIOS does not have option to disable specific ports.



I want to disable permanently specific USB / MMC ports on my system ( x86_64, kernel 4.15+, debian-like). I started with USB ports.



  • Disabling : Port will be powered down just like unbind mechanism.

  • Permanent : Please someone help me to make this persistent via UDEV/KernelCMDLINE. I read almost all references on the net, but couldn't find an example to avoid kernel to create device nodes very early at initramfs !

I read: https://www.kernel.org/doc/html/v4.16/driver-api/usb/power-management.html
And with my current kernel ( 4.15+) except unbind mechanism, I couldn't find a way to poweroff specific port, while other ports still continue to have powered on.



And unfortunately, bind/unbind mechanism is not very friendly: Even without reboot, if you remove/re-insert the device, your settings for that port are get lost.



Is there a way to achive permanently disable specific port under linux ?










share|improve this question





















  • A possible duplicate
    – RubberStamp
    18 mins ago












up vote
0
down vote

favorite









up vote
0
down vote

favorite











My BIOS does not have option to disable specific ports.



I want to disable permanently specific USB / MMC ports on my system ( x86_64, kernel 4.15+, debian-like). I started with USB ports.



  • Disabling : Port will be powered down just like unbind mechanism.

  • Permanent : Please someone help me to make this persistent via UDEV/KernelCMDLINE. I read almost all references on the net, but couldn't find an example to avoid kernel to create device nodes very early at initramfs !

I read: https://www.kernel.org/doc/html/v4.16/driver-api/usb/power-management.html
And with my current kernel ( 4.15+) except unbind mechanism, I couldn't find a way to poweroff specific port, while other ports still continue to have powered on.



And unfortunately, bind/unbind mechanism is not very friendly: Even without reboot, if you remove/re-insert the device, your settings for that port are get lost.



Is there a way to achive permanently disable specific port under linux ?










share|improve this question













My BIOS does not have option to disable specific ports.



I want to disable permanently specific USB / MMC ports on my system ( x86_64, kernel 4.15+, debian-like). I started with USB ports.



  • Disabling : Port will be powered down just like unbind mechanism.

  • Permanent : Please someone help me to make this persistent via UDEV/KernelCMDLINE. I read almost all references on the net, but couldn't find an example to avoid kernel to create device nodes very early at initramfs !

I read: https://www.kernel.org/doc/html/v4.16/driver-api/usb/power-management.html
And with my current kernel ( 4.15+) except unbind mechanism, I couldn't find a way to poweroff specific port, while other ports still continue to have powered on.



And unfortunately, bind/unbind mechanism is not very friendly: Even without reboot, if you remove/re-insert the device, your settings for that port are get lost.



Is there a way to achive permanently disable specific port under linux ?







linux usb power-management






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 24 mins ago









Sertac TULLUK

112




112











  • A possible duplicate
    – RubberStamp
    18 mins ago
















  • A possible duplicate
    – RubberStamp
    18 mins ago















A possible duplicate
– RubberStamp
18 mins ago




A possible duplicate
– RubberStamp
18 mins ago















active

oldest

votes











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: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
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%2f478737%2fpermanently-disabling-usb-mmc-ports-under-linux%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478737%2fpermanently-disabling-usb-mmc-ports-under-linux%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay