help with the little script (erc timout fix)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

by adapting what I could find, I compiled the following short snippet now.

Could list members please look at this novice code and suggest a way to 
determine the containing disk device $HDD_DEV from the parition/disk,
before I dare to test this.



In udev-md-raid-assembly.rules, below LABEL="md_inc" (section only handling
all md suppported devices) add:

# fix timouts for redundant raids, if possible
IMPORT{program}="BINDIR/mdadm --examine --export $tempnode"
TEST="/usr/sbin/smartctl", ENV{MD_LEVEL}=="raid[1-9]*",
RUN+="BINDIR/mdadm-erc-timout-fix.sh $tempnode"

And in a new mdadm-erc-timout-fix.sh file implement:

  #! /bin/sh

  HDD_DEV= $1 somehow stipping off the tailing numbers?

  if smartctl -l scterc ${HDD_DEV} | grep -q Disabled ; then
    /usr/sbin/smartctl -l scterc,70,70 ${HDD_DEV}
  else
    if ! smartctl -l scterc ${HDD_DEV} | grep -q seconds ; then
      echo 180 >/sys/block/${HDD_DEV}/device/timeout
    fi
  fi

Correct execution during boot would seem to require that distro
package managers hook smartctl and the script into the initramfs
generation.

Regards,
Chris

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux