Platten abschalten

  • Zitat

    Original von stevie204
    Moin,


    Auf meinem Debian-System habe ich den noflushd-Daemon installiert, vorher lief das automatische einschlafen bei mir nicht.
    http://packages.debian.org/etch/noflushd


    Grüße, Stevie


    Nutzt du auch eine SATA-Platte mit noflushd?


    Funktioniert bei mir nicht, noflushd meldet bei mir beim Start:

    Code
    Error: Don't know how to spindown /dev/sda (bzw. /dev/sdb)


    Mit hdparm gehts....


    Gruß


    Andreas

    registered vdr-user: 1318


    file/vdr-server: ASRock Q1900M, SSD, 2TB HD, 1xDVBSky S952 v3 mit 2xDVB-S2, stretch+e-tobi, vdr 2.4.0-2~etobi1

  • Es funktioniert nun in Kombination:
    hdparm -S241 /dev/sdb
    hdparm -y /dev/sdb


    Ich schalte damit die Platte direkt nach dem Hochfahren ab. Nachdem ich darauf zugegriffen habe, legt sie sich auch später wieder schlafen.


    Gruß,
    Bienchen :)

  • He Ho,


    ich weis ja das der Thread schon etwas älter ist, aber ich habe nichts anderes nützliches gefunden.
    Ich ha da noch ein Problem:
    Hardware:
    Intel Board mit Atom CPU (soll kein VDR sondern Home Server werden)
    1 x Sata Platte 500GB
    1 x Sata Platte 1TB (systemplatte)
    beide von WD


    hdparm -y /dev/sdb funktioniert wunderbar, wenn ich allerdings
    hdparm -S10 /dev/sdb eingebe meldet er zwar: setting standby to 10 (50 seconds), es funktioniert aber nicht. Muss ich die Zeile eine eine datei eintragen? (bin noch recht neu in der Linux Welt)
    Achso ich verwende Debian Lenny, gerad neu aufgesetzt.


    Danke für eure Hilfe

  • Zitat

    Original von redstorm
    Muss ich die Zeile eine eine datei eintragen?

    Zum Test muss da nichts eingetragen werden.
    Wenn es auch nach einem Neustart passieren soll, dann schon.
    (ZB. in die /etc/rc.local .)

    Gruss
    SHF


  • hallo,


    hatte mich auch mal mit dem Thema beschäftigt und habe seit dem zwei Scripte laufen die ich irgendwo in anderen Foren gefunden habe.


    Script1


    #!/bin/bash
    #
    # Dieses Script ueberwacht Zugriffe auf die Platte und schickt sie bei Inaktiviteat
    # nach einer definierten Zeit ins standby. Eine Logdatei zeichnet jeden StartStop #Vorgang auf.
    #
    HD=sdc
    INTERVAL=60
    MODE=0
    LOGFILE=/var/log/monitor_sdc.log
    exec 2>> $LOGFILE
    exec 1>> $LOGFILE
    #
    sleep 300
    echo "`date '+%d %h %H:%M:%S'` Monitor HD Startup"
    while true
    do
    ## Standby Modus
    if [ $MODE -eq 0 ];then
    sleep 60
    hdparm -C /dev/$HD |grep active > /dev/null
    if [ $? -eq 0 ];then
    echo "`date '+%d %h %H:%M:%S'` Set MODE to Active"
    MODE=1
    fi
    fi
    ## Active Modus
    if [ $MODE -eq 1 ];then
    IO=`iostat $HD $INTERVAL 2 |grep $HD | tail -1 | awk '{ print $5 , $6}'`
    if [ "$IO" == "0 0" ]; then
    echo "`date '+%d %h %H:%M:%S'` Force Disk Standby"
    hdparm -y /dev/$HD >/dev/null
    echo "`date '+%d %h %H:%M:%S'` Set MODE to Standby"
    MODE=0
    fi
    fi
    done





    Scipt2


    #!/usr/bin/perl
    use POSIX qw(strftime);


    $timeout = 30 * 60;


    # device to use
    $devicelist = "sdb,sdc,sdd,sde,sdf";



    #################################



    foreach $device (split(',', $devicelist)) {
    $lastRCount{$device}=0;
    $lastATime{$device}=0;
    $sleepTime{$device}=0;
    }


    while (true) {
    foreach $device (split(',', $devicelist)) {
    open F, "< /sys/block/" . $device . "/device/iorequest_cnt";
    $requestCount{$device} = hex <F>;
    close F;


    $now=strftime "%s", localtime;
    if ($requestCount{$device} != $lastRCount{$device}) {
    $lastATime{$device} = $now;
    }


    # if we are after the timeout and there were new
    # accesses after the last sleep time -> go to sleep (again)
    if ($now > $lastATime{$device} + $timeout && $lastATime{$device} > $sleepTime{$device}) {


    $sleepTime{$device} = $now;
    system "logger -i -t scsi_idle sending $device to sleep";
    ## system "/usr/bin/sg_start 0 -pc=3 /dev/$device";
    system "/usr/bin/sg_start 0 /dev/$device";

    # increase the request count by one for the command we just sent
    $requestCount{$device}++;
    }


    $lastRCount{$device}=$requestCount{$device};
    }
    sleep 60;
    }

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!