When using safecopy to restore some data, I noticed that when saving some data, it may happen that either the system mounts the device or the user does this by accidentally clicking on the fe disk icon in the nautilus.
I looked at the source a bit, and just for fun I decided to hack it a bit. I enabled liblockdev to lock the drive while it is being used by safecopy, so ideally it could not be automated. While this is compiling, it has no effect so far. So, the question is, is it even possible to lock the device so that even root cannot override it? (or at least not directly) Or am I trying to do something impossible? If possible, at least I know that only something is wrong with my code, but that it should work in principle.
source
share