ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
狮子的安装会自动在硬盘中生成一个650MB的恢复盘分区,这个分区在正常的GUI界面中是看不见的。使用下面的语句可以看见硬盘的分区情况: diskutil list 这样可以看到这个隐藏的分区的名称是Recovery HD 使用命令来安装到GUI中(比如我的是disk1s4): diskutil mount disk1s4 进入后,下面是它的根里面的内容: d-wx-wx-wt@ 3 root  _unknown  hidden 102  2 Jul 22:52 .Trashes drwxr-xr-x@ 3 root  admin     -      102  2 Jul 16:16 .fseventsd -rw-r--r--@ 1 root  admin     -        0  2 Jul 16:16 .metadata_never_index drwxr-xr-x@ 9 root  admin     -      306  2 Jul 16:17 com.apple.recovery.boot 在com.apple.recovery.boot目录里面的内容: total 930040 drwxr-xr-x@ 9 root  admin        306  2 Jul 16:17 . drwxrwxr-x  8 root  admin        340  2 Jul 16:16 .. -rw-r--r--@ 1 root  admin        749  2 Jul 16:17 .disk_label -rw-r--r--@ 1 root  wheel  451307798  2 Jul 16:07 BaseSystem.dmg -rw-r--r--@ 1 root  wheel       2245 15 Jun 19:06 PlatformSupport.plist -r--r--r--@ 1 root  wheel        475 29 Jun 21:42 SystemVersion.plist -rw-r--r--@ 1 root  wheel     858800 30 Jun 00:04 boot.efi -rw-r--r--@ 1 root  admin        361  2 Jul 16:17 com.apple.Boot.plist -rw-r--r--@ 1 root  wheel   23992189 29 Jun 23:41 kernelcache 这里就是启动盘的所有内容了。 看看每个文件的内容: SystemVersion.plist : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>     <key>ProductBuildVersion</key>     <string>11A511</string>     <key>ProductCopyright</key>     <string>1983-2011 Apple Inc.</string>     <key>ProductName</key>     <string>Mac OS X</string>     <key>ProductUserVisibleVersion</key>     <string>10.7</string>     <key>ProductVersion</key>     <string>10.7</string> </dict> </plist> PlatformSupport.plist 它和安装盘中的是一样的内容,里面是所支持的硬件主板id号列表 com.apple.Boot.plist :是控制如何使用这个BaseSystem.dmg文件来启动系统恢复程序的 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>     <key>Kernel Cache</key>     <string>\com.apple.recovery.boot\kernelcache</string>     <key>Kernel Flags</key>     <string>rp=file:///com.apple.recovery.boot/BaseSystem.dmg</string> </dict> </plist> 再将BaseSystem.dmg安装到GUI中,可以看到这个图 ![](https://box.kancloud.cn/2016-04-19_57158f50e2b62.gif) 就是一个核心系统,它自动运行Insall Mac OS X Lion.app程序,来恢复系统。不过这个恢复的过程需要从App Store下载安装的方式。 Install Mac OS X Lion.app运行的画面就是在安装过程中的画面: ![](https://box.kancloud.cn/2016-04-19_57158f51132f6.gif) 回头看看ESD安装盘的内容,上面的这些文件都可以在ESD安装盘上找到: total 960568 drwxrwxr-t  20 root      admin           748  2 Jul 15:48 . drwxrwxrwt@  9 root      admin           306  2 Jul 22:58 .. -rw-r--r--@  1 dd        admin         15364  2 Jul 23:17 .DS_Store drwx------   5 _unknown  _unknown        170  2 Jul 17:27 .Spotlight-V100 d-wx-wx-wt@  3 _unknown  _unknown        102  2 Jul 21:59 .Trashes -rwxr-xr-x@  1 root      wheel            82 13 Jun 12:47 ._Instructions.localized -rw-r--r--@  1 root      admin           581 30 Jun 00:55 .disk_label drwx------   6 _unknown  _unknown        204  2 Jul 17:53 .fseventsd -rw-r--r--@  1 root      admin          1876 30 Jun 00:55 BaseSystem.chunklist -rw-r--r--@  1 root      admin     451307798 30 Jun 00:47 BaseSystem.dmg drwxr-xr-x@  3 root      wheel           102 29 Jun 20:24 Install Mac OS X Lion.app drwxr-xr-x@  4 root      wheel           136  2 Jul 23:17 Library -r--r--r--@  1 root      wheel         46516  8 Jun  2010 MacOSX_Media_Background.png drwxr-xr-x@ 51 root      wheel          1734 30 Jun 00:55 Packages drwxr-xr-x@  3 root      wheel           102 16 Jun 17:07 System -rw-r--r--@  1 root      admin        858800 30 Jun 00:52 boot.efi -rw-r--r--@  1 root      admin      23992189 30 Jun 00:54 kernelcache -rw-r--r--@  1 root      wheel      15565140 18 Jun 13:59 mach_kernel drwxr-xr-x@  3 root      wheel           102 16 Jun 16:57 private drwxr-xr-x@  4 root      wheel           136 30 Jun 00:52 usr 对比一下10.6和10.7的boot.efi文件的大小: 10.6的Boot.efi文件大小是332464 bytes,而Lion的是858800 bytes. ESD中的com.apple.Boot.plist在/Library/Preferences/SystemConfiguration/里面 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>     <key>Kernel Flags</key>     <string>root-dmg=file:///BaseSystem.dmg</string>     <key>Kernel Cache</key>     <string>\kernelcache</string> </dict> </plist> 它和上面的恢复盘的内容有些差别,路径不一样,而且参数也不一样,一个是root-dmg一个是rp 另外,Lion增加了一个硬盘检测的程序叫做hwmond 安装盘的硬件检测部分: /System/Library/Launchdaemons/com.apple.hwmond.plist cat /Volumes/Mac\ OS\ X\ Install\ ESD/System/Library/LaunchDaemons/com.apple.hwmond.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>     <key>Label</key>     <string>com.apple.hwmond</string>     <key>OnDemand</key>     <false/>     <key>Program</key>     <string>/usr/sbin/hwmond</string>     <key>ProgramArguments</key>     <array>         <string>hwmond</string>     </array>     <key>ServiceIPC</key>     <false/> </dict> </plist> 它的硬件测试返回代码:/Volumes/Mac\ OS\ X\ Install\ ESD/private/etc/hwmond.SMART 通过比较安装盘和恢复盘的两个Install Mac OS X Lion.app是完全一样的. 这个BaswSystem.dmg对于管理环境中的系统恢复会是比较有用的。