Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

udev/systemd change some rules in debian8

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
VGusev2007
Posts: 2
Joined: 2011-05-27 08:03

udev/systemd change some rules in debian8

#1 Post by VGusev2007 »

Dear all, I have SSD drives without SCT support, because of this I want to tune /sys/block/device-name/device/timeout in order to force mdadm put these drives offline. So, I can see my drive like this: /dev/disk/by-id/ata-OCZ-SABER1000_A22MJ061512000074. Where can I tune /sys/block/device-name/device/timeout from 30 to 7 sec only for these drive? I don't want to use rc.local.

Can I create right udev rules for it in /etc/udev/rules.d?

Please help me to make this rule. I want to avoid any conflict with /lib/udev/rules.d.

Code: Select all

# udevadm monitor --environment --udev
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing

UDEV  [9302.549485] add      /devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0 (scsi)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0
DEVTYPE=scsi_target
SEQNUM=5210
SUBSYSTEM=scsi
USEC_INITIALIZED=2549245

UDEV  [9302.549634] add      /devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0 (scsi)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0
DEVTYPE=scsi_device
MODALIAS=scsi:t-0x00
SEQNUM=5211
SUBSYSTEM=scsi
USEC_INITIALIZED=49324

UDEV  [9302.549774] add      /devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0 (scsi_disk)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0
SEQNUM=5212
SUBSYSTEM=scsi_disk
USEC_INITIALIZED=49332

UDEV  [9302.549898] add      /devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/scsi_device/0:0:0:0 (scsi_device)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/scsi_device/0:0:0:0
SEQNUM=5213
SUBSYSTEM=scsi_device
USEC_INITIALIZED=2549339

UDEV  [9302.550011] add      /devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/scsi_generic/sg0 (scsi_generic)
ACTION=add
DEVNAME=/dev/sg0
DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/scsi_generic/sg0
MAJOR=21
MINOR=0
SEQNUM=5214
SUBSYSTEM=scsi_generic
USEC_INITIALIZED=2549348

UDEV  [9302.550215] add      /devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0 (bsg)
ACTION=add
DEVNAME=/dev/bsg/0:0:0:0
DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0
MAJOR=252
MINOR=0
SEQNUM=5215
SUBSYSTEM=bsg
USEC_INITIALIZED=2549358

UDEV  [9302.555201] add      /devices/virtual/bdi/8:0 (bdi)
ACTION=add
DEVPATH=/devices/virtual/bdi/8:0
SEQNUM=5216
SUBSYSTEM=bdi
USEC_INITIALIZED=55120

UDEV  [9302.581632] add      /devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/block/sda (block)
ACTION=add
DEVLINKS=/dev/disk/by-id/ata-OCZ-SABER1000_A22MJ061512000074 /dev/disk/by-id/wwn-0x2361012128966598275x /dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:0:0
DEVNAME=/dev/sda
DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/block/sda
DEVTYPE=disk
ID_ATA=1
ID_ATA_DOWNLOAD_MICROCODE=1
ID_ATA_FEATURE_SET_HPA=1
ID_ATA_FEATURE_SET_HPA_ENABLED=1
ID_ATA_FEATURE_SET_PM=1
ID_ATA_FEATURE_SET_PM_ENABLED=1
ID_ATA_FEATURE_SET_SECURITY=1
ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=0
ID_ATA_FEATURE_SET_SMART=1
ID_ATA_FEATURE_SET_SMART_ENABLED=1
ID_ATA_ROTATION_RATE_RPM=0
ID_ATA_SATA=1
ID_ATA_SATA_SIGNAL_RATE_GEN1=1
ID_ATA_SATA_SIGNAL_RATE_GEN2=1
ID_ATA_WRITE_CACHE=1
ID_ATA_WRITE_CACHE_ENABLED=1
ID_BUS=ata
ID_MODEL=OCZ-SABER1000
ID_MODEL_ENC=OCZ-SABER1000\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_PART_TABLE_TYPE=gpt
ID_PART_TABLE_UUID=93855244-809c-4cbc-b2c1-76f08f1c9671
ID_PATH=pci-0000:03:00.0-scsi-0:0:0:0
ID_PATH_TAG=pci-0000_03_00_0-scsi-0_0_0_0
ID_REVISION=1.01
ID_SERIAL=OCZ-SABER1000_A22MJ061512000074
ID_SERIAL_SHORT=A22MJ061512000074
ID_TYPE=disk
ID_WWN=0x2361012128966598275x
ID_WWN_WITH_EXTENSION=0x2361012128966598275x
MAJOR=8
MINOR=0
SEQNUM=5217
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZED=59932

UDEV  [9302.586919] add      /devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/block/sda/sda1 (block)
ACTION=add
DEVLINKS=/dev/disk/by-id/ata-OCZ-SABER1000_A22MJ061512000074-part1 /dev/disk/by-id/wwn-0x2361012128966598275x-part1 /dev/disk/by-partlabel/Linux\x20RAID /dev/disk/by-partuuid/131d0a56-7a01-40e7-8757-3199541c88d0 /dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:0:0-part1
DEVNAME=/dev/sda1
DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.0/host0/target0:0:0/0:0:0:0/block/sda/sda1
DEVTYPE=partition
ID_ATA=1
ID_ATA_DOWNLOAD_MICROCODE=1
ID_ATA_FEATURE_SET_HPA=1
ID_ATA_FEATURE_SET_HPA_ENABLED=1
ID_ATA_FEATURE_SET_PM=1
ID_ATA_FEATURE_SET_PM_ENABLED=1
ID_ATA_FEATURE_SET_SECURITY=1
ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=0
ID_ATA_FEATURE_SET_SMART=1
ID_ATA_FEATURE_SET_SMART_ENABLED=1
ID_ATA_ROTATION_RATE_RPM=0
ID_ATA_SATA=1
ID_ATA_SATA_SIGNAL_RATE_GEN1=1
ID_ATA_SATA_SIGNAL_RATE_GEN2=1
ID_ATA_WRITE_CACHE=1
ID_ATA_WRITE_CACHE_ENABLED=1
ID_BUS=ata
ID_FS_LABEL=vivid:2
ID_FS_LABEL_ENC=vivid:2
ID_FS_TYPE=linux_raid_member
ID_FS_USAGE=raid
ID_FS_UUID=7c9a9e07-ecd7-c1f0-f952-624f5781f7cf
ID_FS_UUID_ENC=7c9a9e07-ecd7-c1f0-f952-624f5781f7cf
ID_FS_UUID_SUB=23c6a3b3-8586-924b-688a-c662bebba51e
ID_FS_UUID_SUB_ENC=23c6a3b3-8586-924b-688a-c662bebba51e
ID_FS_VERSION=1.2
ID_MODEL=OCZ-SABER1000
ID_MODEL_ENC=OCZ-SABER1000\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_PART_ENTRY_DISK=8:0
ID_PART_ENTRY_NAME=Linux\x20RAID
ID_PART_ENTRY_NUMBER=1
ID_PART_ENTRY_OFFSET=2048
ID_PART_ENTRY_SCHEME=gpt
ID_PART_ENTRY_SIZE=468860047
ID_PART_ENTRY_TYPE=a19d880f-05fc-4d3b-a006-743f0f84911e
ID_PART_ENTRY_UUID=131d0a56-7a01-40e7-8757-3199541c88d0
ID_PART_TABLE_TYPE=gpt
ID_PART_TABLE_UUID=93855244-809c-4cbc-b2c1-76f08f1c9671
ID_PATH=pci-0000:03:00.0-scsi-0:0:0:0
ID_PATH_TAG=pci-0000_03_00_0-scsi-0_0_0_0
ID_REVISION=1.01
ID_SERIAL=OCZ-SABER1000_A22MJ061512000074
ID_SERIAL_SHORT=A22MJ061512000074
ID_TYPE=disk
ID_WWN=0x2361012128966598275x
ID_WWN_WITH_EXTENSION=0x2361012128966598275x
MAJOR=8
MINOR=1
SEQNUM=5218
SUBSYSTEM=block
TAGS=:systemd:
UDISKS_IGNORE=1
UDISKS_MD_MEMBER_ARRAY_SIZE=239.92GB
UDISKS_MD_MEMBER_DEVICES=2
UDISKS_MD_MEMBER_DEV_UUID=23c6a3b3:8586924b:688ac662:bebba51e
UDISKS_MD_MEMBER_EVENTS=608
UDISKS_MD_MEMBER_LEVEL=raid1
UDISKS_MD_MEMBER_NAME=vivid:2
UDISKS_MD_MEMBER_UPDATE_TIME=1460964888
UDISKS_MD_MEMBER_UUID=7c9a9e07:ecd7c1f0:f952624f:5781f7cf
USEC_INITIALIZED=59949

Code: Select all

# udevadm info --name=/dev/sda --attribute-walk

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:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda':
    KERNEL=="sda"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{ro}=="0"
    ATTR{size}=="625142448"
    ATTR{stat}==" 2463408      878 20355666  2215512  7520639  2407612 605526760 53124596        0 34160732 55341288"
    ATTR{range}=="16"
    ATTR{discard_alignment}=="0"
    ATTR{events}==""
    ATTR{ext_range}=="256"
    ATTR{events_poll_msecs}=="-1"
    ATTR{alignment_offset}=="0"
    ATTR{inflight}=="       0        0"
    ATTR{removable}=="0"
    ATTR{capability}=="50"
    ATTR{events_async}==""

  looking at parent device '/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0':
    KERNELS=="0:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{rev}=="1H15"
    ATTRS{type}=="0"
    ATTRS{scsi_level}=="6"
    ATTRS{model}=="WDC WD3200AAKX-0"
    ATTRS{state}=="running"
    ATTRS{queue_type}=="none"
    ATTRS{iodone_cnt}=="0xe27447"
    ATTRS{iorequest_cnt}=="0xec578f"
    ATTRS{queue_ramp_up_period}=="120000"
    ATTRS{device_busy}=="0"
    ATTRS{evt_capacity_change_reported}=="0"
    ATTRS{timeout}=="30"
    ATTRS{evt_media_change}=="0"
    ATTRS{ioerr_cnt}=="0x1dc"
    ATTRS{queue_depth}=="31"
    ATTRS{vendor}=="ATA     "
    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{vpd_pg80}==""
    ATTRS{vpd_pg83}==""
    ATTRS{eh_timeout}=="10"

  looking at parent device '/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0':
    KERNELS=="target0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:1f.2/ata1/host0':
    KERNELS=="host0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:1f.2/ata1':
    KERNELS=="ata1"
    SUBSYSTEMS==""
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:1f.2':
    KERNELS=="0000:00:1f.2"
    SUBSYSTEMS=="pci"
    DRIVERS=="ahci"
    ATTRS{irq}=="21"
    ATTRS{subsystem_vendor}=="0x8086"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x010601"
    ATTRS{index}=="1"
    ATTRS{label}=="PCH Integrated SATA Controller"
    ATTRS{driver_override}=="(null)"
    ATTRS{consistent_dma_mask_bits}=="64"
    ATTRS{dma_mask_bits}=="64"
    ATTRS{local_cpus}=="00000000,00000000,00000000,0000000f"
    ATTRS{device}=="0x1c02"
    ATTRS{enable}=="1"
    ATTRS{msi_bus}=="1"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x7270"
    ATTRS{numa_node}=="-1"
    ATTRS{d3cold_allowed}=="1"

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

I'll be glad if you help to me with it.

Best regards.

Post Reply