我正在尝试解决以下问题:在一台服务器上我的 USB 自动挂载,而在另一台服务器上则不然。比较两个实例的日志,我试图理解每一行的含义。
自动挂载 USB 消息日志:
May 9 18:10:40 kernel: usb 2-1.4: new high-speed USB device number 12 using ehci-pci
May 9 18:10:40 kernel: usb 2-1.4: New USB device found, idVendor=8564, idProduct=1000
May 9 18:10:40 kernel: usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 9 18:10:40 kernel: usb 2-1.4: Product: MYUSB
May 9 18:10:40 kernel: usb 2-1.4: Manufacturer: MYUSB
May 9 18:10:40 kernel: usb 2-1.4: SerialNumber: A1678
May 9 18:10:40 kernel: usb-storage 2-1.4:1.0: USB Mass Storage device detected
May 9 18:10:40 kernel: scsi host13: usb-storage 2-1.4:1.0
May 9 18:10:40 mtp-probe: checking bus 2, device 12: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4"
May 9 18:10:40 mtp-probe: bus: 2, device: 12 was not an MTP device
May 9 18:10:41 kernel: scsi 13:0:0:0: Direct-Access USB MYUSB 1100 PQ: 0 ANSI: 4
May 9 18:10:41 kernel: sd 13:0:0:0: Attached scsi generic sg2 type 0
May 9 18:10:41 kernel: sd 13:0:0:0: [sdb] 15724544 512-byte logical blocks: (8.05 GB/7.50 GiB)
May 9 18:10:41 kernel: sd 13:0:0:0: [sdb] Write Protect is off
May 9 18:10:41 kernel: sd 13:0:0:0: [sdb] No Caching mode page found
May 9 18:10:41 kernel: sd 13:0:0:0: [sdb] Assuming drive cache: write through
May 9 18:10:41 kernel: sdb: sdb1
May 9 18:10:41 kernel: sd 13:0:0:0: [sdb] Attached SCSI disk
May 9 18:10:41 kernel: FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
May 9 18:10:41 gvfs-udisks2-volume-monitor: disc.c:352: error opening file BDMV/index.bdmv
May 9 18:10:41 gvfs-udisks2-volume-monitor: disc.c:352: error opening file BDMV/BACKUP/index.bdmv
May 9 18:10:41 udisksd[838]: Mounted /dev/sdb1 at /run/media/user/MYUSB on behalf of uid 1000
不自动挂载 USB 消息日志:
May 9 18:09:07 kernel: usb 3-7: new high-speed USB device number 12 using xhci_hcd
May 9 18:09:07 kernel: usb 3-7: New USB device found, idVendor=8564, idProduct=1000
May 9 18:09:07 kernel: usb 3-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 9 18:09:07 kernel: usb 3-7: Product: MYUSB
May 9 18:09:07 kernel: usb 3-7: Manufacturer: MYUSB
May 9 18:09:07 kernel: usb 3-7: SerialNumber: A1678
May 9 18:09:07 kernel: usb-storage 3-7:1.0: USB Mass Storage device detected
May 9 18:09:07 kernel: scsi host4: usb-storage 3-7:1.0
May 9 18:09:07 mtp-probe: checking bus 3, device 12: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-7"
May 9 18:09:07 mtp-probe: bus: 3, device: 12 was not an MTP device
May 9 18:09:08 kernel: scsi 4:0:0:0: Direct-Access USB MYUSB 1100 PQ: 0 ANSI: 4
May 9 18:09:08 kernel: sd 4:0:0:0: Attached scsi generic sg2 type 0
May 9 18:09:08 kernel: sd 4:0:0:0: [sdb] 15724544 512-byte logical blocks: (8.05 GB/7.50 GiB)
May 9 18:09:08 kernel: sd 4:0:0:0: [sdb] Write Protect is off
May 9 18:09:08 kernel: sd 4:0:0:0: [sdb] No Caching mode page found
May 9 18:09:08 kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
May 9 18:09:08 kernel: sdb: sdb1
May 9 18:09:08 kernel: sd 4:0:0:0: [sdb] Attached SCSI disk
内核如何确定使用哪个 USB
usb 2-1.4
版本usb 3-7
?这是什么
sd 4:0:0:0:
意思?
另外,我正在尝试在工作盒上复制自动安装问题。我进行了快速比较,发现两个机器上的 linux utils 版本不同,非工作有较旧的版本(util-linux-ng-2.18),而工作有较新的版本(util-linux-2.28)。有谁知道这是否会影响 USB 自动挂载?
答案1
1) 这不是“USB 版本”,它是 USB 树中连接硬件的 USB 端口的位置。实际数量由硬件和内核初始化 USB 根集线器并分配总线编号的顺序决定。如果您好奇的话,可以使用lsusb -t
查看 USB 树。
2)4:0:0:0
表示它被分配了SCSI总线编号4,并且该总线上只有一个设备(它是虚拟总线,因为USB存储协议本质上是SCSI)。对于 也一样13:0:0:0
。sd
是 SCSI 磁盘内核子系统(或者可能是“存储磁盘”,不知道...),类似于st
(磁带)等。
3)这些都无助于解决您的自动安装问题。在两台主机上均检测到硬件和分区正常,并且一台主机配置为自动挂载它,而另一台主机则不然。
进行自动挂载的方法有多种,因此第一步是找出您在一台主机上安装的方式,然后在第二台主机上配置并安装它。