Including hd-idle to spndown the disk(s) when inactive for a while

Ir abajo

Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Mar Feb 01, 2011 9:46 pm

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:
Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
Then it can be launched as a daemon just as:
Código:
hd-idle -a sda -i 300
(this stops only the main disk after 5 minutes being inactive). That's all what is needed at boot time.

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

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  vic1972 el Mar Feb 01, 2011 10:12 pm

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 Smile
I will also test this.
thanks





avatar
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 46
Localización : Malaga

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Mar Feb 01, 2011 11:10 pm

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.
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.

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

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Keltek el Miér Feb 02, 2011 12:08 am

Smile 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)
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 41
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Miér Feb 02, 2011 12:50 am

Keltek escribió::) Ok, please tell the SF login and I can add you to project.
Thanks. My SF login is evidal
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)
You are really fast! Thanks. I miss
Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
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"?

Best,

evr

Mensajes : 279
Fecha de inscripción : 12/10/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Keltek el Miér Feb 02, 2011 1:19 am

evr escribió:Thanks. My SF login is evidal
Done, you are now fully featured developer... Smile

evr escribió:You are really fast! Thanks. I miss
Código:
mount -o remount,rw,noatime,nodiratime /dev/sda4 /tmp/hdd/root
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ó: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"?
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..
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 &
starthddservices.sh -> http://www.fozona.cz/LG/tmp/starthddservices.sh -> copy to /usr/local/etc

Reboot and all what you have in /tmp/hdd/root/custom/etc/init.d/S* should be started after the HDD is mounted.
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 41
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Keltek el Miér Feb 02, 2011 1:12 pm

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

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 Very Happy but it can helps me a lot.
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 41
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Jue Feb 03, 2011 2:57 am

Keltek escribió:
evr escribió:Thanks. My SF login is evidal
Done, you are now fully featured developer... :) [...]
Thanks! I am quite busy this week -- I will try it on the weekend.

Best,

evr

Mensajes : 279
Fecha de inscripción : 12/10/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Jue Feb 03, 2011 3:13 am

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
[...]
Fine! I have some comments:

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
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.
How dare can it be helpful to do this kind of work under M$W ?? ;)

Best,

evr

Mensajes : 279
Fecha de inscripción : 12/10/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Keltek el Jue Feb 03, 2011 12:13 pm

evr escribió:
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
[...]
Fine! I have some comments:

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 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ó: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 occasionally didn't place anywhere Smile first attempt was in etc/init.d/hdidle but as you can see, a little daemon stole it Wink

evr escribió:
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 Very Happy but it can helps me a lot.
How dare can it be helpful to do this kind of work under M$W ?? Wink
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.
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 41
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Jue Feb 03, 2011 1:10 pm

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).
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...).
And you forgot to users with MS450H which have 2 disks.
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.
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
I occasionally didn't place anywhere :) first attempt was in etc/init.d/hdidle but as you can see, a little daemon stole it ;)
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.

evr escribió:
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.
How dare can it be helpful to do this kind of work under M$W ?? ;)
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.
Aha, I see now -- poor of you with a M$W laptop ... ;)

Best,

evr

Mensajes : 279
Fecha de inscripción : 12/10/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Dom Feb 06, 2011 3:52 pm

Keltek escribió:Done, you are now fully featured developer... :) [...]
evr escribió:Thanks! I am quite busy this week -- I will try it on the weekend.
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.

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

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Keltek el Dom Feb 06, 2011 11:22 pm

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 Smile )
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 41
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Dom Feb 06, 2011 11:56 pm

Keltek escribió:You should be now a release editor so you should be able to edit files.
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...

[...]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.
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).
The init.d script is taken from hd-idle distribution so don't want to change many lines (for my laziness :) )
O.K. I'll leave the start-stop-daemon lines commented.

Best,

evr

Mensajes : 279
Fecha de inscripción : 12/10/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Keltek el Jue Feb 10, 2011 4:43 pm

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.
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 41
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Jue Feb 10, 2011 5:37 pm

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.
How do you see these errors? dmesg? syslog? So far I have not seen any syntom of this kind of disk errors...

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

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Keltek el Jue Feb 10, 2011 6:18 pm

It is in dmesg and sent using syslogd to my remote machine. See following
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.
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 41
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Keltek el Jue Feb 10, 2011 7:50 pm

I start hd-idle by hand only with parameter "-i 300" and get this error Sad

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
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 41
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  evr el Vie Feb 11, 2011 12:39 am

Keltek escribió:It is in dmesg and sent using syslogd to my remote machine. See following
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!
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.
I start hd-idle by hand only with parameter "-i 300" and get this error[...]
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 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

Ver perfil de usuario

Volver arriba Ir abajo

Re: Including hd-idle to spndown the disk(s) when inactive for a while

Mensaje  Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Volver arriba


 
Permisos de este foro:
No puedes responder a temas en este foro.