Tiny Core Linux
General TC => General TC Talk => Topic started by: PDP-8 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:
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:
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.
-
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.
-
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:
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!
-
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.
-
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!