หน้าแรก

1 ม.ค. 2555

การยกเลิกโอเอสใน Dual Boot ตอนแรก

ในบทความนี้จะพูดถึงเรื่องการใช้งาน 2-3 โอเอส ในเครื่องเดียวกัน ซึ่งการที่แต่ละโอเอสจะอยู่ร่วมกันได้จะต้องมีโปรแกรมจัดการบูทเลือกโอเอส เรียกว่า Boot Manager ซึ่งจะขึ้นกับตอนเราติดตั้งโอเอส (บางโอเอสมีมาให้) และการติดตั้งโอเอสลำดับก่อนหลังก็จะมีผล

Dual Boot ระหว่าง Windows XP กับ Linux ในกรณี XP ติดตั้งเป็นตัวแรก

ช่วงนี้เห็นกระแสลินุกส์กำลังมาแรง โดยเฉพาะเจ้า Ubuntu มาแรงมากในหมู่เพื่อนๆลินุกส์ด้วยกัน ทำให้เพื่อนๆ บ้างคนอย่างจะทดลองใช้บ้าง แต่ก็มีปัญหาไม่แน่ใจเพราะงานต่างๆ รวมทั้งเกมส์ก็อยู่ในวินโดวส์จะทิ้งทั้งหมดเลยก็เสียดายก็ใช้มันทั้งสองเลย ดีกว่าก็เกิดปัญหาอีกว่าจะติดตั้งอย่างไร กระผมนาย augie ก็ขออาสาแนะนำวิธีติดตั้งแบบ Dual boot ให้ลองทำดู

โดยส่วนตัวแล้วผมใช้เป็นเกือบทุกตัวครับสำหรับค่าย Linux แต่ที่ติดตั้งไว้ใช้จริงๆ ตอนนี้ก็มี Mandriva 2007 (Gnome) กับ PCLinuxOS 2007(KDE) แต่ในบทความนี้ผมจะใช้เจ้า Ubuntu ตามกระแสหน่อย แต่ถ้าจะพูดกันจริงๆ แล้ว มันก็เหมือนกันครับกับวิธีติดตั้งของลินุกส์ทุกข่าย โดยรวมแล้วเหมือนกัน จะมีปลีกย่อยบ้างคำสั่งเท่านั้นที่ไม่เหมือน ฉะนั้นบทความนี้ ผมคิดว่านำไปใช้ได้กับลินุกส์ได้เกือบทุกตัวที่เพื่อนๆ รู้จัก (แบบ DeskTop นะครับ)

การติดตั้ง XP กับ Linux โดยทั่วไปส่วนใหญ่จะทำการแบ่ง Partition ของ XP ให้มีพืนที่ว่างๆ ซัก 10 จิ ด้วยโปรแกรมจัดการ Partition อย่าง Norton Partition Magic

แต่ในบทความนี้ผมไม่ใช้ครับ ......แล้วจะใช้วิธีไหนล่ะ....ก็ตามมาครับ ….
ดาวน์โหลด Ubuntu

ก่อนอื่นคุณๆ ก็ต้องหาเจ้า Ubuntu มาก่อน ลินุกส์ตัวนี้ใช้ง่ายครับ มีแผ่นแบบ Live CD มาให้ใช้คือมันสามารถบูตใช้งานได้จากแผ่นซีดี แค่แผ่นเดียวพร้อมเสร็จ และก็ติดตั้งได้จากแผ่นนี้ได้ด้วย....ไปดาวน์โหลดได้ที่นี่

http://www.ubuntu.com/getubuntu/download

หรือจะดูรายละเอียดทั้งหมดของ Ubuntu ก็ที่นี่ครับ

http://www.ubuntu.com

เมื่อได้มาแล้วก็เขียนเป็นแผ่นบูตซีดี เตรียมตัวทำ Dual Boot ได้เลย

ติดตั้ง Ubuntu

ให้คุณบูตเครื่องด้วยแผ่น Ubuntu (ตั้ง BIOS ให้อ่านซีดีเป็นตัวแรก และเครื่องมี XP อยู่แล้วนะครับ) เมื่อบูตมาแล้วจะมีเมนูให้เลือก ให้คุณเลือก Start or install Ubuntu (ค่า Default จะตั้งไว้อยู่แล้ว 30 วินาที) รอจนกว่าเครื่องทำการเรียกลินุกส์ขึ้นมา


คลิกเพื่อดูภาพขนาดจริง



เมื่อเครื่องทำงานมาจนได้หน้า Desktop ตามภาพ ให้คุณดับเบิลคลิกที่ ไอคอน Install

คลิกเพื่อดูภาพขนาดจริง

ต่อมาจะขึ้นหน้านี้ เริ่มแรกจะเป็นภาษาอังกฤษ ให้คุณเลือกที่ ภาษาไทย แล้วคลิกที่ปุ่ม ถัดไป

คลิกเพื่อดูภาพขนาดจริง

เลือกจังหวัดเป็น Bangkok คลิกปุ่ม ถัดไป

คลิกเพื่อดูภาพขนาดจริง

เลือกแป้นพิมพ์เป็น Thailand คุณสามารถทดลองพิมพ์ภาษาไทยได้โดยใช้คีย์ Alt+Shift เปลื่ยนสลับภาษาที่ช่องด้านล่างที่จัดไว้ให้

คลิกเพื่อดูภาพขนาดจริง

มาถึงส่วนสำคัญคือ Ubuntu จะจัดการพื้นที่บนฮาร์ดดิสก์ ตามที่กล่าวไว้ข้างต้นว่า

“การติดตั้ง XP กับ Linux โดยทั่วไปส่วนใหญ่จะทำการแบ่ง Partition ของ XP ให้มีพืนที่ว่างๆ ซัก 10 จิ ด้วยโปรแกรมจัดการ Partition อย่าง Norton Partition Magic”

ถ้าคุณทำไว้แล้วใน Windows XP ตัว Ubuntu จะมีเมนู :“แนะแนว – ใช้พื้นที่ว่างต่อเนื่องที่ใหญ่ที่สุด์” ให้เลือกในหัวข้อนี้ ......แต่วิธีของบทความนี้ จะให้ Ubuntu จัดการพื้นที่ของฮาร์ดดิสก์เอง เมื่อถึงหน้านี้ Ubuntu จะทำการดึงพืนที่ว่างๆ ของฮาร์ดดิสก์ที่มี XP ติดตั้งมาใช้งาน ตัวจัด Pattition ของ Ubuntu จะคำนวณพื้นที่ให้คุณเรียบร้อยตามภาพ แต่คุณก็สามารถเลือกเองได้โดยคลิกเลื่อนที่สไลด์บาร์ เมื่อได้พื้นที่ตามต้องการแล้ว คลิกปุ่ม ถัดไป


หน้านี้ระบบจะถามย้ำอีกที่ เพราะจะทำการ Format พื้นที่เพือ Ubuntu ให้คลิกที่ ดำเนินการต่อ


ระบบกำลังจัดพื้นที่ให้ Ubuntu

คลิกเพื่อดูภาพขนาดจริง

มาหน้านี้ Ubuntu จะถามว่าจะ Import ผู้ใช้งาน XP มาใช้กับ Ubuntu หรือไม่ ผ่านเลยครับ....ให้คุณคลิกปุ่ม ถัดไป

คลิกเพื่อดูภาพขนาดจริง

มาถึงการกำหนดชื่อ Account และ Password ที่จะเข้าระบบของ Ubuntu ให้เรียบร้อยแล้ว คลิก ถัดไป


คลิกเพื่อดูภาพขนาดจริง

หน้านี้จะสรุปรายการที่คุณกำหนดมาตั้งแต่ต้นทั้งหมด ทั้งชื่อ Account ภาษาที่ใช้ คีย์บอร์ดแบบไหน อาศัยอยู่ที่ไหน ระบบ XP อยู่ที่ฮาร์ดดิสก์พาร์ทิชั่นใด Bootpartition อยู่ที่ใด พาร์ทิชั่นของ Ubuntu ที่จะถูก Format ให้คลิก Install เลยครับเมื่อแน่ใจ ...... แล้วไปหากาแฟ กินซักแก้วได้เลยปล่อยให้มันติดตั้งไปจนจบ


เมื่อติดตั้งเสร็จก็จะมีหน้านี้ขึ้นมา ให้คลิกที่ เริ่มใหม่เดี่ยวนี้ เพื่อจะใช้งาน Dual Boot ได้ตามความต้องการ

คลิกเพื่อดูภาพขนาดจริง

เมื่อบูตเครื่องขึ้นมาใหม่คุณก็ได้เมนูสำหรับ Dual Boot Windows XP & Ubuntu ใช้งานตามประสงค์ โดยระบบจะตั้งค่า Default ไว้ที่ Ubuntu และจะเข้าระบบในเวลา 10 วินาที ถ้าไม่เลือกเมนูใดๆ ส่วน XP เก่าจะไปอยู่ที่ลำดับล่างสุดของรายการ

แถมท้ายบทความ

ปรับแต่ง GRUB (Bootloader)

เมื่อคุณๆ มี Dual Boot ของ XP และ Ubuntu แล้ว แต่ไม่ถูกใจกับเมนู อยากปรับแต่ง เช่น ต้องการ XP เป็นค่า Default ของระบบ หรือ ต้องการเปลื่ยนเวลาการบูต หรือจะเปลื่ยนชื่อของระบบก็ทำได้ครับ


ให้คุณเข้า Ubuntu ให้เรียบร้อย แล้วไปตามนี้ Application > เครื่องใช้ไม้สอย >เทอร์มินัล ( Applications>Accessories>Terminal กรณีใช้เมนูอังกฤษ)

คลิกเพื่อดูภาพขนาดจริง

เมื่อหน้าต่าง เทอร์มินัล เปิดออกมาให้ พิมพ์คำสั่ง

sudo gedit /boot/grub/menu.lst

ระบบจะถาม Password ให้คุณใส่ให้ถูก Ubuntu จะเรียก gedit ( Text Edit ของลินุกส์) และเปิดไฟล์ menu.lst ซึ่งเป็นไฟล์เมนูของ bootloader ซึ่งจะมีรายละเอียดตามตัวอย่างนี้

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=87229091-4f9f-4731-99bf-bde38caba150 ro
# kopt_2_6=root=/dev/sda3 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## ## End Default Options ##

title Ubuntu, kernel 2.6.20-15-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-15-generic root=/dev/sda3 ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault
boot

title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-15-generic root=/dev/sda3 ro single
initrd /boot/initrd.img-2.6.20-15-generic
boot
title Ubuntu, memtest86+
root (hd0,2)
kernel /boot/memtest86+.bin
quiet
boot

### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1


จุดที่จะแก้ไข

-การนับเวลาถอยหลังเพื่อทำการบูต

ให้คุณหาคำว่า timeout 10

ตรงตัวเลข 10 หมายถึงเวลาเป็นวินาที ที่ระบบจะนับถอยหลังให้ทำการบูตระบบ Default คุณตั้งไว้แก้ไขให้ช้าเร็วได้ ในกรณีไม่ให้ระบบนับคือเมื่อบูตมาต้องการให้แสดงเมนูเท่านั้นไม่ต้องนับถอย หลัง คุณจะ Enter เลือกบูตเองก็ให้ใส่เครื่องหมาย # ข้างหน้า ตัวอย่าง # timeout 10

-จัดอันดับรายการบูต

เชื่อได้ว่าส่วนใหญ่คนที่ใช้ Dual Boot ระหว่าง XP กับ Ubuntu มักจะอยากให้ XP เป็นตัวหลัก คือเป็นตัวเลือกแรกก็มีวิธี ให้คุณหาคำว่า

## ## End Default Options ##

ใต้คำนี้จะเป็นรายการเมนูต่างๆ ของระบบ Linux และ XP ให้คุณหาคำว่า

title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1


จะอยู่ด้านล่างสุด ให้คุณใช้วิธี Cut ข้อความดังที่กล่าว ไปปะแทรกระหว่างบรรทัดของ

## ## End Default Options ## และ title Ubuntu, kernel 2.6.20-15-generic

ระบบ Windows XP ก็จะเป็นตัวแรกของเมนู

-เปลื่ยนชื่อรายการ

หลังคำว่า title คุณจะเห็นว่าเป็นชื่อของระบบ คุณสามารถเปลื่ยนได้ตามใจคุณได้ เช่น
Ubuntu, kernel 2.6.20-15-generic ในที่นี่เปลื่ยนเป็น Ubuntu 7.04 Desktop

เมื่อทำการปรับแต่งแก้ไขแล้วก็เซฟ Restart เครื่องใหม่คุณก็จะได้ เมนู Dual Boot ตามแบบของคุณ

ตัวอย่างเมื่อปรับแต่งแล้ว

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
#timeout 10
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=87229091-4f9f-4731-99bf-bde38caba150 ro
# kopt_2_6=root=/dev/sda3 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## ## End Default Options ##

title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1


title Ubuntu 7.04 DeskTop
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-15-generic root=/dev/sda3 ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault
boot

title Ubuntu 7.04 (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-15-generic root=/dev/sda3 ro single
initrd /boot/initrd.img-2.6.20-15-generic
boot

title Ubuntu, MemoryTest
root (hd0,2)
kernel /boot/memtest86+.bin
quiet
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

คลิกเพื่อดูภาพขนาดจริง

อ้างอิงจาก http://www.pantip.com/tech/article/article.php?id=202

ไม่มีความคิดเห็น:

แสดงความคิดเห็น