LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-05-2017, 11:05 PM   #1
hedron
Member
 
Registered: Jul 2009
Location: NYC
Distribution: Slackware, Bluewhite
Posts: 235

Rep: Reputation: 23
Hard drives sleep too often


I have a few hard drives run by a linux partition opened by WM Ware as samba share in Windows. I hope that makes sense to you guys.

But the hard drives are always in sleep mode everytime I turn on the computer(I always hibernate) and this leads to programs that depend on them to lock up.

I'm wondering is how I would go about keep them out of sleep mode in a cron script or something. I've looked at hdparm, but it doesn't seem to do what I want to do, and I'd prefer something higher level anyway.
 
Old 04-06-2017, 12:38 AM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 2,560

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
How do you expect the hard drives on a hibernating computer to operate?

You've written the operating system image to disk and turned off the power to the machine.

I'm missing something about your scenario; please go into more detail about what you expect to happen when you "turn on the computer".
 
Old 04-06-2017, 08:28 AM   #3
askfor
Member
 
Registered: Aug 2016
Posts: 59

Rep: Reputation: 37
It is really strange. If I understood it right, you have SMB server running inside virtual Linux OS installation. OS in the virtual machine is not supposed to have access to physical disk device, but rather to virtual one. It shouldn't be able to manage sleep and wake-up policies at all.

It is difficult to say, but I think you have some problem with settings in the primary OS. My advice is to start by verifying disk policies in primary OS. After that proceed with settings in the VM manager program. I have been using KVM and VirtualBox, but have no VMware experience.
 
Old 04-06-2017, 11:47 AM   #4
riwi
Member
 
Registered: Jul 2011
Location: Netherlands
Distribution: Slackware64 14.2
Posts: 57

Rep: Reputation: Disabled
Quote:
Originally Posted by hedron View Post
I have a few hard drives run by a linux partition opened by WM Ware as samba share in Windows. I hope that makes sense to you guys.

But the hard drives are always in sleep mode everytime I turn on the computer(I always hibernate) and this leads to programs that depend on them to lock up.

I'm wondering is how I would go about keep them out of sleep mode in a cron script or something. I've looked at hdparm, but it doesn't seem to do what I want to do, and I'd prefer something higher level anyway.
I use hdparm to set the desired timeout for spindown on my nas PC drives.

#! /usr/bin/bash
workdir="$( cd "$( dirname "$0" )" && pwd )"
disklist=`ls /dev/sd* | egrep "/dev/sd[a-z]+$"`
echo $disklist
for disk in $disklist
do
# hdparm -S0 $disk #> /dev/null &
hdparm -S242 $disk #> /dev/null &
# hdparm -S 241 $disk #> /dev/null &
done

S0 means no spindown
S241 meand 'after 30 minutes"
S242 means "after one hour"

Check the hdparm manpage.
Hope this helps. I am not sure it does in your virtualized environment.
 
3 members found this post helpful.
Old 04-06-2017, 03:56 PM   #5
hedron
Member
 
Registered: Jul 2009
Location: NYC
Distribution: Slackware, Bluewhite
Posts: 235

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by Richard Cranium View Post
How do you expect the hard drives on a hibernating computer to operate?
I don't. (The hard drives are physical as is the partition Slackware is installed on. Sorry, if I didn't make that 100% clear. I can boot it up if I so want and use it like a normal Slack install, as opposed to a virtualized environment.) I expect them to spin up when I turn on the computer, but there seems to be something that doesn't tell VM Ware that it's turned back on. So, I'd need something within the Slackware install to keep the drives running all the time, since as far as Slackware knows the PC is on forever.

I'm guessing that the PC turns them off after finishing the hibernate command and shutting down the PC. When I turn it back on, it simply passes on to Windows which naturally does nothing to notify VM Ware to spin up the hard drives.

I'll give hdparm another go. Thanks for the script.
 
Old 04-19-2017, 01:27 AM   #6
rob.rice
Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 998

Rep: Reputation: 159Reputation: 159
Quote:
Originally Posted by hedron View Post
I have a few hard drives run by a linux partition opened by WM Ware as samba share in Windows. I hope that makes sense to you guys.

But the hard drives are always in sleep mode everytime I turn on the computer(I always hibernate) and this leads to programs that depend on them to lock up.

I'm wondering is how I would go about keep them out of sleep mode in a cron script or something. I've looked at hdparm, but it doesn't seem to do what I want to do, and I'd prefer something higher level anyway.
hdparm can brick your hard drive leave it alone

are you in hibernate or suspend

suspend the state of the computer goes in to memory every thing BUT the memory powers down
on resume the state of the computer is reloaded from memory and the computer picks up from where it left off

hibernate saves the state of the computer and the memory is saved to disk and turns every thing off
coming back from hibernate reloads the kernel then when the kernel sees the signature from hibernate it reloads the state of the computer including the contents of ram the computer picks up where it left off

if it's suspend a driver may need to be reloaded like the firmware for a video card

Last edited by rob.rice; 04-19-2017 at 01:32 AM.
 
Old 04-20-2017, 06:52 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,682
Blog Entries: 27

Rep: Reputation: 2018Reputation: 2018Reputation: 2018Reputation: 2018Reputation: 2018Reputation: 2018Reputation: 2018Reputation: 2018Reputation: 2018Reputation: 2018Reputation: 2018
Member response

Hi,
Quote:
Originally Posted by rob.rice View Post
hdparm can brick your hard drive leave it alone <snip>
Care to elaborate on that statement?

Everyone should read the 'man hdparm' to understand proper options and usage.

I have used 'hdparm' many times and my drives are still functional.

Have fun & enjoy!
 
1 members found this post helpful.
  


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
tape drives vs hard drives(long term data retention) wstewart90 Linux - Enterprise 12 05-26-2015 03:48 PM
Possible bug somewhere down the line when it comes to the sleep state of usb drives. darkstarbyte Linux - Software 1 12-04-2012 04:52 PM
SCSI drives fail to spin up properly after going to sleep ABruines Linux - General 4 08-07-2012 08:27 PM
Script to put hard drives to sleep when no IO hamstar Programming 5 12-18-2007 10:23 PM
Making SATA drives go to sleep Basher52 Fedora 3 07-15-2005 09:14 AM


All times are GMT -5. The time now is 09:34 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration