2013年1月14日 星期一

VAIO S13 安裝 Ubuntu 12.10

VAIO S13 筆電,型號 SVS13123CW,GPT 格式硬碟預裝 Windows 8 64-bitUEFI 模式開機。要再安裝 Ubuntu 12.10 64-bit,讓它可以雙開機 (dual boot)。

註:Ubuntu 32-bit 不支援 UEFI,64-bit 的才支援。另外,需要 64-bit 作業系統才能用到已升級為 8GB 的記憶體。
註:已經將 BIOS 的 Secure Boot 關閉,這樣不影響 Windows 8 正常開機。

按照 Installing Ubuntu Quickly and Easily via Trial and Error 的步驟安裝 Ubuntu 12.10 64-bit,下面是安裝紀錄:(事實上可以再簡化,如後面說明)
  1. 8GB 隨身碟 (4G 應該也可以),用 UNetbootin 製作成 Live USB。
  2. Live USB 開機 (ASSIST 開電,或電源鍵開電 F2),選擇「Try Ubuntu without installing」。
  3. 執行桌面上的「Install Ubuntu 12.10」,按照一般方式安裝到硬碟,選擇「將 Ubuntu 與 Windows 8 安裝在一起」,會從 Windows 磁碟分割切出 ext4 跟 swap 分割,沿用原本的 EFI 分割。
  4. 重開機後是 Windows 8,此時看磁碟分割並沒有變化。再用 Live USB「Try Ubuntu」開機,安裝並執行 Boot Repair,使用「Recommended repair」。
  5. 重開機還是 Windows 8,但去看磁碟分割多了兩個。再用 Live USB  開機跑一次 Boot Repair 的「Recommended repair」,重開機還是一樣 Windows 8。
  6. 使用 http://askubuntu.com/a/150640 替換 Windows 開機管理程式的方式,解決了問題,看到 GRUB2 選單。(啟用 Secure Boot 這項替換會消失)
上述步驟 3.、4. 跟 6. 應該可以一併執行,而 5. 是多餘的。也就是安裝完 Ubuntu 後,執行 Boot Repair 並替換 Windows 開機管理程式,然後才重開機,如下:

a. Ctrl-Alt-T 開啟終端機視窗
b. 安裝並執行 Boot Repair (需要連上網際網路)
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
選「Recommended repair」

c. 替換 Windows 開機管理程式
mkdir mnt
sudo mount /dev/sda3 /mnt
cd mnt/EFI/Microsoft/Boot
sudo mv bootmgfw.efi bootmgfw.efi.old
sudo cp ../../ubuntu/grubx64.efi bootmgfw.efi

註:如果 Live USB 是安裝 Ubuntu-Secure-Remix 64-bit,則應該不需要連上網際網路安裝 Boot Repair,直接執行 boot-repair。
註:試過將 EFI/Boot/bootx64.efi 替換成 EFI/ubuntu/grubx64.efi 沒效。
註:試過《Dual-boot Windows 8 and Ubuntu 12.10 on UEFI hardware》用 EasyBCD 來製作 Windows 8 的開機選單,結果會出現 \NST\AutoNeoGrub0.mbr 找不到的問題。
註:發生過掛載 /dev/sda3 沒看到檔案,重新掛載就可以了
註:發生 Windows 8 開機後發現 C: 碟有問題,重新整理後重開機到一半螢幕沒顯示,使用「重新整理」還是怪怪的,最後「重設」將 Windows 8 重灌後恢復,不會動到 Ubuntu 的磁碟分割。
2013/01/17 補充:Windows 更新有可能覆蓋了 EFI/Microsoft/Boot/bootmgfw.efi,此時需要再替換 Windows 開機管理程式。

其它使用問題
  • 無法掛載 Windows 8 磁碟分割,出現 hibernated,不能掛載。試過 http://askubuntu.com/a/228069 將「Turn on fast startup」關閉也是一樣。
  • 休眠:《我要如何讓我的電腦休眠? 》說到支援仍有問題,所以預設關閉。
  • Windows 網路
  • 有些 Fn 鍵不能使用,包括停用觸控板
  • 螢幕亮度及鍵盤燈自動控制
其它參考資料
  1. Managing EFI Boot Loaders for Linux
  2. Sony Vaio Control device drivers 包括 sony-laptop 及 sonypi
  3. Linux 安裝與使用

附錄:未安裝 Ubuntu 前的磁碟分割
註:sda1 是名為「SONYSYS」的 OEM 磁碟分割,sda2 是名為「Windows RE tools」的修復磁碟分割,sda6 是名為「Recovery」的修復磁碟分割。

附錄:安裝 Ubuntu 後的磁碟分割
ubuntu@ubuntu:~$ sudo parted /dev/sda print
Model: ATA Hitachi HTS54755 (scsi)
Disk /dev/sda: 500GB

Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name                          Flags
 1      1049kB  274MB   273MB   fat32                                         hidden
 2      274MB   1819MB  1546MB  ntfs                                          hidden, diag
 3      1819MB  2092MB  273MB   fat32           EFI system partition          boot
 4      2092MB  2226MB  134MB                   Microsoft reserved partition  msftres
 5      2226MB  259GB   257GB   ntfs            Basic data partition
 7      259GB   468GB   208GB   ext4
 8      468GB   476GB   8463MB  linux-swap(v1)
 6      476GB   500GB   23.9GB  ntfs                                          hidden, diag

SIP header Via

所有 SIP 訊息 都要有 Via,縮寫 v。一開始的 UAC 和後續途經的每個 proxy 都會疊加一個 Via 放傳送的位址,依序作為回應的路徑。 格式 sent-protocol sent-by [ ;branch= branch ][ ; 參數 ...] s...