首先,打开一个终端。
之前的状态:
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *128.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 127.8 GB disk0s2
获取Lion Recovery Update v1.0(431.91 MB)
挂载RecoveryHDUpdate.dmg
$ hdiutil attach ~/Downloads/RecoveryHDUpdate.dmg
从RecoveryHDUpdate.pkg提取数据
$ pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg ~/Desktop/RHD
挂载RecoveryHDMeta.dmg(在RecoveryHDUpdate.pkg程序包中)
$ hdiutil attach ~/Desktop/RHD/RecoveryHDUpdate.pkg/RecoveryHDMeta.dmg
运行工具将最终调整当前分区的大小并创建恢复
$ ~/Desktop/RHD/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition / /Volumes/Recovery\ HD\ Update/BaseSystem.dmg 0 0 /Volumes/Recovery\ HD\ Update/BaseSystem.chunklist
Creating recovery partition: finished
之后的状态:
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *128.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 127.2 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3