Ubuntu 卸载 PCI/PCIe 设备

首先,通过 lspci 命令确定设备的 Domain、Bus、Device、Function 信息:

bryan@bryan-pc:~$ sudo lspci -D
0000:00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
0000:00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 08)
0000:00:02.0 VGA compatible controller: Intel Corporation 8th Gen Core Processor Gaussian Mixture Model
0000:00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
0000:00:14.2 Signal processing controller: Intel Corporation 200 Series PCH Thermal Subsystem
0000:00:15.0 Signal processing controller: Intel Corporation 200 Series PCH Serial IO I2C Controller #0
0000:00:15.1 Signal processing controller: Intel Corporation 200 Series PCH Serial IO I2C Controller #1
0000:00:16.0 Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
0000:00:17.0 SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCI mode]
0000:00:1c.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #7 (rev f0)
0000:00:1d.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #9 (rev f0)
0000:00:1e.0 Signal processing controller: Intel Corporation 200 Series/Z370 Chipset Family Serial IO UART Controller #0
0000:00:1f.0 ISA bridge: Intel Corporation Device a2cc
0000:00:1f.2 Memory controller: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller
0000:00:1f.3 Audio device: Intel Corporation 200 Series PCH HD Audio
0000:00:1f.4 SMBus: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller
0000:01:00.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
0000:01:00.1 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
0000:01:00.2 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
0000:01:00.3 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
0000:01:00.4 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
0000:02:08.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
0000:02:09.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
0000:02:10.0 PCI bridge: PLX Technology, Inc. Device 8749 (rev ca)
0000:03:00.0 Memory controller: Xilinx Corporation Device 8038 (rev ff)
0000:06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
0000:07:00.0 Network controller: Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth (rev 99)
bryan@bryan-pc:~$

假设我们要卸载设备 0000:03:00.0,可以执行命令:

bryan@bryan-pc:~$ echo 1 > /sys/bus/pci/devices/0000\:03\:00.0/remove

如果需要重新对 PCI/PCIe 总线进行枚举,可执行命令:

bryan@bryan-pc:~$ echo 1 > /sys/bus/pci/rescan
  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值