I have an external drive connected to my computer, I want this drive to be in sleep mode unless i'm executing some backup tool.

For some reason, after 14 minutes I think, the hard drive always wakes up.

** edit **

i tried the following things:

  1. btrace /dev/myexternal- to see which system call calls my external hard drive. unfortunately at the moment my hd wakes up I don't see any call.

  2. fuser /dev/myexternal - to see which processes use this hd.

  3. lsof - to see if there are files which has accessed.

  4. mount the external drive manually to /mnt

  5. stop lightdm and several processes/services.

How can I find which process wakes the hard drive?


More then likely your file manager or desktop enviroment is "scanning" the drive for indexing.

You can stop this by unmounting the drive when not in use, then mounting, backup, unmounting when you need to backup.

Other then that you can use tools like lsof to see what processes have files open on the drive. But this is can be very hit or miss, as the access that cause wake may be nothing more then a "Are you still there?" from the kernel.

To use lsof and not go crazy:

lsof | grep /media/external

changing the path to your mount point of course.

I Really recommend unmounting though if you don't want the drive to be in use.

  • The problem with umount is that if i'm using Ubuntu's default backup app it won't mount this drive again. I think it all defends how do you backup your data - scripts or GUI. The advantage of the GUI is that you can choose your files from nautilus and you have an option to go to previous version. – idgar Nov 2 '12 at 14:29
  • I have always loved back-in-time. If you really want the GUI AND want to run arbitrary commands give it a try. – coteyr Nov 2 '12 at 14:39
  • Will try first to check lsof to see if i find which process touches my external drive and then if I won't succeed i'll try this app. Thanks! – idgar Nov 2 '12 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.