2016年6月11日土曜日

OS X El Capitanのリカバリー用.isoを作る……という夢を見た

MacのOS X El Capitanが壊れてしまった場合に備えて、リカバリー用の.isoファイルを作っておこう。

Macを起動して、App Storeからダウンロードしてきます。
サイズは……すごく…大きいです。
約7.5Gくらい。

ダウンロードが終わったEl Capitanは、アプリケーションフォルダの中にいます。

Macのターミナルを起動して、不思議な呪文を唱えます。

#!/bin/bash

# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app

# Create the ElCapitan Blank ISO Image of 7316mb with a Single Partition - Apple Partition Map
hdiutil create -o /tmp/ElCapitan.cdr -size 7316m -layout SPUD -fs HFS+J

# Mount the ElCapitan Blank ISO Image
hdiutil attach /tmp/ElCapitan.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build

# Restore the Base System into the ElCapitan Blank ISO Image
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase

# Remove Package link and replace with actual files
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/

# Copy El Capitan installer dependencies
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg

# Unmount the installer image
hdiutil detach /Volumes/install_app

# Unmount the ElCapitan ISO Image
hdiutil detach /Volumes/OS\ X\ Base\ System/

# Convert the ElCapitan ISO Image to ISO/CD master (Optional)
hdiutil convert /tmp/ElCapitan.cdr.dmg -format UDTO -o /tmp/ElCapitan.iso

 # Rename the ElCapitan ISO Image and move it to the desktop
 mv /tmp/ElCapitan.iso.cdr ~/Desktop/ElCapitan.iso


デスクトップにElCapitan.isoが現れたよ、母さん。
じゃあ、これをUSBメモリにコピーしたらいいね。

あ~、いい夢を見た。

0 件のコメント:

コメントを投稿