Re: [Hampshire] powering off USB external HDDs - apparently no solution

2008-10-28 Thread Alex Phillips
Edward Beckmann wrote:
> Hi
>
> Probably the last posting on this one - loads of searching reveals a heap of
> unsuccessful tries.  Commonly held view is that it can't be done, so if
> anyone does have the power off secret they will please loads of Linux users
> and we will need to share the answer widely (or use it for fundraising by
> posting it on an MS pay-for-an-answer forum).
>
> Ed
>
>   
Dear Ed,

   What options does sdparm offer you ?

sdparm -all /dev/sda on my slug offers me, amongst others:-

  IDLE0  [cha: n, def:  0, sav:  0]  Idle timer active
  STANDBY 0  [cha: n, def:  0, sav:  0]  Standby timer active
  ICT   272564736  [cha: y, def:272564736, sav:272564736]  Idle 
condition timer (100 ms)
  SCT   1073676288  [cha: y, def:1073676288, sav:1073676288]  
Standby condition timer (100 ms)


This will at least stop the drive spinning, even if it won´t power 
off the usb>IDE controller card.

HTH,

Alex.



-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] powering off USB external HDDs

2008-10-28 Thread Bob Dunlop
Hi,

On Tue, Oct 28 at 12:39, Edward Beckmann wrote:
> Thanks for the replies so far - one problem, the externals I am thinking of
> have no power supply or separate switch - I need to turn off the power from
> the USB port they are plugged into (and where they get their power from).  I
> am trying to avoid lots of plugging and unplugging the USB lead.

How happy are you with the C compiler ?

I don't know of an off the shelf utility for this but I've had some
success with the hub-ctl program from NIIBE Yutaka[1].

Actually compilation of the single source file is simple enough.

$ cc -o hub-ctrl hub-ctrl.c -lusb

Assuming you have libusb installed (on gentoo it's "emerge libusb").


Then it's simply "hub-ctrl -b 1 -d 2 -P 3 -p 0" to turn power off, and
"hub-ctrl -b 1 -d 2 -P 3 -p 1" to turn it back on.

In my example 1 is the bus the *hub* is attached to, and 2 is the device
number of the *hub*, 3 is the port on the hub that you wish to control.

Determining the port number is either a case of checking the hub circuit
diagram or trial and error.  Hub port numbers never follow a logical
layout or the numbering on the case.  ie and 8 port unit I know has the
ports left to right in the following order 1 2 3 4 7 8 6 5.


Add the hub-ctrl commands to a script that mounts/unmounts the drive as
you require.


[1] http://marc.info/?l=linux-usb-devel&m=113724451205634&w=2
-- 
Bob Dunlop

-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] powering off USB external HDDs

2008-10-28 Thread Chris Dennis
Edward Beckmann wrote:
> Hi
> 
> Thanks for the replies so far - one problem, the externals I am thinking 
> of have no power supply or separate switch - I need to turn off the 
> power from the USB port they are plugged into (and where they get their 
> power from).  I am trying to avoid lots of plugging and unplugging the 
> USB lead.
> 
> Apologies for not making this clear from the outset.
> 
> Thanks
> 
> Ed
> 

Hello Ed

I suspect the answer is 'no'.  I've never come across a way of turning 
off the power to a USB port in any OS.  How about a switched USB hub? 
This for example: http://usb.brando.com.hk/prod_detail.php?prod_id=00394 
(just the first thing I found by Googling 'usb hub individually switched'.

On the other hand, some external hard drives power themselves down when 
idle (and some of those won't wake up again when Linux wants them to...).

cheers

Chris
-- 
Chris Dennis  [EMAIL PROTECTED]
Fordingbridge, Hampshire, UK

-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] powering off USB external HDDs - apparently no solution

2008-10-28 Thread Edward Beckmann
Hi

Probably the last posting on this one - loads of searching reveals a heap of
unsuccessful tries.  Commonly held view is that it can't be done, so if
anyone does have the power off secret they will please loads of Linux users
and we will need to share the answer widely (or use it for fundraising by
posting it on an MS pay-for-an-answer forum).

Ed
-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] powering off USB external HDDs

2008-10-28 Thread Edward Beckmann
Hi

Thanks for the replies so far - one problem, the externals I am thinking of
have no power supply or separate switch - I need to turn off the power from
the USB port they are plugged into (and where they get their power from).  I
am trying to avoid lots of plugging and unplugging the USB lead.

Apologies for not making this clear from the outset.

Thanks

Ed
-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] powering off USB external HDDs

2008-10-28 Thread Brad Rogers
On Tue, 28 Oct 2008 09:11:31 +
"Edward Beckmann" <[EMAIL PROTECTED]> wrote:

Hello Edward,

> If I use one of the USB-powered external HDDs now quite common, can I
> power them down without unplugging them?  I want to use one for

Yes, you can.  If you right click on the desktop icon (assuming you have
your DE set to show an icon for it) there's usually a "safely remove"
option.  Select that if you want to be totally sure about things.  Then
power down.

-- 
 Regards  _
 / )   "The blindingly obvious is
/ _)radnever immediately apparent"

It's becoming an obsession
Teenage Depression - Eddie & The Hot Rods


signature.asc
Description: PGP signature
-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] powering off USB external HDDs

2008-10-28 Thread Jacqui Caren
Edward Beckmann wrote:
> Hi
> 
> Probably a doh! question but here goes.
> 
> If I use one of the USB-powered external HDDs now quite common, can I 
> power them down without unplugging them?  I want to use one for 
> short-term backups / rarely used data.  Yes, I will also plan the 
> off-site stuff as well.

Someone will correct me if I am wrong but here goes.

I use two external drives on a very old box and hald picks up the drives
and creates the fstab entry. I then manually mount the drives and when I 
want to disconnect them have to umount then turn off the drive.

Of course this is a server system, desktop systems will likely mount the
drive and simply turning it off should unmount it.

Personally I prefer to unmount or 'eject' the drive before turning it 
off as my server systems are configured to cache data in memory and
turning off the (ext2/3) external drive has resulted in disk recovery
and lost files.

Hope this helps,
Jacqui

-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--