Using a Unix terminal to encrypt a disk under OS X

5,817

Solution 1

You can use the following command to encrypt from the command line:

diskutil cs convert /Volumes/your_drive_name_here -passphrase

You should get output similar to this:

computer name:~ username$ diskutil cs convert /Volumes/your_drive_name_here -passphrase
New passphrase for converted volume:
Confirm new passphrase:
Started CoreStorage operation on disk2s1 your_drive_name_here
Resizing disk to fit Core Storage headers
[ - 0%..10%.............................................. ]
Creating Core Storage Logical Volume Group
Attempting to unmount disk2s1
Switching disk2s1 to Core Storage
Waiting for Logical Volume to appear
Mounting Logical Volume
Core Storage LVG UUID: D1EAB2C3-EC21-41DA-AD60-75E1302E247B
Core Storage PV UUID: 991C89E9-A628-408C-AAFF-39A561FCB95C
Core Storage LV UUID: 36483526-6C2C-43FA-A4B7-6F503473F1C2
Core Storage disk: disk3
Finished CoreStorage operation on disk2s1 your_drive_name_here
Encryption in progress; use `diskutil coreStorage list` for status

I have a post here with more details:

http://derflounder.wordpress.com/2012/01/06/encrypting-10-7-non-boot-volumes-without-erasing-them/

Solution 2

If you have Mountain Lion or later, use fdesetup

examples

Share:
5,817

Related videos on Youtube

Jules
Author by

Jules

Expert Python programmer with experience working with the Linux network stack, REST APIs, and relational databases (and Postgres in particular). There's some devops experience in there too, but software dev is my preference. Not currently open to new work.

Updated on September 18, 2022

Comments

  • Jules
    Jules over 1 year

    I'm interested in knowing whether there are any native utilities (possibly under diskutil) to encrypt a disk via the command line in OS X 10.8.4. I can use FileVault or Mac OS's Disk Utility Erase tab, but am just curious whether there is a command-line alternative.