I've managed to override any automounting in Debian 7 by opening GParted before connecting any USB drive or hotplugging Sata drives.
But now in Debian 8, this doesn't work anymore since Gparted went over 0.3.7. They were adding an .fdi file somewhere in the system but now use the hal locking system.
I saw that you can blacklist the usb-storage kernel module but this won't work for Sata drives. Some also says that I can disable automount by unchecking an option somewhere but this is still not good since it depends on a desktop environment.
So the question is: How do I disable automounting (for USB and Sata) and make a lock like Gparted (prior to 0.3.7) in Debian 8 without depending on a desktop environment or disabling a kernel-module ?