I don't have the pci directory, mine is in pci_bus, but regardless, I still get the "permission denied" error as root.
It seems it will not let me create or modify any file in this directory.
The "pci" entry that the script uses is inside "/sys/bus". You are looking inside "/sys/class" by mistake.
]]>echo 1 > /sys/class/pci_bus/0000\:07/rescan'
bash: /sys/class/pci_bus/0000:07/rescan: Permission denied
stat /sys/class/pci_bus/0000:07/rescan
stat: cannot stat '/sys/class/pci_bus/0000:07/rescan': No such file or directory
It seems it will not let me create or modify any file in this directory.
]]>#!/bin/bash
[[ $UID = 0 ]] || exec sudo "$0"
echo 1 > '/sys/bus/pci/devices/0000:00:1b.0/remove'
sleep 1
echo 1 > /sys/bus/pci/rescan
It first removes the device, and then it tells the kernel to look for devices again. This will make the kernel reinitialize the device.
Make sure you customize that "0000:00:1b.0" part if you want to try this script. I guess you will need "0000:07:01.0" according to that lspci output you shared. Run "lspci -D" to check on things.
]]>My motherboard's onboard audio went out and instead of upgrading the entire system I installed a cheap soundcard in a spare pci slot.
Card works just fine, except about 40% of the time after a reboot the card just fails to show up in any utility as an available output.
lspci | grep audio
07:01.0 Multimedia audio controller: Creative Labs CA0106/CA0111 [SB Live!/Audigy/X-Fi Series]
The card is always visible in the lspci output but it simply won't show up as an available soundcard in alsamixer nor shows up in pulseaudio volume control widget.
I have search and tried:
echo 1 > /sys/class/pci_bus/0000\:07/rescan
bash: /sys/class/pci_bus/0000:07/rescan: Permission denied
But I always get the permission denied error (yes I am root).
A reboot will ALWAYS fix the issue, but I'm so tired of doing a reboot, starting up all my programs only the find that my audio is out and having to reboot again to fix it.
Anyone have any ideas on a non-reboot fix or at least how to get linux to rescan the pci bus and try to reload it?
]]>