LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-04-2009, 04:01 PM   #1
crispy_chunks
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Rep: Reputation: 0
Unhappy Putting harddisk to sleep... and keeping it sleepy


Hello, ive got a machine which i use as a media center, running kubuntu (gnome is also installed). However, when im not using it it would be very nice to keep my harddisks powered down - I know how to do this with hdparm, but they always spin up again after like 5 seconds.

What i have tried:
laptop_mode start - this makes the harddisk turn off alright, but they still spin up after 5 secs.

unmounting all volumes from the discs i want to put to sleep - still same problem.

-- I have also observed a constant buzzing sound from the harddisks, which lasts 10-30s and reappears after 10-30s. Its sort of a writing sound, but at a much lower volume, kind of feels like it wants to write something but its afraid of something hehe.
 
Old 01-05-2009, 05:07 AM   #2
johan162
LQ Newbie
 
Registered: Jan 2009
Location: Stockholm
Distribution: SuSE 11.1
Posts: 27

Rep: Reputation: 0
You didn't state your disk configuration or or exactly what hdparm argument you were using so it's not that easy to help you.

If you only have one hdd you can never have it constantly sleep since the system will access logs (e.g. /var/log/messages etc) and thereby wake up the disk to write to it. Depending on your system setup the access to the log files can be several times a minute which makes putting the drive to sleep practically impossible.

If you only used "$> /sbin/hdparm -y /dev/sda" (for example) it will only put your disk in suspended state until the next wake up. If you want to set the standby parameter so it automatically goes to sleep after X minutes of inactivity on the disk you should use the "-S" command to hdparm.

(Please note the somewhat strange parameters to the "-S" command. Refer to "man hdparm for details.)

If you only have one hdd everything is not completely lost since in theory you could set up a tmpfs (temp filesystem) as a RAM disk and mount /var onto that. However, that is very dangerous thing to do since there are things on the var partition (e.g. databases) that you don't want to loose when the power goes down.

(I once did this on a UPS backedup server and had script several times a day do an rsync on the RAM disk back to a proper /var disk so in case of a fatal power outage.)

Johan
 
Old 01-05-2009, 09:44 AM   #3
crispy_chunks
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Oh yes sorry for the ovbiously missing information, my disk configuration is as follows: disk 1: 80 gb system drive, disc 2 and 3 mounted in /media/disk2 and disk3 - all formatted in ext3 - swap partition on disk 1.

I put my drives to sleep with sudo hdparm -Y <device>

The ramdisk solution seems very interesting - what kind of database loss could we be seeing? I will be running amarok and xbmc which both uses databases to keep track of music/other media, but i guess these could be configured to keep their databases out of the /var/ dir if they even keep them there. I guess database access from these are only active when they are needed eg. disks are spinning anyways.

I can probably turn off logs also.

My system will be very static (not changing many settings) once its set up if that helps out on the /var/ problem.

Maybe make a script that keeps saving the /var/ stuff as long as the disk is active, but saves it to ram when its not. I mean, how important can the stuff that needs to be saved to /var/ be when the computer is not doing anything?
 
Old 01-05-2009, 09:59 AM   #4
crispy_chunks
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Actually, what i really want is the computer to be silent when its not in use - but putting the whole system in suspend doesnt seem to work with the nvidia driver, and i need 3d accleration for xbmc
 
Old 01-08-2009, 07:43 AM   #5
crispy_chunks
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0
I discovered that if i mount the filesystem as ext2, and with async option (is this one necessary? I am not concerned about write/read speeds), the disk wont spin up again all the time - because there is not journal written as with ext3, but what is the consequence of mounting it like this? Like with good old fat that there will be possible file corruption in case of unclean shutdown?
 
Old 01-09-2009, 02:33 AM   #6
johan162
LQ Newbie
 
Registered: Jan 2009
Location: Stockholm
Distribution: SuSE 11.1
Posts: 27

Rep: Reputation: 0
The databases I was referring to is that by default mysql (and some other db:s) stores the DB files under /var. Just in case you have some applications that use databases or other type of storages (Besides log files) that must survive a power-outage.

The async mounting option will give you performance boost but at significant risk (the risk is a little bit dependent on what FS you use). If your files are truly temporary, then by all means, go ahead. However, if you have some problems it might be very hard (or almost impossible) to restore the files. Even fsck might have substantial difficulties recovering a damaged structure since it is possible to have structural damages on the fs if you have the power outage at just the wrong time when you are running async.

(Having said all that I run /tmp mounted async on our main UPS backed up server - but then again I only use ext2 on the /tmp folder to keep the overhead as low as possible. In addition to help train our users /tmp is cleaned once every 14 days)

/J
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting problems after putting in extra Harddisk megabot Linux - Hardware 4 03-27-2007 01:00 AM
Putting /home on a different harddisk? Swakoo Linux - Newbie 9 10-27-2005 04:35 AM
Slackware is Sleepy SML Slackware 13 03-23-2004 08:04 PM
Putting monitor to sleep cothrige Linux - Newbie 3 03-10-2004 10:07 AM
Putting my computer to sleep computergirl Linux - Hardware 26 09-28-2003 09:07 AM


All times are GMT -5. The time now is 05:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration