I am sharing important data with my friends/colleagues. For this, rather sending mail or uploading to some hosting site and providing them with the link, I prefer to give them individual USB Pen drive for data transfer.

But I can not trust any one of them as they can share among themselves the information saved in USB drive. I had LUKS-Crypted storage devices so that given storage device will not get mounted on any other Operating system but only through my Linux-based application. This application is pre-filled with passwords.

So far so good.

Here, I want to set one limitation on USB device that, it can not get mounted beyond certain number. Device must get destroy it's content once the threshold "mount count" reached.

Solution for this was to use tune2fs -l <device_Name> | grep ^Mount value for checking against mount count but e2fsck <device_Name> will reset this value.

Is there any way to achieve what I had mentioned ?

Also, Is it possible to deny any kind of cloning operation on device ? e.g. dd, partclone, rsync or any other

  • You hope to get the definitive answers to these questions on Unix & Linux? – Satō Katsura Oct 6 '16 at 10:41
  • You can't prevent a full bitwise disk clone. I'm not aware of any way with FOSS to provide an upper bound on the lifetime of the data when accessed passively as a filesystem. You might be able to do something with a FUSE tool, but that would require your friends/colleagues to use that FUSE filesystem interface module. And if you trust them that little I'm not sure I should expect them to trust unverified executable code supplied by you. (I'd post this as an answer but it's mostly opinion.) – roaima Oct 6 '16 at 11:50
  • I wonder, why downvote ? – SHW Oct 7 '16 at 6:46

It seems to me that you are trying to solve an user problem with technology. This won't work.

AFAIK there is no device that can self-destroy after a number of mounts. Even if it were, the users could reset the mount count on the device. And even if you had a tamper-proof device, the users could copy the contents of the device somewhere else upon first mount (or before the mount limit is reached anyway).

In short, you're approaching the problem from the wrong angle, and this problem is that you don't trust your users.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.