View Single Post
Old 11-02-2007, 04:29 PM   #4 (permalink)
Disillusion
Disillusion's Avatar
 
\m/ Metalhead \m/

Join Date: Nov 2005

Posts: 801

Disillusion

Default Re: Ubuntu Causing Laptop HDD Failure?

I've discovered that by editing /etc/acpi/power.sh should cure the problem permanently.

There is a line that says
Code:
function laptop_mode_enable {
    $LAPTOP_MODE start
    
    for x in /sys/bus/ide/devices/*/block; do 
	drive=$(basename $(readlink $x));
	$HDPARM -S $SPINDOWN_TIME /dev/$drive 2>/dev/null
	$HDPARM -B 1 /dev/$drive 2>/dev/null
    done
    
    for x in /sys/bus/scsi/devices/*/block; do 
	drive=$(basename $(readlink $x));
	$HDPARM -S $SPINDOWN_TIME /dev/$drive 2>/dev/null
	$HDPARM -B 1 /dev/$drive 2>/dev/null
    done
}

function laptop_mode_disable {
    for x in /sys/bus/ide/devices/*/block; do 
	drive=$(basename $(readlink $x));
	$HDPARM -S 0 /dev/$drive 2>/dev/null
	$HDPARM -B 255 /dev/$drive 2>/dev/null
    done
    for x in /sys/bus/scsi/devices/*/block; do 
	drive=$(basename $(readlink $x));
	$HDPARM -S 0 /dev/$drive 2>/dev/null
	$HDPARM -B 255 /dev/$drive 2>/dev/null
    done
    $LAPTOP_MODE stop
}
As you can see, when it is in laptop mode, it's doing hdparm -B 1 which is the most aggressive power saving feature for the HDD, which will cause it to constantly go into standby. If you change this to a more realistic number, like 150-200, then it should be better. Or you can completely disable it by changing the number from 1 to 255.
__________________
CPU: Intel Q6600 B3 @ 3.0 GHz
Cooler: Tuniq Tower 120
Mobo: Gigabyte GA-P35-DS3L
RAM: G.Skill 4 GB DDR2 800
GPU: EVGA 8800GT Superclocked 512 MB
HDD: 2 x Seagate Barracuda 160 GB
PSU: OCZ StealthXStream 600W
Case: Cooler Master Centurion 5
Disillusion is offline