2016年5月31日 星期二

重置SMC

https://support.apple.com/zh-tw/HT201295
若要重置 SMC:
  1. 將電腦關機。
  2. 將 MagSafe 或 USB-C 電源轉換器插入電源與電腦。
  3. 在內建鍵盤上同時按下(左側)Shift-Control-Option 鍵以及電源按鈕。
  4. 同時放開所有按鍵和電源按鈕。
  5. 按下電源按鈕以啟動電腦。
在 MagSafe 電源轉換器上,LED 可能會在您重置 SMC 時改變狀態或暫時熄減。

重置 NVRAM

https://support.apple.com/zh-tw/HT204063
重置 NVRAM
  1. 關閉 Mac。
  2. 在鍵盤上找到下列按鍵:Command(⌘)、Option、P 和 R。
  3. 開啟 Mac。
  4. 在聽到開機啟動音效之後,立刻按住 Command-Option-P-R 組合鍵。
  5. 按住這些鍵,直到電腦重新啟動且再次聽到開機啟動音效。
  6. 放開這些鍵。

重置 NVRAM 後,可能必須重新設定揚聲器音量、螢幕解析度、選擇的啟動磁碟和時區資訊。

OSX recovery is not selectable / OSX Recovery 無法在開機選單中出現

狀況:MAC 使用Command + R 透過線上Recovery 重新安裝OSX

安裝完成後 按住alt/option 重新開機發現Recovery 選項消失

檢驗:打開Terminal 輸入diskutil list 檢查是否有Recovery Partition,若有代表重新安裝時安裝了Core Storage,簡單的說就是磁碟分割區跟檔案系統之間多卡了一層

解決方案:將CoreStorage拿掉

作法:
1. 打開Terminal 輸入 diskutil cs list 如果出現好幾層的資訊 那代表你的磁碟有安裝了CoreStorage
如果顯示No CoreStorage logical volume groups found 應該是其他問題,
謝謝你的點閱,廣告在旁邊記得點完再關掉網頁

2. 輸入回復命令 diskutil cs revert /  或是diskutil cs revert lvUUID
執行完成後會要求重開機,部分狀況會直接進入Recovery ,選單裡面重新啟動系統就可以了

注意:第一種作法適合單一磁碟單一OSX作業系統的環境,第二種適合單一磁碟多OSX作業系統的環境
注意:lvUUID請用diskutil cs list查出來的帶入

Condtion: After using system recovery (command+r) OSX installed but recovery option can't be selectable

Check: open terminal app, then execute disk utilities (diskutil list) check recovery partition is gone or not

Solution: if recovery partition is still in your disk , then check CoreStorage status
using (diskutil cs list ) to list CoreStorage Status , if show No CoreStorage logical volume groups found , maybe you should check "OSX Recovery Update" from google, oh before close this page remember click ads, thank you

Step:
open terminal app,
input "diskutil cs revert /"  for single disk , single osx installed
input "diskutil cs revert lvUUID" for  multi OSX installed , lvUUID replace with you check on solution stage

after revert , it's prompt to reboot, your mac may be direct boot into recovery , just reboot to OSX,
finished!


Reference: CoreStorage
Reference: Yosemite recovery gone
Reference: Making El Capitan Recovery HD selectable at boot - possible?

2016年1月30日 星期六

如何清空OSX DNS Cache / How to flush DNS cache

OSX下如何清空DNS快取

打開終端機程式 open terminal.app and type follow command
輸入

方法一/method1:
sudo dscacheutil -flushcache

方法二/method2:
sudo killall -HUP mDNSResponder

2016年1月26日 星期二

使用 Disk Maker X製作 OSX 開機隨身碟

使用 Disk Maker X製作  OSX 開機隨身碟

OSX 提供的開機隨身碟製作工具需要輸入很多指令,對於有終端機命令列恐懼症的一般使用者而言可以算是一種惡夢

而Disk Marker X是一套可以簡化製作開機隨身碟的程式

官方網站 : diskmakerx.com

OSX 建立可開機媒體 /OSX Create USB bootable installer

OSX 建立可開機媒體

MAC OSX 從10.9 Mavericks 開始支援建立USB開機碟

首先先從APP 下載OSX  / Download OSX from APP Store

媒體建立工具 / command name is
createinstallmedia

位於 /Applications/Install OS X El Capitan.app/Contents/Resources
/Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/

語法
--volume
要建立的磁碟路徑
--applicationpath
OSX來源路徑


範例:在終端機程式中
輸入
sudo /Applications/Install OS X El Capitan.app/Contents/Resources/ createinstallmedia --volume /Volumes/隨身碟名稱 --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app

Sample Screen
sudo /Applications/Install OS X El 
./createinstallmedia --volume /Volumes/SP_16G_Slim --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app
Ready to start.
To continue we need to erase the disk at /Volumes/SP_16G_Slim.
If you wish to continue type (Y) then press return: Y
Erasing Disk: 0%... 10%... 20%... 30%...100%...
Copying installer files to disk...
Copy complete.
Making disk bootable...
Copying boot files...
Copy complete.
Done.

2016年1月25日 星期一

如何載入及卸載OSX核心延伸模組/How to load /unload kernel extension(kext)

如何載入及卸載 OSX 核心延伸模組/ How to load /unload kernel extension(kext)

打開終端機視窗 open termial.app and type follow command

載入/Load
sudo kextload /Library/Extensions/[xxxxxx.kext]

或是使用APP的 bundle identifier / load  kext by bundle identifier
sudo kextload -b com.hardware.driver

卸載/Unload
sudo kextunload /Library/Extensions/[xxxxxx.kext]

或是使用APP的 bundle identifier /Unload kext by bundle identifier
sudo kextunload -b com.hardware.driver

查看已經載入的核心延伸模組 / List kext loaded and grep for hardware.driver
sudo kextstats |grep com.hardware.driver

或是使用系統資訊工具

關閉 核心延伸模組簽章檢查/ disable kext signing check


關閉 核心延伸模組簽章檢查
disable kext signing check

OSX 10.11 El Captian

第三方硬體可能因為驅動程式更新較慢導致無法正常驅動,這時候需要跳過或停用檢查
sometime we need to skip signing check due to third party driver not signed for newer osx

com.apple.kextd[50]: ERROR: invalid signature for com.asix.driver.ax88179-178a, will not load 


在終端機視窗輸入
open terminal.app and type follow command
sudo nvram boot-args="kext-dev-mode=1 rootless=0"

OSX El Captian 10.11 關閉 System Integrity Protection(SIP)

OSX El Captian 關閉System Integrity Protection(SIP)

首先進入OSX Recovery
boot into Recovery

打開終端機視窗輸入
open termminal.app and type follow command
csrutil disable

Warning: NO recommand disable SIP
注意:除非特殊需求,正常使用者不需關閉SIP

OSX如何進入回復模式/HOW to get into OSX Recovery mode


MAC OSX how to get into recovery mode
方法一:如果回復磁區還在 / Method 1:works for recovery partition exist!
1.重新開機 
reboot
2.按住option(alt)(開機管理程式) 
press option(alt) (Startup Manager)
3.選recovery開機 
Choose recovery partition to boot


方法二: 開機直接進入Recovery / Method 2:reboot to Recovery mode
1.重新開機
reboot
2.按住Command + R
Press Command + R 


方法三: 如果回復磁區壞掉或不見了 / Method 3:Works for recovery partition is gone or broken
1.重新開機
reboot
2.按住Command + option(alt) + R
Press Command + option(alt) + R to into (Internet Recovery)
3.需要可以存取網路
Internet connection is need