WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TC keeps waking sleeping hard drive  (Read 1741 times)

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
TC keeps waking sleeping hard drive
« on: March 10, 2018, 03:09:25 PM »
Question: why does TC wake up a spun-down hard drive on the first instance of some programs (like Apps for instance) with all of my extensions loaded as "onboot" ?

Setup: I use TC 9.0 burned to a usb stick as my boot device only.  I keep my data on the hard drive /dev/sda/tce.  No problems.  Tc finds and uses it.

For long runs of TC, or for machines that won't function properly without a working hard drive, I'll spin the platter down:

Code: [Select]
sudo hdparm -y /dev/sda
Rather than put my ear to the case to check for activity, I'll use this to garner the status:

Code: [Select]
sudo hdparm -C /dev/sda
Fine.  I'm just wondering why when the drive has been successfully spun down, most of the utility programs won't spin up the drive, but a program like Apps will on their first run?  But things like Editor, Run, etc won't?

Interestingly enough, if the Apps program for example spins up the drive on it's first run, and I issue a successive hdparm spindown, if Apps is run again, then the drive stays spun down.  This behavior is repeatable with my own tcz's, like HTOP, etc - which were run as "onboot".  First run spins up the drive.  Second runs *after* another hdparm spindown stay spundown.

'kinda puts a damper on my hdparm spindowns, as I may inadvertently spin it up again on a program's first run.

I'm thinking that the programs are looking for config files or extra data to load - despite being designated as onboot.  Hmmm interesting.
That's a UNIX book! - cool  -- Garth

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC keeps waking sleeping hard drive
« Reply #1 on: March 10, 2018, 05:40:50 PM »
Hi PDP-8
Question: why does TC wake up a spun-down hard drive on the first instance of some programs (like Apps for instance) with all of my extensions loaded as "onboot" ?
Having extensions  onboot  only means they get  loop mounted   when you boot up. It does not load the program into RAM.
The first time you run a program it gets read from the drive and loaded into RAM. The next time you go to run it it gets read
from the systems cache (RAM) if it's still in there. If it's no longer in the cache, it gets read from the drive again. If you have
enough RAM to hold your extensions, you might want to search the forum for  copy2fs.lst  and  copy2fs.flg.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: TC keeps waking sleeping hard drive
« Reply #2 on: March 12, 2018, 05:03:22 AM »
THANK YOU!  I was getting totally confused forgetting about the system cache!

So yeah, now I just plant a flag in my tce directory as the primary toggle switch:

Code: [Select]
touch /mnt/sda1/tce/copy2fs.flg
which takes care of most.  But there is one or two that need additional help it seems, so I put them into the /mnt/sda1/tce/copy2fs.lst

TADA!  Drive stays spun-down when I issue the hdparm -y command,  (well, the Apps program seems to bring it back up regardless), so my ugly hack is to just run Apps, shut it down, and THEN apply my platter spindown script.  I'll figure that one out eventually - but ALL the other programs are loaded straight away into ram.  I went from about 67m to 80mb.  with about 1.5g to spare. :)

But best of all, the lightbulb went on - and thanks to your help, I have a MUCH better knowledge of just what a "loop mount" does and doesn't do.

Awesome - thanks Rich!
« Last Edit: March 12, 2018, 05:07:15 AM by PDP-8 »
That's a UNIX book! - cool  -- Garth

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC keeps waking sleeping hard drive
« Reply #3 on: March 12, 2018, 07:41:29 AM »
Hi PDP-8
... (well, the Apps program seems to bring it back up regardless), so my ugly hack is to just run Apps, shut it down, and THEN apply my platter spindown script.  I'll figure that one out eventually ...
If  Apps  is reading from the  tce  directory when it's started, your drive will spin up. The next time you start it, that read could
be satisfied by the systems cache. Installing any extensions will spin up the drive anyway since  Apps  will need to write to
the  tce  directory. If you are running persistent  home  or  opt  directories on that drive, accessing them could cause the
drive to spin up too.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: TC keeps waking sleeping hard drive
« Reply #4 on: March 12, 2018, 06:25:10 PM »
Yessir - it was staring at me straight in the face - Apps was pointing to the mountpoint, which of course is going to spin up. :)

I think I'm good now -  I'll just be doing a manual timed spindown after a few hours in case I walk away for a week and forget about it.

Eh, and using a mechanical device in this day an age takes me back to my most beloved computer of all time:

http://www.nf6x.net/2014/03/data-general-nova-3-and-dec-pdp-11v03-l/img_0852/

"Now THAT's a knife!" erm, hard drive!

That's a UNIX book! - cool  -- Garth