Re: [opensuse] Re: USB disk goes to sleep, causes "device not ready" errors

2007-06-21 Thread Carlos E. R.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


The Thursday 2007-06-21 at 00:52 +0200, Joachim Schrod wrote:

> Carlos E. R. wrote:
> 
> > ...I had completely forgotten 'sdparm' :-)
> > 
> > > sdparm --command=ready /dev/sdc   # check ready state
> > > sdparm --command=start /dev/sdc   # start a sleeping disk
> > > sdparm --command=stop /dev/sdc# put a disk in standby
> > > sdparm -al -f /dev/sdc# list all known mode flags
> > > sdparm -6 -p po --clear=STANDBY /dev/sdc # turn off standby feature
> > > sdparm -6 -p po --defaults /dev/sdc   # establish it again
> > 
> > I have looked at the man page, but didn't find out more. Perhaps there is
> > another one to learn the sleep timeout.
> 
> At my disk, the sleep timeout is shown by the -alf command:
> 
> pussy:~/log # sdparm -al -f /dev/sdc
> /dev/sdc: Seagate   FreeAgentDesktop  100D
> RBC device parameters (RBC) [PS=1] mode page:
>   WCD 0  [cha: n, def:  0, sav:  0]  Write cache disable
>   LBS   512  [cha: n, def:512, sav:512]  Logical block size
>   NLBS  0x3a386030  [cha: y, def:0x3a386030, sav:0x3a386030] 
> Number of logical blocks
>   P_P 0  [cha: n, def:  0, sav:  0]  Power/performance
>   READD   0  [cha: n, def:  0, sav:  0]  Read disable
>   WRITED  0  [cha: n, def:  0, sav:  0]  Write disable
>   FORMATD 0  [cha: n, def:  0, sav:  0]  Format disable
>   LOCKD   0  [cha: n, def:  0, sav:  0]  Lock disable
> Power condition [PS=0] mode page:
>   IDLE0  [cha: n, def:  0, sav:  0]  Idle timer active
>   STANDBY 1  [cha: y, def:  1, sav:  1]  Standby timer active
>   ICT 0  [cha: n, def:  0, sav:  0]  Idle condition timer 
> (100 ms)
>   SCT   9000  [cha: y, def:9000, sav:9000]  Standby condition timer (100
> ms)
> 
> The standby timer is set to 900sec (last line).


That line doesn't show in mine. It actually complains at the end:

...
  SESS_F 63  [cha: y, def: 63, sav: 63]  Session format
  PACK_S  0  [cha: n, def:  0, sav:  0]  Packet size
 >> hereafter field position exceeds mode page length=12
  APL 0  [cha: n, def:  0, sav:  0]  Audio pause length (blocks)
nimrodel:~ # 

 
> Does "sdparm -p po -l /dev/sda" output any values on your system?
> It does only work on my USB disks; my SATA disks output

Doesn't look too good:

/dev/sda: ST360020  A 
Direct access device specific parameters: WP=0  DPOFUA=0
>> Power condition [po] mode page not supported


> > > Power condition mode page not supported
> probably the stop command wouldn't work there either. (I don't want to stop
> one of them, they're in use. :-))


I have no sata, but in the past I did the experiment on pata: I could hear 
the motors spinning down, and after a few seconds they spinned up again, 
with perhaps a complaint from the kernel. Let me see, my hdb is not in use 
right now...


nimrodel:~ #

[...]

Crash!


I had a system crash just at that point, this is what I recovered of my 
email that served as notebook. What did I do?

Well, I checked my /dev/hdb status via hdparm -C, which was "active/idle", 
then sent it to sleep (-y and or -Y), which it did, checked the status 
again, and now I'm not sure if it answered fast or took some time. A 
second time took a minute to answer. I think it said standby. I should 
have written it down on paper.

However, the problem was that /dev/hda, where my home is (but not the 
system) stopped responding:

Jun 21 01:59:54 nimrodel kernel: hdb: drive_cmd: status=0x51 { DriveReady 
SeekComplete Error }
Jun 21 01:59:54 nimrodel kernel: hdb: drive_cmd: error=0x04 { DriveStatusError }
Jun 21 01:59:54 nimrodel kernel: ide: failed opcode was: 0xe0
Jun 21 01:59:55 nimrodel kernel: hdb: drive_cmd: status=0x51 { DriveReady 
SeekComplete Error }
Jun 21 01:59:55 nimrodel kernel: hdb: drive_cmd: error=0x04 { DriveStatusError }
Jun 21 01:59:55 nimrodel kernel: ide: failed opcode was: 0x94
Jun 21 02:00:02 nimrodel kernel: hdb: drive_cmd: status=0x51 { DriveReady 
SeekComplete Error }
Jun 21 02:00:02 nimrodel kernel: hdb: drive_cmd: error=0x04 { DriveStatusError }
Jun 21 02:00:02 nimrodel kernel: ide: failed opcode was: 0xe0
Jun 21 02:00:02 nimrodel kernel: hdb: drive_cmd: status=0x51 { DriveReady 
SeekComplete Error }
Jun 21 02:00:02 nimrodel kernel: hdb: drive_cmd: error=0x04 { DriveStatusError }
Jun 21 02:00:02 nimrodel kernel: ide: failed opcode was: 0x94
Jun 21 02:00:17 nimrodel kernel: hdb: irq timeout: status=0xd0 { Busy }
Jun 21 02:00:17 nimrodel kernel: ide: failed opcode was: 0xe5
Jun 21 02:00:27 nimrodel kernel: hda: lost interrupt
Jun 21 02:00:47 nimrodel kernel: hda: dma_timer_expiry: dma status == 0x60
Jun 21 02:00:47 nimrodel kernel: hda: DMA timeout retry
Jun 21 02:00:47 nimrodel kernel: hda: timeout waiting for DMA
Jun 21 02:01:17 nimrodel kernel: hda: lost interrupt
Jun 21 02:01:47 nimrodel kernel: hda: lost interrupt
Jun 21 02:02:17 nimrodel kernel: hda: lost interrupt
Jun 21 02:

[opensuse] Re: USB disk goes to sleep, causes "device not ready" errors

2007-06-20 Thread Joachim Schrod

Carlos E. R. wrote:


...I had completely forgotten 'sdparm' :-)


sdparm --command=ready /dev/sdc # check ready state
sdparm --command=start /dev/sdc # start a sleeping disk
sdparm --command=stop /dev/sdc  # put a disk in standby
sdparm -al -f /dev/sdc  # list all known mode flags
sdparm -6 -p po --clear=STANDBY /dev/sdc # turn off standby feature
sdparm -6 -p po --defaults /dev/sdc # establish it again


I have looked at the man page, but didn't find out more. Perhaps there is 
another one to learn the sleep timeout.


At my disk, the sleep timeout is shown by the -alf command:

pussy:~/log # sdparm -al -f /dev/sdc
/dev/sdc: Seagate   FreeAgentDesktop  100D
RBC device parameters (RBC) [PS=1] mode page:
  WCD 0  [cha: n, def:  0, sav:  0]  Write cache disable
  LBS   512  [cha: n, def:512, sav:512]  Logical block size
  NLBS  0x3a386030  [cha: y, def:0x3a386030, sav:0x3a386030] 
Number of logical blocks

  P_P 0  [cha: n, def:  0, sav:  0]  Power/performance
  READD   0  [cha: n, def:  0, sav:  0]  Read disable
  WRITED  0  [cha: n, def:  0, sav:  0]  Write disable
  FORMATD 0  [cha: n, def:  0, sav:  0]  Format disable
  LOCKD   0  [cha: n, def:  0, sav:  0]  Lock disable
Power condition [PS=0] mode page:
  IDLE0  [cha: n, def:  0, sav:  0]  Idle timer active
  STANDBY 1  [cha: y, def:  1, sav:  1]  Standby timer active
  ICT 0  [cha: n, def:  0, sav:  0]  Idle condition timer 
(100 ms)
  SCT   9000  [cha: y, def:9000, sav:9000]  Standby condition 
timer (100 ms)


The standby timer is set to 900sec (last line).

Does "sdparm -p po -l /dev/sda" output any values on your system?
It does only work on my USB disks; my SATA disks output
>> Power condition mode page not supported
probably the stop command wouldn't work there either. (I don't want 
to stop one of them, they're in use. :-))


Joachim

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod  Email: [EMAIL PROTECTED]
Roedermark, Germany

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Re: USB disk goes to sleep, causes "device not ready" errors

2007-06-20 Thread Carlos E. R.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


The Wednesday 2007-06-20 at 15:48 +0200, Joachim Schrod wrote:

> > Now, external drives... that's interesting. I would report the problem to
> > bugzilla, the kernel should survive a disk sleep.
> 
> I'll think about that -- have to judge the entry writing effort with the
> anticipated results of a 10.0 kernel error report.

Ah, 10.0... you are right, it should be reported against a 10.2 system at 
least.


> But anyhow, you helped me further a lot:

And you me, because...

> > nimrodel:~ # hdparm -C /dev/sdb
> > 
> > /dev/sdb:
> >  drive state is:  unknown
> 
> This did not work here either, but I got reminded that there is sdparm to
> check and change the SCSI disk parameters. And voila, here we are:

...I had completely forgotten 'sdparm' :-)


> sdparm --command=ready /dev/sdc   # check ready state
> sdparm --command=start /dev/sdc   # start a sleeping disk
> sdparm --command=stop /dev/sdc# put a disk in standby
> sdparm -al -f /dev/sdc# list all known mode flags
> sdparm -6 -p po --clear=STANDBY /dev/sdc # turn off standby feature
> sdparm -6 -p po --defaults /dev/sdc   # establish it again


I have looked at the man page, but didn't find out more. Perhaps there is 
another one to learn the sleep timeout. Anyway, the sequence doesn't seem 
to work on mine:

nimrodel:~ # sdparm --command=stop /dev/sda
/dev/sda: ST360020  A 
nimrodel:~ # sdparm --command=ready /dev/sda
/dev/sda: ST360020  A 
Ready


It is not stopped, even with the device umounted.


> Now I just need to observe if the disk gets too hot after I turned off the
> standby feature. Sadly, smartctl doesn't work for that disk, so I have no
> reliable method of checking its temperature.

No, smartctl doesn't work because the chipset of the usb boxes do not 
support the necessary commands; at least that's what I read somewhere.


> But that's a minor inconvenience compared to the state before.
> Muchas gracias!

De nada :-)

- -- 
Cheers,
   Carlos E. R.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFGeaQitTMYHG2NR9URArxnAJ9M2tklxPPGBHaHsINSBm8wsL9d4gCfQ3u8
S+D+chBsbJfRxCNEkNnwjl4=
=rKu2
-END PGP SIGNATURE-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[opensuse] Re: USB disk goes to sleep, causes "device not ready" errors

2007-06-20 Thread Joachim Schrod

Carlos E. R. wrote:

The Tuesday 2007-06-19 at 16:17 +0200, Joachim Schrod wrote:


I bought an external USB disk, Seagate FreeAgent, [...]
After some time, the disk puts itself in some "sleep" mode.


All hardddisks made have that feature: after some minutes (15') without 
any activity, they spin down. The time is configurable, and can be 
activated/dissabled.


Now, external drives... that's interesting. I would report the problem to 
bugzilla, the kernel should survive a disk sleep.


I'll think about that -- have to judge the entry writing effort 
with the anticipated results of a 10.0 kernel error report.


But anyhow, you helped me further a lot:

In fact, I have reproduced your problem in my system (or a related 
problem):

The command to enable/disable the sleep mode is hdparm:

nimrodel:~ # hdparm -C /dev/sdb

/dev/sdb:
 drive state is:  unknown


This did not work here either, but I got reminded that there is 
sdparm to check and change the SCSI disk parameters. And voila, 
here we are:


sdparm --command=ready /dev/sdc # check ready state
sdparm --command=start /dev/sdc # start a sleeping disk
sdparm --command=stop /dev/sdc  # put a disk in standby
sdparm -al -f /dev/sdc  # list all known mode flags
sdparm -6 -p po --clear=STANDBY /dev/sdc # turn off standby feature
sdparm -6 -p po --defaults /dev/sdc # establish it again

Now I just need to observe if the disk gets too hot after I turned 
off the standby feature. Sadly, smartctl doesn't work for that 
disk, so I have no reliable method of checking its temperature.


But that's a minor inconvenience compared to the state before.
Muchas gracias!

Joachim

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod  Email: [EMAIL PROTECTED]
Roedermark, Germany

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]