Udev - criar regra para HD

1. Udev - criar regra para HD

Jonatas Prust
JPrust

(usa Ubuntu)

Enviado em 29/04/2015 - 10:47h

Olá,
Estou configurando um servidor Zentyal 4.1, e preciso montar e fazer backup em um HD externo. Para isso criei uma regra em rules.d do udev para executar um script:
SUBSYSTEM=="block",ACTION=="add",ATTRS{serial}=="57583231414334395552565A", RUN+="/bin/bash /dados/dados/scripts/backup/hdExterno.sh" 

O script não é executado, já substitui o conteúdo por um simples mkdir e nada.
Manualmente o script é executado pelo comando que usei no udev.
Preciso de ajuda....
Seguem resultados do udevadm info:
 
looking at device '/devices/pci0000:00/0000:00:14.0/usb4/4-10/4-10:1.0/host10/target10:0:0/10:0:0:0/block/sde/sde1':
KERNEL=="sde1"
SUBSYSTEM=="block"
DRIVER==""
ATTR{ro}=="0"
ATTR{size}=="1953454080"
ATTR{stat}==" 486 0 3882 884 1081 13 241920 26760 0 5140 27640"
ATTR{partition}=="1"
ATTR{start}=="2048"
ATTR{discard_alignment}=="0"
ATTR{alignment_offset}=="0"
ATTR{inflight}==" 0 0"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb4/4-10/4-10:1.0/host10/target10:0:0/10:0:0:0/block/sde':
KERNELS=="sde"
SUBSYSTEMS=="block"
DRIVERS==""
ATTRS{ro}=="0"
ATTRS{size}=="1953458176"
ATTRS{stat}==" 1120 12 9050 1112 1081 13 241920 26760 0 5368 27868"
ATTRS{range}=="16"
ATTRS{discard_alignment}=="0"
ATTRS{events}==""
ATTRS{ext_range}=="256"
ATTRS{events_poll_msecs}=="-1"
ATTRS{alignment_offset}=="0"
ATTRS{inflight}==" 0 0"
ATTRS{removable}=="0"
ATTRS{capability}=="50"
ATTRS{events_async}==""

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb4/4-10/4-10:1.0/host10/target10:0:0/10:0:0:0':
KERNELS=="10:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{rev}=="1012"
ATTRS{type}=="0"
ATTRS{scsi_level}=="7"
ATTRS{model}=="My Passport 0820"
ATTRS{state}=="running"
ATTRS{queue_type}=="none"
ATTRS{iodone_cnt}=="0x901"
ATTRS{iorequest_cnt}=="0x901"
ATTRS{device_busy}=="0"
ATTRS{evt_capacity_change_reported}=="0"
ATTRS{timeout}=="30"
ATTRS{evt_media_change}=="0"
ATTRS{max_sectors}=="240"
ATTRS{ioerr_cnt}=="0x2"
ATTRS{queue_depth}=="1"
ATTRS{vendor}=="WD "
ATTRS{evt_soft_threshold_reached}=="0"
ATTRS{device_blocked}=="0"
ATTRS{evt_mode_parameter_change_reported}=="0"
ATTRS{evt_lun_change_reported}=="0"
ATTRS{evt_inquiry_change_reported}=="0"
ATTRS{iocounterbits}=="32"
ATTRS{eh_timeout}=="10"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb4/4-10/4-10:1.0/host10/target10:0:0':
KERNELS=="target10:0:0"
SUBSYSTEMS=="scsi"
DRIVERS==""

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb4/4-10/4-10:1.0/host10':
KERNELS=="host10"
SUBSYSTEMS=="scsi"
DRIVERS==""

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb4/4-10/4-10:1.0':
KERNELS=="4-10:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="usb-storage"
ATTRS{bInterfaceClass}=="08"
ATTRS{bInterfaceSubClass}=="06"
ATTRS{bInterfaceProtocol}=="50"
ATTRS{bNumEndpoints}=="02"
ATTRS{supports_autosuspend}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb4/4-10':
KERNELS=="4-10"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="10"
ATTRS{idVendor}=="1058"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="4"
ATTRS{devnum}=="9"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="500mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="80"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="1012"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="57583231414334395552565A"
ATTRS{version}==" 2.10"
ATTRS{urbnum}=="6987"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Western Digital"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0820"
ATTRS{bDeviceClass}=="00"
ATTRS{product}=="My Passport 0820"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb4':
KERNELS=="usb4"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{devpath}=="0"
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized_default}=="1"
ATTRS{busnum}=="4"
ATTRS{devnum}=="1"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="10"
ATTRS{bcdDevice}=="0316"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="0000:00:14.0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="170"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 3.16.0-34-generic xhci_hcd"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0002"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="xHCI Host Controller"

looking at parent device '/devices/pci0000:00/0000:00:14.0':
KERNELS=="0000:00:14.0"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRS{irq}=="43"
ATTRS{subsystem_vendor}=="0x103c"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0330"
ATTRS{driver_override}=="(null)"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{dma_mask_bits}=="64"
ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"
ATTRS{device}=="0x8c31"
ATTRS{enable}=="1"
ATTRS{msi_bus}==""
ATTRS{local_cpulist}=="0-3"
ATTRS{vendor}=="0x8086"
ATTRS{subsystem_device}=="0x330d"
ATTRS{numa_node}=="0"
ATTRS{d3cold_allowed}=="1"

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



  






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts