@Peter Bennett Ok, I finally managed to test this with CDs and worked out the problem. This was a fault in my shell script.
The test line in the script should be 'if [ "$n" -ne '0' ];then umount /dev/sr0;fi'. Note the command should have been 'umount' not 'eject'. Complete solution taking the above into account: sudo apt-get install dvd+rw-tools echo 'KERNEL=="sr0", ACTION=="change", RUN+="/usr/local/bin/sr0_change.sh"' | sudo tee /etc/udev/rules.d/61-sr0-change.rules cat << 'EOF' | sudo tee /usr/local/bin/sr0_change.sh #!/bin/sh dvd+rw-mediainfo /dev/sr0 > /dev/null n=$? if [ "$n" -ne '0' ];then umount /dev/sr0;fi EOF sudo chmod +x /usr/local/bin/sr0_change.sh sudo reboot -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1168742 Title: [udev] Disks are not unmounted when physical eject button is used To manage notifications about this bug go to: https://bugs.launchpad.net/systemd/+bug/1168742/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs