You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.9 KiB
32 lines
1.9 KiB
10 years ago
|
---
|
||
|
layout: post
|
||
|
status: publish
|
||
|
published: true
|
||
|
title: 'Linux 101: grub recovery'
|
||
|
author:
|
||
|
display_name: ''
|
||
|
login: ''
|
||
|
email: ''
|
||
|
url: ''
|
||
|
wordpress_id: 518
|
||
|
wordpress_url: http://blog.10ninox.com/2009/03/18/linux-101-grub-recovery/
|
||
|
date: '2009-03-18 14:41:40 +0700'
|
||
|
date_gmt: '2009-03-18 19:41:40 +0700'
|
||
|
categories:
|
||
|
- linux
|
||
|
tags:
|
||
|
- grub
|
||
|
- '101'
|
||
|
---
|
||
|
<p>When you messed with many OSs, boot strap loader might point to somewhere you don’t want it to be. grub considering the best – easiest? – to deal with many OSs and of course, it’s easy to tweak or  adjust as well.</p>
|
||
|
<p>Firstly get into any sort of shell. There are basically 2 parts needed to be done: set active partition and set MBR back to point at grub again. The first part is fdisk, there is ‘m’ for help. All you have to do is set the partition where grub is to active. Others are not. </p></p>
|
||
|
<p>The second part: set MBR point back to grub. That’s easy via grub command shell </p></p>
|
||
|
<p> <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="grub-shell" border="0" alt="grub-shell" src="http://blog.10ninox.com/wp-content/uploads/2009/03/grubshell.png" width="523" height="396" />
|
||
|
<p>The easiest way to find partition referenced by grub is to find it</p>
|
||
|
<p class="codebox">find /boot/grub/menu.lst</p>
|
||
|
<p>Then you have to set toot and setup the hard drive. Then you are all set. For grub menu, Linux needs</p>
|
||
|
<p class="codebox">Title XXX <br />   root (hd0,0) <br />   kernal /boot/vmlinuz root=/dev/…bla bla bla <br />   initrd /boot/initrd</p>
|
||
|
<p>For Windows, you just need to link to Windows boot loader again.</p>
|
||
|
<p class="codebox">Title Windows XX <br />   rootnoverify (hd0,0) <br />   chainloader (hd0,1)+1 # this is Windows partition.</p>
|
||
|
<p>That’s all you have to do. pretty easy, right?</p>
|