Web lists-archives.com

Re: Stretch : mount Jessie encrypted HDD via USB

On 01-11-2017 22:44, David Wright wrote:
> OK, so that sounds as if removing the USB device before   vgchange -an
> will not affect the device but only the host PC.
> And my own experience suggests that the same is true if the
> unlocked device is removed before locking it.
> It's not that I don't perform the correct sequence of steps,
> but just that accidents happen and I like to be prepared for
> the consequences. The effects of removing a device without
> unmounting it are well documented and have been for years.
> OTOH I have found a deafening silence about the effects of
> not locking an encrypted device.

I don't know what you mean by 'locking', as it is not a term used by
dm-crypt volumes.

But if it means closing the disk with the 'luksClose' command of
cryptseupt, I'd definitely do that before disconnecting the disk.

It probably won't hurt to simply unplug if everything has already been
written to the disk, but it's definitely safer to properly close the
encrypted volume.

If you run LVM on the encrypted volume, you'll most likely have to run
'vgchange -an', otherwise the volume will be considered 'in use' and you
won't be able to luksClose it.

The commands in deloptes' message seem correct and are what you need.