How to trigger mount/umount before/after hibernation? I use s2disk.

Note: Debian

  • You don't say which version of Linux you're running (assuming it is Linux, and not say, Solaris). – EightBitTony Sep 27 '13 at 12:15

You should be able to write a start/stop script which mounts or unmounts your filesystem, and place it in /etc/pm/sleep.d (assuming that directory exists).

Although this page talks about Lenny, I think it is valid for Wheezy as well.

In summary, your script should work like an init script but handle hibernate, suspend, resume and thaw as inputs. Here's the example from that page,

case "$1" in
            /etc/init.d/bluetooth stop
            /etc/init.d/atheros stop

            /etc/init.d/bluetooth start
            /etc/init.d/atheros start
    *) exit $NA
| improve this answer | |

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.