How to Setup a FileVault Recovery Key On Your Mac

For some reason when I encrypted the hard drive on my Mac I wasn't given the option to create a recover key. Here are some tips for working with FileVault at the command line to create or change the recovery key.

Check if file vault is running [1].

fdesetup status

There are actually two different types of recovery keys [2]. I was working on my personal Mac so the first one was relevant for me.

fdesetup haspersonalrecoverykey
fdesetup hasinstitutionalrecoverykey

Generate a recovery key [2].

fdesetup changerecovery -personal

References

[1] https://www.blackbagtech.com/blog/2015/07/30/using-terminal-to-determine-if-fv2-is-running

[2] https://derflounder.wordpress.com/2015/12/20/managing-el-capitans-filevault-2-with-fdesetup/