在 OS X 下使用 Unix 终端加密磁盘

Jul*_*les 3 unix terminal disk-encryption macos

我很想知道是否有任何本机实用程序(可能在 下diskutil)通过 OS X 10.8.4 中的命令行加密磁盘。我可以使用 FileVault 或 Mac OS 的磁盘工具擦除选项卡,但我只是好奇是否有命令行替代方案。

小智 6

您可以使用以下命令从命令行进行加密:

diskutil cs convert /Volumes/your_drive_name_here -passphrase
Run Code Online (Sandbox Code Playgroud)

你应该得到类似这样的输出:

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
Run Code Online (Sandbox Code Playgroud)

我在这里有一个帖子,其中包含更多详细信息:

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