Me Myself and My way

Posts tagged ‘ubuntu’

How to restore Grub from a live Ubuntu cd.

Author : catlett

Source : http://ubuntuforums.org/showthread.php?t=224351

—————————————————————-

This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see “sudo” that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)

Code:
sudo grub

This will get you a “grub>” prompt (i.e. the grub shell). At grub>. enter these commands

Code:
find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)

Code:
root (hd?,?)

Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr

Code:
setup (hd0)

Finally exit the grub shell

Code:
quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub’s files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it’s files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive’s mbr.
Quit will exit you from the grub shell.

Gutsy Gibbon

วันนี้ได้โอกาสอันดี (วันศุกร์ที่วันรุ่งขึ้นไม่ต้องไปไหน) ว่างๆก็เลยนั่งโหลด Ubuntu 7.10 มาลงซะหน่อย

เรื่องของเรื่องคือไอ้ pc ที่บ้านเนี่ยมันมี ubuntu ลงอยู่อยู่แล้ว แต่เนื่องจากการลง windows ใหม่ในครั้งก่อน ทำให้ grub มันถูกทับไปด้วย boot manager ของ windows (ซึ่งมักจะมองไม่เห็นอะไรทั้งสิ้นนอกจากตัวเอง -*-) จึงบูทเข้าไม่ได้ตั้งแต่นั้นมา และด้วยความที่ไม่ค่อยได้ใช้ ก็เลยไม่สนใจที่จะลง grub ใหม่

แต่วันนี้ด้วยฤกษ์งามยามดี ที่สัปดาห์นี้จะสอบ unix แล้ว ไอ้ในห้องเรียนก็ไมได้ตั้งใจทำ ตั้งใจฟังเท่าไร จึงทำให้ถึงคราวต้องกู้ชีพ ubuntu ที่บ้านเพื่อใช้ทำ lab เก่าๆเตรียมสอบ

แต่ไหนๆก็ไหนๆละ อยากลอง 7.10 ซะหน่อย เห็นเค้าว่ามี คอมป๊ง คอมปิ๊ซ (compiz) ให้เล่น ตื่นตาตื่นใจดี ก็เลยตัดสินใจโหลดมาใหม่ แล้วลง 7.10 ไปโลด

distro ที่โหลดมาเป็นของ ubuntuclub คือตอนแรกก็กะว่าจะโหลด original distro. เพราะเหมือนจำได้ว่า ตอน 6.10 ก็โหลดของ original มามันก็ไม่มีปัญหากะภาษาไทยนี่.. (แต่มีข้อแม้ว่าต้องเลือก language ตอนลงเป็น thai ด้วยนะ)

แต่ก็นะ ด้วยความอยากรุ้ อยากลอง ก็เลยโหลดของ ubuntuclub มา..

ขั้นตอน install ค่อนข้างจะแตกต่างจาก 6.10 พอสมควร แต่เรียกได้ว่าพัฒนาไปในทางที่ดีขึ้น(เยอะ)เลย ส่วนที่เห็นแตกต่างชัดก็คือไอ้ส่วน partition manager ที่เหมือนจะทำได้ดีขึ้น นอกจากนี้ยังสามารถ detect user ใน windows partition ได้ และสามารถ import documents and setting มาใช้ใน ubuntu ได้ด้วย (อันนี้ไมได้ลองอ่ะ ว่ามันเวิร์คไหม – -) แต่ก็นั่นแหละ การลงครั้งแรกของผมต้องหยุดลงที่ step นี้ ทั้งๆที่ผมไม่ได้เลือกให้มัน import บ้าบออะไรมาเลย แต่ installer ก็ดันค้างนิ่งซะงั้น..

ก็เลยต้องมาเริ่มลง เริ่มแบ่ง partition กันใหม่ พอไปถึงไอ้หน้าเลือก import ข้อมูลก็ลุ้นระทึก มันค้างอีกไหมฟะ.. ปรากฎคราวนี้ผ่านอย่างไว ชึบชับมาก พอผ่านตรงนั้นมาได้ มันก็เริ่ม copy file ละ ก็ปล่อยให้มันลงๆไป แล้วขึ้นไปนอนกลิ้งข้างบน..

สักพักกลับมาดู เอ้อ เสร็จละนี่หว่า แต่ไอวินโทรมาลากดอทพอดี ก็เลยไปดอทก่อนละกัน เด๋วค่อยมาเล่น..

หลังจากดอทเสร็จ ก็ลงมาเล่นๆ สิ่งแรกที่(พยายาม) จะเล่นเลย คือไอ้ compiz นี่แหละ เห็นขึ้นชื่อลือชา…

ปรากฎ.. จนป่านนี้ผมยังเล่นมันไม่ได้เลยพี่นอ้ง !!

คือ ก่อนอื่นจะใช้งานมันได้เนี่ย ก็ต้องไป enable extra visual effect ใน system > preference > appearance ก่อน เสร็จแล้วก็ต้องไปปรับ (config) มันใน system > preference > advance desktop effect setting อีก

ทีนี้ การจะใช้งานมันได้เนี่ย การ์ดจอของเครือ่งจะต้องรอบรับ open gl(x) อีก ซึ่งถ้าไม่รองรับมันจะไม่ให้เปิดการทำงานของ extra visual effect และนั่นคือสาเหตุที่ผมยังไมได้เล่นมันเลย..

คือ.. ไม่รู้ว่าการ์ดจอมันไม่ support จริงๆ หรือว่าระบบมันบ๊องเอง ตัวไดรเวอร์คิดว่าไม่น่าใช่ปัญหา เพราะดูใน Hardware Manager มันก็เป็นของ nvidia นะ.. แต่ยังไม่ได้ลอง update เหมือนกัน.. (จริงๆการ์ดจอมันควรจะ support นี่หว่า. gf5600xt มันก็ไม่ได้เก่าเข้ารกเข้าพงอย่างนั้นนะ..)

งือ นั่นแหละ ก็เลยพักมันไว้ก่อน ยังไม่เล่นก็ได้(วะ)..

พอมาเล่นส่วนอื่นๆ.. ภาษาไทยต้องบอกว่าเนียนดี แต่ไม่ดีที่สุด อย่างที่เขียนอยู่ตอนนี้ ถ้า scroll ขึ้นลงไปมา จะเห็นการกระพริบของวรรณยุกต์ชัดเจนเหมือนกัน แต่เรื่องสระลอยนั้นไม่มีเลย.. แต่มีการที่ตัวอักษรในเวบมันห่างกันแปลกๆ (ใน csxix.com นี่แหละ) ทั้งๆที่สระก็ไม่ลอย.. แต่ทำไมมันดันอยู่ห่างกันเองก็ไม่รู้ อาจจะเกี่ยวข้องกับ css ด้วยละมั้ง เพราะว่าในที่อื่นๆ ก็แทบจะไม่มีปัญหาอะไรเลย

นอกนั้นก็มีข้อเสียเดิมๆ ที่เจอมา 3 version 2 distro แล้ว (mandriva , ubuntu 6.1 – 7.1) คือ ไม่เข้าใจว่าทำไมเวลากด space bar ลบข้อความใน browser มันจะ delayๆ ล่ะ..

คือ ไม่รู้เคยเจอกันไหม แบบว่า กด backspace ค้าง แล้ว cursor มันวิ่งช้ามากๆ แต่พอปล่อยแล้วมันดันวิ่งไม่หยุด !! ซะงั้น มันก็ลบเลยจุดที่ต้องการไปไกลเลยอะเซ่… อยากบอกว่าเป็นบ่อยมาก… มันไม่เนียนเหมอืน windows อะ..

(ตอนแรกคิดว่าเป็นที่ settings แต่ไปลองปรับๆดูใน system > pref > keyboard แล้วมันก็ไม่เห็นดีขึ้น แถมใช้งานใน terminal หรือใน textbox ของโปรแกรมอื่นๆก็ไม่เป็น ชึบชับปกติดี แต่ใน firefox เนี่ย เป็นอย่างแรง…

งือ.. ใครพอจะรู้ทางแก้ก็รบกวนบอกด้วยนะ (หรือมันจะเกี่ยวกะ wysiwyg editor ของเว็บกันแน่ ?)

นอกจากนี้เจอปัญหาอีกอย่างนึง ก็คือลง add-on ของ firefox โดยผ่านทางระบบของมันโดยตรงไม่ได้ (ใครที่เคยใช้ window แล้วกด install missing plugin แล้วได้ นั่นแหละ.. ทำไมผมทำไม่ได้ในนี้ก็ไม่รู้) ไม่รู้ว่ามันไม่ได้อยู่แล้วเพราะเป็น *nix รึเปล่า หรือว่าอะไรมันเพี้ยนไปอีก.. แต่ที่รู้ๆ ก็คือต้องไปโหลด tar.gz มาแตกลงเครื่อง แล้วค่อยสั่ง install ผ่าน bash เอง.. คือ มันไม่ชึบชับเอาซะเลย…

งืมๆ บ่นไปเยอะล่ะ ทีนี้มาพูดถึงเรื่องที่ประทับใจกะ 7.10 distro ubuntuclub นี้หน่อยดีกว่า

  • default theme สวยมาก ทำคล้ายๆ vista ต้องบอกว่าสวยกว่า theme เลียนแบบหลายๆ theme ใน xp
  • ภาษาไทยค่อนข้างสมบูรณ์
  • installer ทำได้ดี
  • driver detect ได้ครบทุกตัว (แจ่มมาก…)

ไม่ร้จะเขียนไรแล้ว ยังเล่นไปไม่มากเท่าไรด้วย…จบมันดื้อๆงี้หและ – -*