Dispositivo USB 'anexado' várias vezes

1

Eu tenho um problema quando estou conectando dispositivos USB ao meu servidor. Parece que os dispositivos USB foram conectados repetidamente ou reatribuíram as letras do dispositivo sdb1: sdb1

O problema é que eu executo uma regra do udev, toda vez que um dispositivo USB é conectado. A regra do udev agora é executada várias vezes, toda vez que as letras do dispositivo são exibidas. Eu desativei as regras personalizadas do udev para excluir isso como a origem do erro. Portanto, todo esse efeito e logs são criados sem qualquer regra personalizada do udev.

esse efeito permanece apenas até eu ter montado o dispositivo. Depois de montar o dispositivo, essas mensagens param.

Este é o log, quando eu sou conexão a RDX-Device via USB , mas o efeito é o mesmo com USB-Sticks

/ var / log / messages

2018-08-06T09:23:29.139628+02:00 SLES12RDX kernel: [241820.600269] sd 4:0:0:0: [sdb] 976764976 512-byte logical blocks: (500 GB/466 GiB)
2018-08-06T09:23:29.171622+02:00 SLES12RDX kernel: [241820.632581]  sdb: sdb1
2018-08-06T09:23:44.979634+02:00 SLES12RDX kernel: [241836.437561]  sdb: sdb1
2018-08-06T09:24:15.199624+02:00 SLES12RDX kernel: [241866.657525]  sdb: sdb1
2018-08-06T09:24:45.415636+02:00 SLES12RDX kernel: [241896.874298]  sdb: sdb1
2018-08-06T09:25:15.631630+02:00 SLES12RDX kernel: [241927.093221]  sdb: sdb1
2018-08-06T09:25:45.851637+02:00 SLES12RDX kernel: [241957.311295]  sdb: sdb1
2018-08-06T09:26:16.067646+02:00 SLES12RDX kernel: [241987.530071]  sdb: sdb1

dmesg

[241262.363311] usb 2-1.6: new high-speed USB device number 5 using ehci-pci
[241262.457475] usb 2-1.6: New USB device found, idVendor=1a5a, idProduct=0006
[241262.457487] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[241262.457488] usb 2-1.6: Product: RDX
[241262.457490] usb 2-1.6: Manufacturer: TANDBERG
[241262.457491] usb 2-1.6: SerialNumber: 032613566487
[241262.457917] usb-storage 2-1.6:1.0: USB Mass Storage device detected
[241262.458197] scsi host4: usb-storage 2-1.6:1.0
[241263.456000] scsi 4:0:0:0: Direct-Access      RDX              0227 PQ: 0 ANSI: 6
[241263.456240] sd 4:0:0:0: Attached scsi generic sg2 type 0
[241263.459249] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[241288.618894] sd 4:0:0:0: [sdb] 976764976 512-byte logical blocks: (500 GB/466 GiB)
[241288.657955]  sdb: sdb1
[241294.065836]  sdb: sdb1
[241324.282380]  sdb: sdb1
[241766.323096] sd 4:0:0:0: [sdb] 976764976 512-byte logical blocks: (500 GB/466 GiB)
[241766.360054]  sdb: sdb1
[241776.112351]  sdb: sdb1
[241820.600269] sd 4:0:0:0: [sdb] 976764976 512-byte logical blocks: (500 GB/466 GiB)
[241820.632581]  sdb: sdb1
[241836.437561]  sdb: sdb1
[241866.657525]  sdb: sdb1
[241896.874298]  sdb: sdb1
[241927.093221]  sdb: sdb1
[241957.311295]  sdb: sdb1
[241987.530071]  sdb: sdb1
    
por Danloc 06.08.2018 / 10:06

2 respostas

1

Resposta parcial:

Eu ainda não sei o que causa isso, mas posso apontar o (s) lugar (es) no log de depuração do udevd onde isso acontece.

Ou seja, você recebe eventos "inotify close" para /dev/sda e /dev/sdb :

2018-08-06T16:20:28.414845+02:00 SLES12RDX systemd-udevd[429]: inotify event: 8 for /dev/sda
2018-08-06T16:20:28.416130+02:00 SLES12RDX systemd-udevd[429]: device /dev/sda closed, synthesising 'change'


2018-08-06T16:20:28.556561+02:00 SLES12RDX systemd-udevd[429]: inotify event: 8 for /dev/sdb
...
2018-08-06T16:20:28.566988+02:00 SLES12RDX systemd-udevd[429]: seq 2123 queued, 'remove' 'block'


2018-08-06T16:20:58.630120+02:00 SLES12RDX systemd-udevd[429]: inotify event: 8 for /dev/sda
...
2018-08-06T16:20:58.631408+02:00 SLES12RDX systemd-udevd[429]: device /dev/sda closed, synthesising 'change'

etc., etc., e o udev sintetiza eventos "change", que causam as várias análises do dispositivo de bloco inteiro e de todas as partições.

Eu nunca vi nada assim. inotify é para monitorar eventos do sistema de arquivos, então parece que eles vêm do espaço do usuário.

Eu não sei como rastrear qual aplicativo causa isso. Talvez arquivar um bug no site do udev bugtracking, e ver se eles têm alguma idéia de como rastreá-lo ainda mais?

    
por 06.08.2018 / 17:07
0

Existem muitos eventos do udev recebidos após o plug-in do dispositivo usb. Após um ciclo de 15 a 20 segundos, os eventos parecem que o dispositivo foi conectado novamente. Saída de udevadm monitor

KERNEL[249779.569894] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda (block)
KERNEL[249779.569949] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1 (block)
KERNEL[249779.570075] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda2 (block)
KERNEL[249779.570123] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda5 (block)
KERNEL[249779.570245] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda6 (block)
KERNEL[249779.570296] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda7 (block)
UDEV  [249779.643535] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda (block)
UDEV  [249779.646294] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1 (block)
UDEV  [249779.647536] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda5 (block)
UDEV  [249779.647693] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda7 (block)
UDEV  [249779.649616] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda2 (block)
UDEV  [249779.651444] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda6 (block)
KERNEL[249781.213738] change   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb (block)
KERNEL[249781.233201] change   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb (block)
KERNEL[249781.233309] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
UDEV  [249781.495520] change   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb (block)
UDEV  [249781.604649] change   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb (block)
UDEV  [249781.712323] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
KERNEL[249809.678044] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda (block)
KERNEL[249809.678154] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1 (block)
KERNEL[249809.678211] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda2 (block)
KERNEL[249809.678292] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda5 (block)
KERNEL[249809.678410] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda6 (block)
KERNEL[249809.678455] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda7 (block)
UDEV  [249809.750877] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda (block)
UDEV  [249809.754139] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1 (block)
UDEV  [249809.754325] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda5 (block)
UDEV  [249809.756127] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda2 (block)
UDEV  [249809.756270] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda7 (block)
UDEV  [249809.756438] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda6 (block)
KERNEL[249809.788887] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
KERNEL[249809.793174] change   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb (block)
KERNEL[249809.793338] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
UDEV  [249809.795254] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
UDEV  [249810.274418] change   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb (block)
UDEV  [249810.391165] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)

Eu ativei a opção de depuração no udev conf. A saída do udev em / var / log / messages agora é enorme, para postar aqui ou depurar seriamente.

Mas esta regra do udev é "disparada" várias vezes:

/usr/lib/udev/rules.d/60-persistent-storage.rules

e este erro aparece para sda e sdb . sda is not a USB device , é meu HHD. Eu não sou um especialista em udev, então eu não sei, se isso é 'normal':

2018-08-06T12:14:51.303326+02:00 SLES12RDX systemd-udevd[2977]: PROGRAM '/sbin/multipath -u -i sda' /usr/lib/udev/rules.d/56-multipath.rules:25
2018-08-06T12:14:51.303516+02:00 SLES12RDX systemd-udevd[2978]: starting '/sbin/multipath -u -i sda'
2018-08-06T12:14:51.365860+02:00 SLES12RDX systemd-udevd[2977]: '/sbin/multipath -u -i sda'(out) 'sda is not a valid multipath device path'
2018-08-06T12:14:51.366082+02:00 SLES12RDX systemd-udevd[2977]: Process '/sbin/multipath -u -i sda' failed with exit code 1.

2018-08-06T12:14:51.441033+02:00 SLES12RDX systemd-udevd[2989]: PROGRAM '/sbin/multipath -u -i sdb' /usr/lib/udev/rules.d/56-multipath.rules:25
2018-08-06T12:14:51.441168+02:00 SLES12RDX systemd-udevd[2990]: starting '/sbin/multipath -u -i sdb'
2018-08-06T12:14:51.468823+02:00 SLES12RDX systemd-udevd[2989]: '/sbin/multipath -u -i sdb'(out) 'sdb is not a valid multipath device path'
2018-08-06T12:14:51.469024+02:00 SLES12RDX systemd-udevd[2989]: Process '/sbin/multipath -u -i sdb' failed with exit code 1.
    
por 06.08.2018 / 12:34