Is there a way to tell, given a path to a LUKS block device, and not knowing the passphrase, whether the device is already open (decrypted)?
What about knowing the path to the decrypted device?
block-devicedevice-mapperencryptionluks
Is there a way to tell, given a path to a LUKS block device, and not knowing the passphrase, whether the device is already open (decrypted)?
What about knowing the path to the decrypted device?
Best Answer
The following code checks whether the device DEV_LUKS is an encrypted LUKS device and already opend (decrypted).