Find the answer to your Linux question:
Results 1 to 4 of 4
I am trying to find out how to power off and on UltraBay in my ThinkPad laptop. So far, I got halfway. From this I discovered how to power it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    64

    Question Decyphering some code


    I am trying to find out how to power off and on UltraBay in my ThinkPad laptop. So far, I got halfway.

    From this I discovered how to power it off:
    https://github.com/linrunner/TLP/blo.../tlp-functions
    The command is
    Code:
    echo 1 > /sys/devices/platform/dock.2/undock
    This file is write-only, by the way.

    Now, I was looking for a method to power it back on here:
    https://github.com/linrunner/TLP/blob/master/49bay
    but I can't figure it out.

    Simply doing
    Code:
    echo 0 > /sys/devices/platform/dock.2/undock
    does nothing, and /sys/devices/platform/dock.2/docked is read-only. Permission denied. If I change it to rw, it does nothing.

    Can someone give me a hand with it?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,709
    Well, the system thinks it is undocked - ie, not there. You will have to remove it, and plug it back in so the OS gets the signal that the device has been plugged into the system. What you did is in effect the equivalent to the Windows "Safely Remove Hardware" gizmo.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Posts
    64
    The links I provided lead to the source of a program that, among other things, can switch it on and off. I want to be able to switch it off while on battery, and then on, when AC is connected.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,709
    What do you have in the bay? A CD/DVD drive? When they are not being used, their power consumption, AFAIK, is pretty minimal. It sounds like you are trying to squeeze every last erg out of your batteries. My solution has always to get the biggest capacity battery available for the system, and at least one more for good measure. Then, when the system starts to run out of juice, it hibernates, I switch the battery, restart the system, and continue from where i was before!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •