Install Ubuntu to USB Disk & Make USB boot CD

以下適用想把 Ubuntu 裝到 USB 隨身碟,
但 BIOS 不支援從 USB 開機的電腦,

BIOS 開機選成 CDROM,
使用 LiveCD 直接安裝到 4G 以上的隨身碟,

因為 BIOS 不支援從 USB 開機,
所以還是用 LiveCD 重開
選擇“試用而不改變計算機的任何內容” 啟動到桌面,
這時後應該可以辨認到剛裝好 Ubuntu 的隨身碟,
就可以用來製作專屬的 USB boot CD
UbuntuBootCDForUSB_8.10.iso
建議使用RW來作開機CD,
方便修改選項或是更新 kernel 時可重複使用。
#---------------------------------------------------------------------------------------------------------
# Make USB boot CD
# 由 LiveCD 製作 USB 開機光碟
# 使用終端機
ubuntu@ubuntu:~$ mkdir -p bootcd/boot/grub
ubuntu@ubuntu:~$ cp /media/disk/usr/lib/grub/i386-pc/stage2_eltorito bootcd/boot/grub/
ubuntu@ubuntu:~$ cp /media/disk/boot/grub/menu.lst bootcd/boot/grub/
# /media/disk 中的 disk 應該要是裝好 Ubuntu 的 USB partition 的名字

ubuntu@ubuntu:~$ gedit bootcd/boot/grub/menu.lst
# 編輯 menu.lst
# 把其中的這一行 "uuid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# 換成 "root (cd)" 即可
#---------------------------------------------------------------------------------------------------------
title Ubuntu 8.10, kernel 2.6.27-11-generic
root (cd)
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=9d32cf82-dc7a-4e17-a4b8-f8d6a89aa1f0 ro locale=zh_TW splash
initrd /boot/initrd.img-2.6.27-11-generic
#---------------------------------------------------------------------------------------------------------

# 然後複製開機的檔案,kernel 更新時請複製對應的版本。
ubuntu@ubuntu:~$ cp /media/disk/boot/vmlinuz-2.6.27-11-generic bootcd/boot/
ubuntu@ubuntu:~$ cp /media/disk/boot/initrd.img-2.6.27-11-generic bootcd/boot/

# 確認檔案
ubuntu@ubuntu:~$ ls bootcd/boot
grub initrd.img-2.6.27-11-generic vmlinuz-2.6.27-11-generic
ubuntu@ubuntu:~$ ls bootcd/boot/grub
menu.lst menu.lst~ stage2_eltorito

# 製作開機 ISO 檔
ubuntu@ubuntu:~$ sudo mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o UbuntuBootCDForUSB.iso bootcd
ubuntu@ubuntu:~$ ls
bootcd Desktop UbuntuBootCDForUSB.iso 公共 圖片 影片 文件 模板 音樂

# 複製到可以燒錄的地方
ubuntu@ubuntu:~$ mv UbuntuBootCDForUSB.iso /media/RALLY2/
ubuntu@ubuntu:~$

# 完成
#---------------------------------------------------------------------------------------------------------

No comments: