Including hd-idle to spndown the disk(s) when inactive for a while
3 participantes
Página 1 de 1.
Including hd-idle to spndown the disk(s) when inactive for a while
Keltek (and Vic),
From your recent messages in this thread and this one too, it looks like you are planning a new release soon. If this is the case, I'd like to see hd-idle included. It is for stopping the hard disk(s) when it(they) is(are) inactive for a while (see here). I have it successfully running for several weeks, but for sure it would be wise to be tested by more people (should I ask in the "Testers" sub forum?).
The (quite small) source file can be downloaded from http://www.sf.net/projects/hd-idle and it compiles out of the box for mipsel, resulting in a static stripped binary of 132224 bytes (or much smaller if it is dynamically linked to shared libs). It makes very small footprint: just 80KB VmRSS -- and 168 VM all told.
To allow it to properly work, the sda4 main disk partition must be mounted with the noatime flag:
Waiting for comments,
Best,
From your recent messages in this thread and this one too, it looks like you are planning a new release soon. If this is the case, I'd like to see hd-idle included. It is for stopping the hard disk(s) when it(they) is(are) inactive for a while (see here). I have it successfully running for several weeks, but for sure it would be wise to be tested by more people (should I ask in the "Testers" sub forum?).
The (quite small) source file can be downloaded from http://www.sf.net/projects/hd-idle and it compiles out of the box for mipsel, resulting in a static stripped binary of 132224 bytes (or much smaller if it is dynamically linked to shared libs). It makes very small footprint: just 80KB VmRSS -- and 168 VM all told.
To allow it to properly work, the sda4 main disk partition must be mounted with the noatime flag:
- Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
- Código:
hd-idle -a sda -i 300
Waiting for comments,
Best,
Última edición por evr el Mar Feb 01, 2011 9:59 pm, editado 1 vez (Razón : typos)
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Very good!!!
Well done.
Yes, from my opinion we can include this utility, even more if has been tested.
Yes, open a thread in the testers forum, so volunteers can test
I will also test this.
thanks
Well done.
Yes, from my opinion we can include this utility, even more if has been tested.
Yes, open a thread in the testers forum, so volunteers can test
I will also test this.
thanks
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: Including hd-idle to spndown the disk(s) when inactive for a while
I think I will need some web place to make the mipsel hd-idle available... I see you use http://dl.dropbox.com and Keltek http://www.fozona.cz, but I think it would be good to implement a more structured and centralized approach (ideally at SourceForge, as I see it). As I've said before, I can help in the work involved (I would need some access rights to the SF site)... Maybe we could start with this hd-idle.vic1972 escribió:[...]Yes, from my opinion we can include this utility, even more if has been tested.
Yes, open a thread in the testers forum, so volunteers can test :) I will also test this.
Best,
Última edición por evr el Mar Feb 01, 2011 11:11 pm, editado 1 vez (Razón : typos)
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Ok, please tell the SF login and I can add you to project.
Meanwhile get the hdidle as service here svc_hd-idle.tar.gz.
Install to custom directory and control using LG Menu. (sorry about the missing description in php)
Meanwhile get the hdidle as service here svc_hd-idle.tar.gz.
Install to custom directory and control using LG Menu. (sorry about the missing description in php)
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Thanks. My SF login is evidalKeltek escribió::) Ok, please tell the SF login and I can add you to project.
You are really fast! Thanks. I missMeanwhile get the hdidle as service here svc_hd-idle.tar.gz. Install to custom directory and control using LG Menu. (sorry about the missing description in php)
- Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
On the other hand, as you know, I am not running Custom firmware (still for two or three more weeks). Where is exactly the "custom directory"?
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Done, you are now fully featured developer...evr escribió:Thanks. My SF login is evidal
Because this is as service using our interface in Harmony it is activated while you start the service (using init script in etc/init.d). This should be in /usr/local/etc/starthddservices.sh because the disk must be mounted (which is not till the dvdplayer is started).evr escribió:You are really fast! Thanks. I miss
- Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
Yes, I know, sorry. I built on the foundations we prepare for Harmony and this service package use it. So we can still use it without all the stuff like PHP etc..evr escribió:O.K. I agree that this rc script is not the best place for this remount; but it has to be done somewhere because otherwise the (main) disk never becomes idle long enough for hd-idle to stop it.
On the other hand, as you know, I am not running Custom firmware (still for two or three more weeks). Where is exactly the "custom directory"?
Make /tmp/hdd/root/custom directory, unpack this package into it and then you must get the starthddservices.sh and modify /usr/local/etc/rcS to invoke it:
at the end of rcS
- Código:
# Start all services
/usr/local/etc/starthddservices.sh &
Reboot and all what you have in /tmp/hdd/root/custom/etc/init.d/S* should be started after the HDD is mounted.
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Now running on my setup and seems to works.
Now it is as MS Harmony service. We can install it as separate binary. It is depending only on libgcc_s.so which can be installed separately (in custom/lib).
NOTE: the binary is compiled using new toolchain compiled under Windows (using CygWin) - I can tell you it was very painful work to make it but it can helps me a lot.
- Código:
root@Venus:~# cat /tmp/hd-idle.log
date: 2011-02-02, time: 09:27:22, disk: sda, running: 16776, stopped: 27461
date: 2011-02-02, time: 10:02:54, disk: sda, running: 331, stopped: 1801
Now it is as MS Harmony service. We can install it as separate binary. It is depending only on libgcc_s.so which can be installed separately (in custom/lib).
NOTE: the binary is compiled using new toolchain compiled under Windows (using CygWin) - I can tell you it was very painful work to make it but it can helps me a lot.
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Thanks! I am quite busy this week -- I will try it on the weekend.Keltek escribió:Done, you are now fully featured developer... :) [...]evr escribió:Thanks. My SF login is evidal
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Fine! I have some comments:Keltek escribió:Now running on my setup and seems to works.[...]
- Código:
root@Venus:~# cat /tmp/hd-idle.log
date: 2011-02-02, time: 09:27:22, disk: sda, running: 16776, stopped: 27461
date: 2011-02-02, time: 10:02:54, disk: sda, running: 331, stopped: 1801
1) According to the README (and the source code) of hd-idle, the log option may cause malfunctioning when hd-idle is working with more than one disk. So I think the invocation in your service script is not good: either the log option has to be removed, or the service should be activated only for one (the main) disk (-a sda). I am in favor of the later (we can could offer other possibilities via the web menu in a later release).
2) I have not understood where have you placed the remount command:
- Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
How dare can it be helpful to do this kind of work under M$W ?? ;)NOTE: the binary is compiled using new toolchain compiled under Windows (using CygWin) - I can tell you it was very painful work to make it :D but it can helps me a lot.
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
I read it. It is because of spinuping of disk while other creates an event, but I create the log file in /tmp which is ram-disk and use it to check if the hd-idle works. And sure, I have only one disk (if you don't count the MTD but I think the hd-idle is so clever to don't use other disks than IDE/SATA/SCSI). And you forgot to users with MS450H which have 2 disks.evr escribió:Fine! I have some comments:Keltek escribió:Now running on my setup and seems to works.[...]
- Código:
root@Venus:~# cat /tmp/hd-idle.log
date: 2011-02-02, time: 09:27:22, disk: sda, running: 16776, stopped: 27461
date: 2011-02-02, time: 10:02:54, disk: sda, running: 331, stopped: 1801
1) According to the README (and the source code) of hd-idle, the log option may cause malfunctioning when hd-idle is working with more than one disk. So I think the invocation in your service script is not good: either the log option has to be removed, or the service should be activated only for one (the main) disk (-a sda). I am in favor of the later (we can could offer other possibilities via the web menu in a later release).
I occasionally didn't place anywhere first attempt was in etc/init.d/hdidle but as you can see, a little daemon stole itevr escribió:2) I have not understood where have you placed the remount command:
- Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
I'm using my work notebook with Win and If want to quickly compile something (like the new version of PM) and test it, I not need to start my desktop Linux.evr escribió:How dare can it be helpful to do this kind of work under M$W ??NOTE: the binary is compiled using new toolchain compiled under Windows (using CygWin) - I can tell you it was very painful work to make it but it can helps me a lot.
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Right. I diden't pay attention to your choice of the log file in flash... This is then perfect (well, almost -- we need to erase the log file from time to time...).Keltek escribió:[...]I read it. It is because of spinuping of disk while other creates an event, but I create the log file in /tmp which is ram-disk and use it to check if the hd-idle works. And sure, I have only one disk (if you don't count the MTD but I think the hd-idle is so clever to don't use other disks than IDE/SATA/SCSI).
Not only that; many users have an external USB hard drive more or less permanently attached to the LG. These disks can also be stopped by hd-idle. I just aimed to leave these less common situations to future releases.And you forgot to users with MS450H which have 2 disks.
A clean solution should provide for remounting sda4 without the noatime flags when hd-idle is not working... So it is a bit tricky... As a first solution both remounts can be coded into the start and stop parts of the service script.I occasionally didn't place anywhere :) first attempt was in etc/init.d/hdidle but as you can see, a little daemon stole it ;)evr escribió:2) I have not understood where have you placed the remount command:
- Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
Aha, I see now -- poor of you with a M$W laptop ... ;)I'm using my work notebook with Win and If want to quickly compile something (like the new version of PM) and test it, I not need to start my desktop Linux.evr escribió:How dare can it be helpful to do this kind of work under M$W ?? ;)NOTE: the binary is compiled using new toolchain compiled under Windows (using CygWin) - I can tell you it was very painful work to make it :D but it can helps me a lot.
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Keltek escribió:Done, you are now fully featured developer... :) [...]
I have tried today. In my SF profile, I read: "My projects: [...] LG MediaCenter Menu ... Develop". I have done a test svn commit to PipeManagement code and it did work. However, I can not do anything with the hd-idle service pack "svc_hdidle.tar.gz", because it is not in SVN and it can not be changed without admin permissions.evr escribió:Thanks! I am quite busy this week -- I will try it on the weekend.
On the other hand, I have tried to browse the SVN in the SF lgmenu web site, and it does not work. I have also tried to ssh connect to the SF shell server (I used to do it regularly some years ago) and it does not seem to work either. I've checked the SF "Site Status" info and no problems are reported for several days... Can you please let me know if these things are expected to work nowadays? Thanks in advance.
I wanted to add the remount commands before asking the testers to install and test hd-idle. Also, to work with official firmware I have had to change the start-sto-daemon lines with direct invoke & kill commands, because official busybox does not carry start-stop-daemon (for testing, I think it is better to avoid as many dependencies as possible).
Waiting for comments,
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
You should be now a release editor so you should be able to edit files.
These files are not in SVN. I think the remount command must be little tweaked coz we have different configurations with different disks (sda as internal, sdb as external). I think the remount should be for all "/dev/scsi/host*/bus0/target0/lun0/part*" and not only for one partition.
The init.d script is taken from hd-idle distribution so don't want to change many lines (for my laziness )
These files are not in SVN. I think the remount command must be little tweaked coz we have different configurations with different disks (sda as internal, sdb as external). I think the remount should be for all "/dev/scsi/host*/bus0/target0/lun0/part*" and not only for one partition.
The init.d script is taken from hd-idle distribution so don't want to change many lines (for my laziness )
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Thanks! I've just tried and it does work. I don't have time now; I'll change the hd-idle service package another day. SVN Browse continues failing, however...Keltek escribió:You should be now a release editor so you should be able to edit files.
Agree, but something has to be included for initial testing. I have verified that the other main disk partitions do not need to be remounted and probably the same is true for the secondary disk and for the USB-mounted disks -- but this has to be tested (by some one who at least has a secondary disk).[...]I think the remount command must be little tweaked coz we have different configurations with different disks (sda as internal, sdb as external). I think the remount should be for all "/dev/scsi/host*/bus0/target0/lun0/part*" and not only for one partition.
O.K. I'll leave the start-stop-daemon lines commented.The init.d script is taken from hd-idle distribution so don't want to change many lines (for my laziness :) )
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
I found the problem with SCSI errors is related to hd-idle. If hd-idle enabled, I got this errors in couple of minutes. Without it these errors doesn't seem to appear.
Re: Including hd-idle to spndown the disk(s) when inactive for a while
How do you see these errors? dmesg? syslog? So far I have not seen any syntom of this kind of disk errors...Keltek escribió:I found the problem with SCSI errors is related to hd-idle. If hd-idle enabled, I got this errors in couple of minutes. Without it these errors doesn't seem to appear.
Depending on the -i setting, [hd-idle may start/stop the disk often. If a disk is approaching a marginal malfunctioning point, frequent start/stop might accelerate the process...
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: Including hd-idle to spndown the disk(s) when inactive for a while
It is in dmesg and sent using syslogd to my remote machine. See following
It doesn't broke only the ext3 fs. The whole disk is in "unstable" state - file entries disappear, directories disappear. After reboot all works good.
- Código:
Feb 9 21:04:35 192.168.1.12 kernel: ext3_abort called.
Feb 9 21:04:35 192.168.1.12 kernel: EXT3-fs error (device sda4): ext3_remount: Abort forced by user
Feb 9 21:04:35 192.168.1.12 kernel: umount: /dev/scsi/host1/bus0/target0/lun0/part4 busy - remounted read-only
Feb 9 21:04:35 192.168.1.12 kernel: SCSI error : <1 0 0 0> return code = 0x40000
Feb 9 21:04:35 192.168.1.12 kernel: end_request: I/O error, dev sda, sector 2896022577
Feb 9 21:04:35 192.168.1.12 kernel: Buffer I/O error on device sda3, logical block 273
Feb 9 21:04:35 192.168.1.12 kernel: lost page write due to I/O error on sda3
Feb 9 21:04:35 192.168.1.12 kernel: SCSI error : <1 0 0 0> return code = 0x40000
Feb 9 21:04:35 192.168.1.12 kernel: end_request: I/O error, dev sda, sector 16097
Feb 9 21:04:35 192.168.1.12 kernel: Buffer I/O error on device sda1, logical block 4
Feb 9 21:04:35 192.168.1.12 kernel: lost page write due to I/O error on sda1
Feb 9 21:04:35 192.168.1.12 kernel: SCSI error : <1 0 0 0> return code = 0x40000
Feb 9 21:04:35 192.168.1.12 kernel: end_request: I/O error, dev sda, sector 1447858121
Feb 9 21:04:35 192.168.1.12 kernel: Buffer I/O error on device sda1, logical block 180980257
Feb 9 21:04:35 192.168.1.12 kernel: lost page write due to I/O error on sda1
Feb 9 21:04:35 192.168.1.12 kernel: umount: can't remount /dev/rd/0 read-only
Feb 9 21:04:35 192.168.1.12 kernel: umount: can't remount none read-only
Feb 9 21:04:35 192.168.1.12 kernel: umount: /dev/mtdblock/2 busy - remounted read-only
Feb 9 21:04:35 192.168.1.12 kernel: umount: devpts busy - remounted read-only
Feb 9 21:04:35 192.168.1.12 init: starting pid 639, tty '': 'swapoff -a'
Feb 9 21:04:35 192.168.1.12 kernel: umount: none busy - remounted read-only
Feb 9 21:04:35 192.168.1.12 init: The system is going down NOW!
It doesn't broke only the ext3 fs. The whole disk is in "unstable" state - file entries disappear, directories disappear. After reboot all works good.
Re: Including hd-idle to spndown the disk(s) when inactive for a while
I start hd-idle by hand only with parameter "-i 300" and get this error
- Código:
sata2: command 0x35 timeout, stat 0xd0 host_stat 0x0
sata2: SCR0=0x00000000
sata2: SCR1=0x00000000
sata2: status=0xd0 { Busy }
SCSI error : <1 0 0 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 2929638621
Buffer I/O error on device sda4, logical block 4578
lost page write due to I/O error on sda4
sata2: mars_dma_eh_task!
sata2: DMA timeout; reset DMA block 1 time!
port2 dev1 disconnect
sata2 break waiting 1
.<4>sata2: device off line!
sata2: device deaded. tune off function.
Aborting journal on device sda4.
__journal_remove_journal_head: freeing b_committed_data
ext3_abort called.
EXT3-fs error (device sda4): ext3_journal_start_sb: Detected aborted journal<4>__journal_remove_journal_head: freeing b_frozen_data
__journal_remove_journal_head: freeing b_frozen_data
Remounting filesystem read-only
Re: Including hd-idle to spndown the disk(s) when inactive for a while
Keltek escribió:It is in dmesg and sent using syslogd to my remote machine. See followingIt doesn't broke only the ext3 fs. The whole disk is in "unstable" state - file entries disappear, directories disappear. After reboot all works good.
- Código:
Feb 9 21:04:35 192.168.1.12 kernel: ext3_abort called.
Feb 9 21:04:35 192.168.1.12 kernel: EXT3-fs error (device sda4): ext3_remount: Abort forced by user
Feb 9 21:04:35 192.168.1.12 kernel: umount: /dev/scsi/host1/bus0/target0/lun0/part4 busy - remounted read-only
Feb 9 21:04:35 192.168.1.12 kernel: SCSI error : <1 0 0 0> return code = 0x40000
[...]
Feb 9 21:04:35 192.168.1.12 init: starting pid 639, tty '': 'swapoff -a'
Feb 9 21:04:35 192.168.1.12 kernel: umount: none busy - remounted read-only
Feb 9 21:04:35 192.168.1.12 init: The system is going down NOW!
But I seem to remember that you already reported this kind of errors some time ago, well before start using hd-idle ... here concretely!. So this does not appear to have anything to do with hd-idle, right?I start hd-idle by hand only with parameter "-i 300" and get this error[...]
I have activated klogd and syslogd -R ... and after several hours using the LG (with hd-idle running), the only log messages I get are those about HDMI lack of communication...
Looks like you have some problem with your hardware (hopefully only your disk...).
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.