Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Power of USB key after umount?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1400
Location: Adelaide/Australia

PostPosted: Wed Jun 02, 2010 1:56 am    Post subject: Power of USB key after umount? Reply with quote

Is there a way to configure Gentoo such that when I umount a usb key, that it is powered down?

I like the visual clue that the 'led' on my key turns off, when ejecting a key in windows, and am hoping for similar functionality in Linux.

Thanks in advance.
_________________
...Lyall
Back to top
View user's profile Send private message
yoshi314
l33t
l33t


Joined: 30 Dec 2004
Posts: 848
Location: PL

PostPosted: Wed Jun 02, 2010 10:19 am    Post subject: Reply with quote

hmm in general a usb device should power down when unmounted.

you could try waiting a few seconds. or maybe you have hal polling usb devices.
_________________
~amd64
shrink your /usr/portage with squashfs+aufs
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1400
Location: Adelaide/Australia

PostPosted: Wed Jun 02, 2010 12:29 pm    Post subject: Reply with quote

Lets put it this way, in windows, the led on the usb key goes off when I 'eject' it.

In linux, when I 'umount' it, it stays on.

I would like it to turn off, on umount.
If I have to execute some command to cause the key to be powered down, so be it, I just want to know how to do it.

Key not inserted...
Code:

lyall@lyalls-pc:~
$ lsusb -t
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 3, If 0, Class=HID, Driver=usbhid, 1.5M
        |__ Port 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 6, If 0, Class=HID, Driver=usbhid, 1.5M
                |__ Port 2: Dev 11, If 0, Class=hub, Driver=hub/3p, 12M
                    |__ Port 1: Dev 12, If 0, Class=HID, Driver=usbhid, 1.5M
                    |__ Port 1: Dev 12, If 1, Class=HID, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M

Key inserted, allowing time to settle and automount
Code:

lyall@lyalls-pc:~
$ lsusb -t
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 3, If 0, Class=HID, Driver=usbhid, 1.5M
        |__ Port 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 6, If 0, Class=HID, Driver=usbhid, 1.5M
                |__ Port 2: Dev 11, If 0, Class=hub, Driver=hub/3p, 12M
                    |__ Port 1: Dev 12, If 0, Class=HID, Driver=usbhid, 1.5M
                    |__ Port 1: Dev 12, If 1, Class=HID, Driver=usbhid, 1.5M
                |__ Port 3: Dev 13, If 0, Class=stor., Driver=usb-storage, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
lyall@lyalls-pc:~
$ sudo umount /media/LYALLS_USB/
lyall@lyalls-pc:~
$ lsusb -t
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 3, If 0, Class=HID, Driver=usbhid, 1.5M
        |__ Port 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 6, If 0, Class=HID, Driver=usbhid, 1.5M
                |__ Port 2: Dev 11, If 0, Class=hub, Driver=hub/3p, 12M
                    |__ Port 1: Dev 12, If 0, Class=HID, Driver=usbhid, 1.5M
                    |__ Port 1: Dev 12, If 1, Class=HID, Driver=usbhid, 1.5M
                |__ Port 3: Dev 13, If 0, Class=stor., Driver=usb-storage, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M

Key physically removed.
Code:

lyall@lyalls-pc:~
$ lsusb -t
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 3, If 0, Class=HID, Driver=usbhid, 1.5M
        |__ Port 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 6, If 0, Class=HID, Driver=usbhid, 1.5M
                |__ Port 2: Dev 11, If 0, Class=hub, Driver=hub/3p, 12M
                    |__ Port 1: Dev 12, If 0, Class=HID, Driver=usbhid, 1.5M
                    |__ Port 1: Dev 12, If 1, Class=HID, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
lyall@lyalls-pc:~
$

_________________
...Lyall
Back to top
View user's profile Send private message
s0be
Apprentice
Apprentice


Joined: 23 Nov 2002
Posts: 239

PostPosted: Wed Jun 02, 2010 2:42 pm    Post subject: Reply with quote

this is going to sound silly, have you tried doing something like: eject /dev/sdg ?
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2971
Location: Germany

PostPosted: Wed Jun 02, 2010 2:46 pm    Post subject: Reply with quote

refer to /usr/src/linux/Documentation/usb/power-management.txt regarding power/level

unfortunately I don't know of anything that does this automatically for you when you umount
Back to top
View user's profile Send private message
ExZombie
Apprentice
Apprentice


Joined: 29 May 2004
Posts: 164

PostPosted: Thu Jun 03, 2010 9:12 am    Post subject: Reply with quote

This is just how it worked in the early days of HAL if you umounted using the KDE's interface. I think I used the fstab writing function of HAL. I don't remember when that was, I guess around KDE 3.4. Maybe you could check how things were done back then. But I'm pretty sure that pumount by itself didn't power off the device.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Thu Jun 03, 2010 10:57 am    Post subject: Reply with quote

I remove polling with
Code:
hal-disable-polling --device /dev/xyz

and at X session time
Code:
sudo udisks --inhibit-all-polling

This is going to sound silly too, if you remove the usb modules from memory, maybe the USB key gone poweroff. I just come to look at
Code:
modinfo usbcore

There is an option call
Code:
autosuspend:default autosuspend delay (int)

It surely can be done by softwares means, without stopping the system.
_________________
Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum