pendrive용 udev를 사용하여 "제조업체" 및 "제품" 속성을 알아보세요.

pendrive용 udev를 사용하여 "제조업체" 및 "제품" 속성을 알아보세요.

나는 보았다원본 이미지를 USB 플래시 드라이브에 안전하게 쓰기

하지만 데비안에서는 다음 명령으로 nada를 얻으세요:-

[$] udevadm info -a -p $(udevadm info -q path -n /dev/sdb)|grep -iE "manufacturer|product"  
[$]

새로운 질문으로 이런 질문을 해주셔서 그렇게 했습니다.

모니터 명령을 사용하면 udevadm에서 일부 출력을 얻습니다.

[$] udevadm monitor                                                                                                                
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[3684.776590] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/bsg/4:0:0:0 (bsg)
KERNEL[3684.777597] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/scsi_generic/sg2 (scsi_generic)
KERNEL[3684.777635] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/scsi_device/4:0:0:0 (scsi_device)
KERNEL[3684.777658] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/scsi_disk/4:0:0:0 (scsi_disk)
KERNEL[3684.777838] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb2 (block)
KERNEL[3684.782360] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
KERNEL[3684.782727] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/block/sdb (block)
KERNEL[3684.782760] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0 (scsi)
KERNEL[3684.782988] remove   /devices/virtual/bdi/8:16 (bdi)
KERNEL[3684.783019] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0 (scsi)
UDEV  [3684.783049] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/bsg/4:0:0:0 (bsg)
UDEV  [3684.784068] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/scsi_disk/4:0:0:0 (scsi_disk)
UDEV  [3684.785019] remove   /devices/virtual/bdi/8:16 (bdi)
UDEV  [3684.787027] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/scsi_generic/sg2 (scsi_generic)
UDEV  [3684.791681] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
UDEV  [3684.791719] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/scsi_device/4:0:0:0 (scsi_device)
UDEV  [3684.792728] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb2 (block)
UDEV  [3684.795562] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0/block/sdb (block)
UDEV  [3684.798166] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0/4:0:0:0 (scsi)
UDEV  [3684.800061] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/target4:0:0 (scsi)
KERNEL[3684.808192] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/scsi_host/host4 (scsi_host)
KERNEL[3684.808231] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4 (scsi)
KERNEL[3684.808519] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0 (usb)
KERNEL[3684.808707] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8 (usb)
UDEV  [3684.809582] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4/scsi_host/host4 (scsi_host)
UDEV  [3684.810490] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host4 (scsi)
UDEV  [3684.811610] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0 (usb)
UDEV  [3684.813368] remove   /devices/pci0000:00/0000:00:1d.7/usb5/5-8 (usb)
KERNEL[3690.682615] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8 (usb)
KERNEL[3690.683475] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0 (usb)
KERNEL[3690.683743] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5 (scsi)
KERNEL[3690.683944] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/scsi_host/host5 (scsi_host)
UDEV  [3690.692470] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8 (usb)
UDEV  [3690.699536] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0 (usb)
UDEV  [3690.701644] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5 (scsi)
UDEV  [3690.708123] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/scsi_host/host5 (scsi_host)
KERNEL[3691.694749] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0 (scsi)
KERNEL[3691.694829] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0 (scsi)
KERNEL[3691.694902] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/scsi_disk/5:0:0:0 (scsi_disk)
KERNEL[3691.694961] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/scsi_device/5:0:0:0 (scsi_device)
KERNEL[3691.695201] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/scsi_generic/sg2 (scsi_generic)
KERNEL[3691.695321] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/bsg/5:0:0:0 (bsg)
UDEV  [3691.697351] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0 (scsi)
KERNEL[3691.697770] add      /devices/virtual/bdi/8:16 (bdi)
UDEV  [3691.702172] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0 (scsi)
UDEV  [3691.705059] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/scsi_disk/5:0:0:0 (scsi_disk)
KERNEL[3691.705443] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/block/sdb (block)
KERNEL[3691.705469] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/block/sdb/sdb1 (block)
KERNEL[3691.705485] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/block/sdb/sdb2 (block)
UDEV  [3691.710056] add      /devices/virtual/bdi/8:16 (bdi)
UDEV  [3691.712737] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/bsg/5:0:0:0 (bsg)
UDEV  [3691.713573] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/scsi_device/5:0:0:0 (scsi_device)
UDEV  [3691.714949] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/scsi_generic/sg2 (scsi_generic)
UDEV  [3692.356460] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/block/sdb (block)
UDEV  [3692.392059] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/block/sdb/sdb2 (block)
UDEV  [3692.440775] add      /devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/block/sdb/sdb1 (block)

또한 lsblk는 sdb에 뭔가가 있음을 확인합니다. 다음을 참조하세요.

[$] lsblk                                                                                                                          
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0  48.8G  0 part 
├─sda2   8:2    0     1K  0 part 
├─sda5   8:5    0  48.8G  0 part 
├─sda6   8:6    0 186.3G  0 part /
├─sda7   8:7    0  93.1G  0 part /home
├─sda8   8:8    0 549.5G  0 part /data
└─sda9   8:9    0     5G  0 part [SWAP]
sdb      8:16   1   3.8G  0 disk 
├─sdb1   8:17   1   247M  0 part 
└─sdb2   8:18   1   416K  0 part 
sr0     11:0    1  1024M  0 rom

나는 또한 여기서 출력을 얻고 있습니다 :-

[$] ls -l /dev/sdb*                                                                                                                
brw-rw---- 1 root disk 8, 16 Jun 30 15:49 /dev/sdb
brw-rw---- 1 root disk 8, 17 Jun 30 15:49 /dev/sdb1
brw-rw---- 1 root disk 8, 18 Jun 30 15:49 /dev/sdb2

제조업체 및 제품 정보를 얻는 방법을 알아보세요. 아니면 다시 작성되었을 수도 있습니다.

명령의 일부는 몇 가지 작업을 수행합니다.

[$] udevadm info -a -p $(udevadm info -q path -n /dev/sdb)                                                                         

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0/block/sdb':
    KERNEL=="sdb"
    SUBSYSTEM=="block"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0/5:0:0:0':
    KERNELS=="5:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5/target5:0:0':
    KERNELS=="target5:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0/host5':
    KERNELS=="host5"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-8/5-8:1.0':
    KERNELS=="5-8:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb-storage"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-8':
    KERNELS=="5-8"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5':
    KERNELS=="usb5"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7':
    KERNELS=="0000:00:1d.7"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci-pci"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

그러나 후자 부분은 아무것도 제공하지 않습니다. 이 grep -iE "manufacturer|product"부분은 :(

lsusb에서 얻을 수 있습니다 :-

[$] lsusb                                                                                                                           
Bus 005 Device 007: ID 058f:6387 Alcor Micro Corp. Flash Drive
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 046d:c05a Logitech, Inc. M90/M100 Optical Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

lsscsi, 즉 제조업체/제품, 즉 Jetflash 및 모델을 통해 원하는 출력을 얻을 수 있었습니다. Alcor Micro Corporation에 대해 더 많이 아는 사람이 있습니까?

더 흥미롭게도 이 명령이 작동하지 않는 이유는 무엇입니까?

관련 정보