I want to execute the script on removal of usb drive. In that script I want to restart the server.
Is there any way to do the same ? I know I have to modify the rules in /etc/udev/rules.d/.

  • please specify some more information to enable us to follow through. If what you want is to modify the script so as to restart your server everytime you remove a usb drive it is better to write your own script that wraps usb remove and also runs reboot.
    – nass
    Jul 16, 2014 at 10:01
  • where should I call the script ? Is there any existing script which gets call on removing the usb ? Jul 16, 2014 at 10:05
  • 1
    unix.stackexchange.com/questions/71348/… ... not about a drive, but the basic principle should still apply.
    – tink
    Jul 16, 2014 at 23:10


Your Answer

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

Browse other questions tagged or ask your own question.