I’m usually someone who learns new things because I become irritated with “the way things are”. The following tip is a perfect example. I grew tired of my usb drive going into sleep mode and causing issues with some of the things I use it for, so I decided to see if I could tell it to never go to sleep.

Turns out? You can.

Redhat flavors?

yum install sdparm

Ubuntu:

sudo aptitude install sdparm

Once that is installed, you can point it at your USB device. In my case, it was /dev/sdc. If you’re unsure what device it has been labeled as, consult the output of “dmesg” and find it.

So, point sdparm to it with the command: sdparm -a

[root@pinja ~]# sdparm -a /dev/sdc
/dev/sdc: Seagate FreeAgentDesktop 100F
Power condition mode page:
PM_BG 0 [cha: n, def: 0, sav: 0]
STANDBY_Y 0 [cha: n, def: 0, sav: 0]
IDLE_C 0 [cha: n, def: 0, sav: 0]
IDLE_B 0 [cha: n, def: 0, sav: 0]
IDLE 0 [cha: n, def: 0, sav: 0]
STANDBY 1 [cha: y, def: 1, sav: 1]
ICT 0 [cha: n, def: 0, sav: 0]
SCT 9000 [cha: y, def:9000, sav:9000]
Power consumption mode page:
ps_id 0 [cha: n, def: 0, sav: 0]
SAT ATA Power condition mode page:
APMP 0 [cha: n, def: 0, sav: 0]
APM 0 [cha: n, def: 0, sav: 0]

Notice STANDBY_Y has a 0 beside it? That means standby is disabled (because I shut it off earlier). The actual flag can change a bit from drive to drive (some just say STANDBY, for example) so just pay attention to what is listed there. If you find it has a 1, you will need to run the commands:

sdparm --command=start /dev/sdc
sdparm --clear STANDBY_Y -6 /dev/sdc
sdparm -save -6 /dev/sdc

Another “sdparm -a /dev/sdc” should then show you the cleared value and we’ve saved it so it will persist through a reboot.


Category: advice, hardware, linux

4 Responses to Turning off USB drive “sleep” modes

  1. abacate says:

    Very welcome information, thanks a lot!

  2. Marcus says:

    Hi,
    when trying to save the settings, I am getting an error message:
    couldn’t find field acronym: ave
    [perhaps a ‘–transport=’ or ‘–vendor=’ option is needed]

    Any idea what this means?
    Many thanks!

    • alex says:

      So, based purely on the error:

      “couldn’t find field acronym: ave”

      It looks like there’s a space or something getting translated from the -save, so it thinks you are passing a flag of -s followed by ave? Have you tried manually typing out the command vs. cutting and pasting?

  3. Marcus says:

    thanks Alex, it seems to have been a spelling error in one the flags.

    It still does not seem to save it, though.

    mischa@xxx:~$ sudo sdparm –save –six /dev/sdb
    /dev/sdb: Intenso External USB 3.0 0001
    Caching (SBC) mode page:
    WCE 0 [cha: n, def: 0, sav: 0]
    RCD 0 [cha: n, def: 0, sav: 0]
    Informational exceptions control mode page:
    EWASC 0 [cha: n, def: 0, sav: 0]
    DEXCPT 0 [cha: n, def: 0, sav: 0]
    MRIE 0 [cha: n, def: 0, sav: 0]

    Then, when running sdparm -h, I can see that is has not been saved , as the value is still set to 1.:

    mischa@xxx:~$ sudo sdparm -a /dev/sdb
    /dev/sdb: Intenso External USB 3.0 0001
    Caching (SBC) mode page:
    IC 0 [cha: n, def: 0, sav: 0]
    ABPF 0 [cha: n, def: 0, sav: 0]
    CAP 0 [cha: n, def: 0, sav: 0]
    DISC 0 [cha: n, def: 0, sav: 0]
    SIZE 0 [cha: n, def: 0, sav: 0]
    WCE 0 [cha: n, def: 0, sav: 0]
    MF 0 [cha: n, def: 0, sav: 0]
    RCD 0 [cha: n, def: 0, sav: 0]
    DRRP 0 [cha: n, def: 0, sav: 0]
    WRP 0 [cha: n, def: 0, sav: 0]
    DPTL 0 [cha: n, def: 0, sav: 0]
    MIPF 0 [cha: n, def: 0, sav: 0]
    MAPF 0 [cha: n, def: 0, sav: 0]
    MAPFC 0 [cha: n, def: 0, sav: 0]
    FSW 0 [cha: n, def: 0, sav: 0]
    LBCSS 0 [cha: n, def: 0, sav: 0]
    DRA 0 [cha: n, def: 0, sav: 0]
    NV_DIS 0 [cha: n, def: 0, sav: 0]
    NCS 0 [cha: n, def: 0, sav: 0]
    CSS 0 [cha: n, def: 0, sav: 0]
    Power condition mode page:
    PM_BG 0 [cha: n, def: 0, sav: 0]
    STANDBY_Y 0 [cha: n, def: 0, sav: 0]
    IDLE_C 0 [cha: n, def: 0, sav: 0]
    IDLE_B 0 [cha: n, def: 0, sav: 0]
    IDLE 0 [cha: n, def: 0, sav: 0]
    STANDBY 1 [cha: y, def: 1, sav: 1]

    Do you have any ideas why that is?
    Thank you!

Leave a Reply

Categories


gives good tech

tech.superhappykittymeow.com
Kale is one of the smartest people I know

Racker Hacker
Major is always good for leet deetz