[Eisfair] Paket hdtune

Armin Weinmann news at die-weinmanns.de
Mi Nov 9 21:22:48 CET 2016


Hallo zusammen,

sorry für meine späte Antwort, ich war etwas beschäftigt die letzten Tage...

Am 07.11.2016 um 09:00 schrieb Johannes Hinteregger:
> Unter /etc gibt es keine hdparm.conf.
>
ich habe folgendes gemacht:

(Inhalte zwischen den gestrichelten Linien)

1. /etc/check.d/hdtune.exp

-------------------------------------------------------------------------------------------
HDTUNE_DEVICE   = '(RE:DISK)'
                 : 'allowed disks from base.exp'
-------------------------------------------------------------------------------------------


2. /etc/init.d/hdtune:

-------------------------------------------------------------------------------------------
#! /bin/sh
#------------------------------------------------------------------------------
# /etc/rc.d/rc.hdtune - change modes for ide-harddisks
#
# Creation:    2001-07-31 tb
# Last Update: 2015-05-26 tb
#------------------------------------------------------------------------------

# . ../config.d/hdtune
. /etc/config.d/hdtune
. /var/install/include/eislib

tmp="/tmp/hdtune"

if [ "$HDTUNE_DO_DEBUG" = yes ]
then
     set -x
fi

#if [ "$START_HDTUNE" = "yes" ]
#then
     mecho -info "setting hdd modes now..."

     idx=1
     while [ "$idx" -le "$HDTUNE_N" ]
     do
         eval device='$HDTUNE_'$idx'_DEVICE'
         eval time='$HDTUNE_'$idx'_SLEEPTIME'
         eval speed='$HDTUNE_'$idx'_PERFORMANCE'
         eval io_access='$HDTUNE_'$idx'_32BIT'
         eval dma_access='$HDTUNE_'$idx'_DMA'
         eval acoustic='$HDTUNE_'$idx'_ACOUSTIC'
         params=''
         >$tmp

         # calculate sleeptime-parameter
         if [ "$time" != "0" ]
         then
             if [ "$time" -ge 300 ]
             then
                 mecho -warn "a timeout above five hours is not 
supported, changed to five hours"
                 sleep 5
                 sleep=250
             elif [ "$time" -gt 20 ]
             then
                 time=`/usr/bin/expr $time - 1`
                 sleep=`/usr/bin/expr $time / 30 + 241`
             else
                 sleep=`/usr/bin/expr $time \* 60 / 5`
             fi

             if `/sbin/hdparm -i /dev/$device >/dev/null 2>&1`
             then
                 params="-S$sleep"
             fi
         fi

         if [ "$speed" = "yes" ]
         then
             # activate lookahead
             lookahead=`/sbin/hdparm -I /dev/$device 2>/dev/null | grep 
'Look-ahead'`
             if [ -n "$lookahead" ]
             then
                 params="$params -A1"
             fi

             case $device in
             hd*)
                 # get maximum multiple sector count from device
                 maxmult=`/sbin/hdparm -i /dev/$device 2>/dev/null | 
grep MaxMultSect | sed 's/,//g'`
                 if [ -n "$maxmult" ]
                 then
                     for i in $maxmult
                     do
                         echo $i | grep MaxMultSect > /dev/null
                         if [ "$?" = "0" ]
                         then
                             maxmultsect=`echo $i | cut -d = -f2`
                         fi
                     done

                     if [ "$maxmultsect" -gt 2 -a "$maxmultsect" -le 64 ]
                     then
                         params="$params -m$maxmultsect"
                     fi
                 fi
                 ;;
             esac
         fi

         case $device in
         hd*)
             params="-a4"

             if [ "$io_access" = yes ]
             then
                 params="$params -c1"
             fi

             if [ "$dma_access" = yes ]
             then
                 params="$params -d1"
             fi
             ;;
         esac

         if [ "$acoustic" != "" ]
         then
             ac=`/sbin/hdparm -I /dev/$device 2>/dev/null | grep 'Acoustic'`
             if [ -n "$ac" ]
             then
                 params="$params -M$acoustic"
             fi
         fi

         cfmedia=`/sbin/hdparm -i /dev/$device 2>/dev/null | grep 
nonMagnetic`
         if [ "$cfmedia" = "" ]
         then
             if [ "$params" != "" ]
             then
                 /sbin/hdparm $params /dev/$device > $tmp
                 if [ "$?" != "0" ]
                 then
                     cat $tmp
                     mecho -error "*** ERROR: Disk $device does not 
support your HDTUNE-Settings. ***"
                     sleep 5
                 fi
             fi
         else
             mecho -warn "*** WARNING: Disk $device is not a harddisk, 
Operation not supported ***"
         fi

         message=`cat $tmp`
         if [ -n "$message" ]
         then
             /usr/bin/logger -s -t "hdtune" -f $tmp
         fi

         idx=`/usr/bin/expr $idx + 1`
     done
#fi

# undocumented function: use at your own risk!
# you can set the maximum rotation speed of a cdrom here
# hdparm -E 4 /dev/hda

rm $tmp
set +x
-------------------------------------------------------------------------------------------

Kommt aus dem Beitrag von Tom Bork vom 26.05.2015 zum Thema 'Paket 
hdtune modifizieren'

Ob ich damit allerdings die Platten zum Anhalten bekomme habe ich noch 
nicht verifiziert

Armin



Mehr Informationen über die Mailingliste Eisfair