[SOLVED] HDD switches off after a while (spin down)

Post here if you are a new Porteus member and you're looking for some help.
User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

[SOLVED] HDD switches off after a while (spin down)

Post#1 by amplatfus » 09 Apr 2016, 10:42

HI all,

I am using Porteus as main OS on HDD, with all files and changes folder on HDD. Even so, HDD goes off (spin down) after same amount of time and after ~3 seconds goes on again.
If I am booting directly on battery this is not happening. It happens only when unplugged when Porteus is running.

1. I have tried with this in startup, but is not working

Code: Select all

/dev/sda1
setting advanced power management level to 0xfe (254)
APM_level = 254
2. I have tried with acpi=off as cheatcode in porteus.cfg but it removes the battery status from taskbar. I didn't wait until now to see if this solved the spinning down of HDD
3. I was tried to make a swap on HDD thinking that this will block the HDD to spin down. Is not working

Could you please help?
I am thankful for any idea.

Many thanks,
amplatfus
Last edited by amplatfus on 10 Apr 2016, 10:28, edited 1 time in total.
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

donald
Full of knowledge
Full of knowledge
Posts: 2063
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: HDD switches off after a while (spin down)

Post#2 by donald » 09 Apr 2016, 11:36

amplatfus wrote: 1. I have tried with this in startup, but is not working

Code: Select all

/dev/sda1
setting advanced power management level to 0xfe (254)
APM_level = 254
sda1 is a partition -- the drive is sda
for drive settings take a look at hdparm, BE VERY CAREFUL.
root@localhost:~# hdparm --help

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: HDD switches off after a while (spin down)

Post#3 by Jack » 09 Apr 2016, 15:48

I believe in the bios you set the power setting and one is for the Hard Drive. I think I seen it in my bios.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: HDD switches off after a while (spin down)

Post#4 by amplatfus » 09 Apr 2016, 18:41

Jack wrote:I believe in the bios you set the power setting and one is for the Hard Drive. I think I seen it in my bios.
Hi all,
I believe is not from bios because it happens only when I unplug the cable with Porteus running.
When I unplug the cable before boot and booting up unplugged Is not happening.
It spin down even I run the Porteus from HDD, not as copy to ram for instance. Even I set the swap on HDD.

I will test hdparm.

Thanks,
amplatfus
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: HDD switches off after a while (spin down)

Post#5 by Jack » 09 Apr 2016, 19:08

What type of computer do you have and what cable did you unplug? If it is a laptop and you unplug it and power down the Hard Drive it is trying to save on battery power. I don't you can stop that from doing it.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: HDD switches off after a while (spin down)

Post#6 by amplatfus » 09 Apr 2016, 19:18

Jack wrote:What type of computer do you have and what cable did you unplug? If it is a laptop and you unplug it and power down the Hard Drive it is trying to save on battery power. I don't you can stop that from doing it.
Yes, it is a laptop. I think also it is something like a battery saver, but it is strange that if I boot on battery the spin down is not happening.
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: HDD switches off after a while (spin down)

Post#7 by Jack » 09 Apr 2016, 19:34

Are you sure it not or how do you know? My laptop I can't hear my Hard Drive is spinning or not. What desktop are you using? The only desktop that runs good on my laptop is Mate the other desktop ran slow. That could be a problem for you. My laptop has AMD Athlon Dual-Core QL-62, 3gb of ram and 160gb Hard Drive.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: HDD switches off after a while (spin down)

Post#8 by amplatfus » 09 Apr 2016, 19:44

Jack wrote:Are you sure it not or how do you know? My laptop I can't hear my Hard Drive is spinning or not. What desktop are you using? The only desktop that runs good on my laptop is Mate the other desktop ran slow. That could be a problem for you. My laptop has AMD Athlon Dual-Core QL-62, 3gb of ram and 160gb Hard Drive.
I am sure.
I am using Dell E6410 on LXDE X64 and in my case, yes, I can hear the HDD if is on or not.
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: HDD switches off after a while (spin down)

Post#9 by Jack » 09 Apr 2016, 19:58

Sorry I don't what else to tell you. I use a 8gb USB thumb drive and when I write to the Hard Drive I have no problem.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: HDD switches off after a while (spin down)

Post#10 by brokenman » 09 Apr 2016, 20:40

The reason may be the laptopmode-tools package. Please read up on laptopmode-tools for options.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: HDD switches off after a while (spin down)

Post#11 by francois » 09 Apr 2016, 21:34

In the same line as brokenman see:
http://forum.porteus.org/viewtopic.php?f=48&t=3640

In fact, there is something about disk in the /etc/laptop-mode/laptop-mode.conf. It seems that your answer is there. :)
Prendre son temps, profiter de celui qui passe.

donald
Full of knowledge
Full of knowledge
Posts: 2063
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: HDD switches off after a while (spin down)

Post#12 by donald » 09 Apr 2016, 22:31

Stop it for a quick check

Code: Select all

/etc/rc.d/rc.laptop-mode stop
and see what gives..(still spinning down?)

status (enabled or not)

Code: Select all

cat /proc/sys/vm/laptop_mode

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

[SOLVED] Re: HDD switches off after a while (spin down)

Post#13 by amplatfus » 10 Apr 2016, 10:27

Hi all,

And thank all you for replies.
It worked with below command, but only when I entered from terminal, not when I put it in rc.d (with cat /proc/sys/vm/laptop_mode I got 1 as result) or in S-firewall.sh even with cat /proc/sys/vm/laptop_mode I got 0 as result.

Code: Select all

/etc/rc.d/rc.laptop-mode stop
I can confirm it was from laptop-mode.conf. I have done some changes like:
ENABLE_LAPTOP_MODE_TOOLS=0;
ENABLE_LAPTOP_MODE_ON_BATTERY=0;
ENABLE_LAPTOP_MODE_ON_AC=0;
hdparm -S 0.
in it and now is solved. Here is my actual laptop-mode.conf:

Code: Select all

###############################################################################
#
# Configuration for Laptop Mode Tools
# -----------------------------------
#
# There is a "system" to the configuration setting names:
#    CONTROL_something=0/1   Determines whether Laptop Mode Tools controls 
#                            something
#    LM_something=value      Value of "something" when laptop mode is active
#    NOLM_something=value    Value of "something" when laptop mode is NOT
#                            active
#    AC_something=value      Value of "something" when the computer is running
#                            on AC power
#    BATT_something=value    Value of "something when the computer is running
#                            on battery power
#
# There can be combinations of LM_/NOLM_ and AC_/BATT_ prefixes, but the
# available prefixes are different for each setting. The available ones are 
# documented in the manual page, laptop-mode.conf(8). If there is no LM_/
# NOLM_ in a setting name, then the value is used independently of laptop
# mode state, and similarly, if there is no AC_/BATT_, then the value is used
# independently of power state.
#
# Some options only work on ACPI systems. They are marked ACPI-ONLY.
#
# Note that this configuration file is a fragment of shell script: you
# can use all the features of the shell scripting language to achieve your
# desired configuration.
#
# 
# Modules
# -------
#
# Laptop Mode Tools modules have separate configuration files, that can be
# found in /etc/laptop-mode/conf.d. Please look through these configuration
# files as well, there are many useful power saving tools in there!
#
###############################################################################


###############################################################################
# Enable/Disable laptop-mode-tools execution
# ------------------------------------------
# Set it to 0 to completely disable laptop-mode-tools from running
###############################################################################
#
ENABLE_LAPTOP_MODE_TOOLS=0


###############################################################################
# Configuration debugging
# -----------------------
###############################################################################

#
# Set this to 1 if you want to see a lot of information when you start/stop 
# laptop_mode.
#
VERBOSE_OUTPUT=0

# Set this to 1 if you want to log messages to syslog
LOG_TO_SYSLOG=0

# Run in shell debug mode
# Enable this if you would like to execute the entire laptop-mode-tools program
# in shell debug mode. Warning: This will create a lot of text output
# If you are debugging an individual module, perhaps you would want to enable
# each module specific debug mode (available in module conf files)
DEBUG=0

###############################################################################
# When to enable laptop mode
# --------------------------
#
# "Laptop mode" is the mode in which laptop mode tools makes the computer
# consume less power. This includes the kernel "laptop_mode" feature, which
# allows your hard drives to spin down, as well as various other settings which
# can be tweaked by laptop mode tools. You can enable or disable all of these
# settings using the CONTROL_... options further down in this config file.
###############################################################################


#
# Enable laptop mode when on battery power.
#
ENABLE_LAPTOP_MODE_ON_BATTERY=0


#
# Enable laptop mode when on AC power.
#
ENABLE_LAPTOP_MODE_ON_AC=0


#
# Enable laptop mode when the laptop's lid is closed, even when we're on AC
# power? (ACPI-ONLY)
#
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0


#
# Enable all simple zero-configuration auto modules
# This option enables all simple modules (listed below) without requiring
# the user to enable each module individually
#
# List of modules which can be automatically enabled with this setting are:
#
# ac97-powersave
# cpufreq
# dpms-standby
# eee-superhe
# ethernet
# exec-commands
# hal-polling
# hdparm
# intel-hda-powersave
# intel-sata-powermgmt
# nmi-watchdog
# pcie-aspm
# runtime-pm
# sched-mc-power-savings
# sched-smt-power-savings
# terminal-blanking
# usb-autosuspend
# wireless-ipw-power
# wireless-iwl-power
# wireless-power
#
# Set this to 1 to enable all simple zero-configuration auto modules listed above.
#
# NOTE: You can explicitly enable/disable any of the above modules by changing their
# values in the individual settings file
#
ENABLE_AUTO_MODULES=1



###############################################################################
# When to enable data loss sensitive features
# -------------------------------------------
#
# When data loss sensitive features are disabled, laptop mode tools acts as if
# laptop mode were disabled, for those features only.
#
# Data loss sensitive features include:
# - laptop_mode (i.e., delayed writes)
# - hard drive write cache
#
# All of the options that follow can be set to 0 in order to prevent laptop
# mode tools from using them to stop data loss sensitive features. Use this
# when you have a battery that reports the wrong information, that confuses
# laptop mode tools.
#
# Disabling data loss sensitive features is ACPI-ONLY, and it only works if
# your battery gives off frequent ACPI events to indicate a change in battery
# level.
#
# NOTE: If your battery does NOT give off battery events often enough, you can
# enable the battery-level-polling module to make this work. Look at the
# file /etc/laptop-mode/conf.d/battery-level-polling.conf for more information.
#
###############################################################################


#
# Disable all data loss sensitive features when the battery level (in % of the
# battery capacity) reaches this value.
#
MINIMUM_BATTERY_CHARGE_PERCENT=3


#
# Disable data loss sensitive features when the battery reports its state
# as "critical".
#
DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1


#
# Ignore the alarm value reported by your batteries. In some instances a
# a battery will report an abnormally high alarm value, resulting in data-loss
# sensitive features being disabled prematurely.
#
DISABLE_BATTERY_ALARM_CHECK=0


###############################################################################
# Controlled hard drives and partitions
# -------------------------------------
#
# For spinning down your hard drives, laptop mode will remount file systems and
# adjust hard drive spindown timeouts. These parameters specify which
# devices and partitions are affected by laptop mode.
###############################################################################


#
# The drives that laptop mode controls.
# Separate them by a space, e.g. HD="/dev/hda /dev/hdb". The default is a
# wildcard, which will get you all your IDE and SCSI/SATA drives.
#
HD="/dev/[hs]d[abcdefgh]"


#
# The partitions (or mount points) that laptop mode controls.
# Separate the values by spaces. Use "auto" to indicate all partitions on drives
# listed in HD. You can add things to "auto", e.g. "auto /dev/hdc3". You can
# also specify mount points, e.g. "/mnt/data".
#
PARTITIONS="auto /dev/mapper/*"


#
# If this is enabled, laptop mode tools will assume that SCSI drives are
# really SATA drives that only _look_ like SCSI drives, and will use hdparm
# to control them. Set this to 0 if you have /dev/sd devices and you want
# laptop mode tools to use the "sdparm" command to control them. 
#
ASSUME_SCSI_IS_SATA=1


###############################################################################
# Hard drive behaviour settings
# -----------------------------
#
# These settings specify how laptop mode tools will adjust the various
# parameters of your hard drives and file systems.
###############################################################################


#
# Maximum time, in seconds, of work that you are prepared to lose when your
# system crashes or power runs out. This is the maximum time that Laptop Mode
# will keep unsaved data waiting in memory before spinning up your hard drive.
#
LM_BATT_MAX_LOST_WORK_SECONDS=300
LM_AC_MAX_LOST_WORK_SECONDS=300


#
# Should laptop mode tools control readahead?
#
CONTROL_READAHEAD=0


#
# Read-ahead, in kilobytes. You can spin down the disk while playing MP3/OGG
# by setting the disk readahead to a reasonable size, e.g. 3072 (3 MB).
# Effectively, the disk will read a complete MP3 at once, and will then spin 
# down while the MP3/OGG is playing. Don't set this too high, because the 
# readahead is applied to _all_ files that are read from disk.
#
LM_READAHEAD=3072
NOLM_READAHEAD=128


#
# Should laptop mode tools add the "noatime" option to the mount options when 
# laptop mode is enabled?
#
CONTROL_NOATIME=0

# Should laptop use relatime instead of noatime? The "relatime" mount option has
# more standards-compliant semantics, and allows more applications to work,
# while retaining a low level of atime updates (i.e., disk writes).
USE_RELATIME=0


#
# Should laptop mode tools control the hard drive idle timeout settings?
#
CONTROL_HD_IDLE_TIMEOUT=0


#
# Idle timeout values. (hdparm -S)
# Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
# for battery and for AC with laptop mode on.
#
hdparm -S 0
LM_AC_HD_IDLE_TIMEOUT_SECONDS=1800
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=180
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200


#
# Should laptop mode tools control the hard drive power management settings?
#
# Set to 0 to disable a fost "auto"
CONTROL_HD_POWERMGMT="0"


#
# Power management for HD (hdparm -B values)
#am adaugat un 0 in plus la valoare
BATT_HD_POWERMGMT=1270
LM_AC_HD_POWERMGMT=2540
NOLM_AC_HD_POWERMGMT=2540


#
# Should laptop mode tools control the hard drive write cache settings?
#
CONTROL_HD_WRITECACHE=0


#
# Write cache settings for HD (hdparm -W values)
#
NOLM_AC_HD_WRITECACHE=1
NOLM_BATT_HD_WRITECACHE=0
LM_HD_WRITECACHE=0




###############################################################################
# Settings you probably don't want to touch
# -----------------------------------------
#
# It is usually not necessary to change these parameters. They are included
# for completeness' sake.
###############################################################################


#
# Change mount options on partitions in PARTITIONS? You don't really want to
# disable this. If you do, then your hard drives will probably not spin down
# anymore.
#
CONTROL_MOUNT_OPTIONS=1


#
# Dirty synchronous ratio.  At this percentage of dirty pages the process
# which calls write() does its own writeback.
#
LM_DIRTY_RATIO=60
NOLM_DIRTY_RATIO=40


#
# Allowed dirty background ratio, in percent.  Once DIRTY_RATIO has been
# exceeded, the kernel will wake pdflush which will then reduce the amount
# of dirty memory to dirty_background_ratio.  Set this nice and low, so once
# some writeout has commenced, we do a lot of it.
#
LM_DIRTY_BACKGROUND_RATIO=1
NOLM_DIRTY_BACKGROUND_RATIO=10


#
# kernel default settings -- don't touch these unless you know what you're 
# doing.
#
DEF_UPDATE=5
DEF_XFS_AGE_BUFFER=15
DEF_XFS_SYNC_INTERVAL=30
DEF_XFS_BUFD_INTERVAL=1
DEF_MAX_AGE=30


#
# This must be adjusted manually to the value of HZ in the running kernel
# on 2.4, until the XFS people change their 2.4 external interfaces to work in
# centisecs. This can be automated, but it's a work in progress that still
# needs some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for
# external interfaces, and that is currently always set to 100. So you don't
# need to change this on 2.6.
#
XFS_HZ=100


#
# Seconds laptop mode has to to wait after the disk goes idle before doing
# a sync.
#
LM_SECONDS_BEFORE_SYNC=2
Many thanks again,
amplatfus
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

Post Reply