> device from my machine amd should umount the devices automatically. > > Is this possible? > no - because there is time sequence problem. device must be FIRST unmounted, then detached