问题:
ubuntu18.04系统重启后识别不到移动硬盘,机器重启前可以正常挂在移动硬盘。
排错:
1. 重新安装exFAT格式支持包
sudo update
sudo apt install exfat-fuse exfat-utils
2. 重新拔插硬盘
2.1 查看系统日志
Jun 16 16:17:24 evas-System-Product-Name kernel: [257220.492652] usb 2-4: USB disconnect, device number 16
Jun 16 16:17:29 evas-System-Product-Name kernel: [257225.393795] usb 2-4: new SuperSpeed USB device number 17 using xhci_hcd
Jun 16 16:17:29 evas-System-Product-Name kernel: [257225.415112] usb 2-4: New USB device found, idVendor=0bc2, idProduct=aa15, bcdDevice= 7.12
Jun 16 16:17:29 evas-System-Product-Name kernel: [257225.415128] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun 16 16:17:29 evas-System-Product-Name kernel: [257225.415133] usb 2-4: Product: Basic
Jun 16 16:17:29 evas-System-Product-Name kernel: [257225.415137] usb 2-4: Manufacturer: Seagate
Jun 16 16:17:29 evas-System-Product-Name kernel: [257225.415140] usb 2-4: SerialNumber: NT22GPGS
Jun 16 16:17:29 evas-System-Product-Name mtp-probe: checking bus 2, device 17: "/sys/devices/pci0000:00/0000:00:14.0/usb2/2-4"
Jun 16 16:17:29 evas-System-Product-Name mtp-probe: bus: 2, device: 17 was not an MTP device
Jun 16 16:17:29 evas-System-Product-Name systemd-udevd[3069049]: ctx=0x55957cc55130 path=/lib/modules/5.15.0-46-generic/kernel/drivers/usb/storage/usb-storage.ko error=No such file or directory # systemd-udevd 服务在尝试加载 USB 存储驱动模块 usb-storage.ko 时失败,报文件找不到.
Jun 16 16:17:29 evas-System-Product-Name mtp-probe: checking bus 2, device 17: "/sys/devices/pci0000:00/0000:00:14.0/usb2/2-4"
Jun 16 16:17:29 evas-System-Product-Name mtp-probe: bus: 2, device: 17 was not an MTP device
查找原因:可能是在apt upgrade过程中强制中断导致内核模块部分缺失
ls /lib/modules/$(uname -r)/kernel/drivers/usb/storage/usb-storage.ko # 验证模块是否存在
sudo apt install --reinstall linux-modules-extra-$(uname -r) # 重新生成内核模块
sudo depmod -a
2.2 修复内核版本一致性
若内核版本不匹配,需重启至正确内核或更新系统:
sudo apt update && sudo apt upgrade
sudo reboot
2.3 手动安装驱动模块(紧急情况)
从官方仓库下载对应内核版本的 linux-modules 包并解压到 /lib/modules 7:
sudo apt download linux-modules-5.15.0-46-generic
dpkg -x linux-modules-*.deb /tmp/modules
sudo cp -r /tmp/modules/lib/modules/* /lib/modules/