reinstall grub2(ubuntu 9.10 or later) after overwriting boot section......... 5 5 2

reinstall grub2(ubuntu 9.10 or later) after overwriting boot section.........

View previous topic View next topic Go down

reinstall grub2(ubuntu 9.10 or later) after overwriting boot section.........

Post by BIT0111-muctadir on Fri Jan 15, 2010 4:23 pm

Using the Ubuntu Desktop/Live CD




Overwriting the Master Boot Record


WARNING


Do not use Ubuntu 9.10 live CD to restore the boot loader from a previous version.


The first step is to boot from a Live CD and open a
terminal. You will need to run a few commands as root. One option is to
first run sudo -i which will send you to a root shell from which you will simply run the commands without the sudo
prefix. Be extremely careful when running a root shell, especially for
typos! Even an extra space can do damage to your system. Always backup
on external media before attempting recovery, if at all possible.
Next we will need to find the partition in which your Ubuntu system is installed. Type the command fdisk -l. It will output a list of all your partitions. Example :
fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

create a mountpoint for your partition, for example:
mkdir /media/root


Then mount your partition in it. If you don't know
which one it is, then mount any of them, we will determine if it is the
correct one.
mount /dev/sda2 /media/root
Replace /dev/sda2 with the correct name of your partition. To check if it is the correct one, run ls /media/root which should output something like this:



cdrom initrd.img media proc selinux tmp vmlinuznow,
run
ls /media/root/boot, which should output something like this :



Once again, if what you have is not similar, unmount it and try another partition.


Now that everything is mounted, we just need to reinstall GRUB:
sudo grub-install --root-directory=/media/root /dev/sda
If you get BIOS warnings try:
sudo grub-install --root-directory=/media/root /dev/sda --recheck

If all went well, you should see something like this:
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0) /dev/sda
Now restart your pc and remove the cd............

_________________________________________________________________
microsoft provides you windows........
ubuntu gives you the whole home..........
---------------------------------------------------------------------------------
Don't forget to visit my blog for more tutorials.....

BIT0111-muctadir
Expert
Expert

Course(s):
  • BIT

Blood Group: B+
Posts: 233
Points: 395

View user profile

Back to top Go down

Re: reinstall grub2(ubuntu 9.10 or later) after overwriting boot section.........

Post by BIT0129-Tabassum on Mon Apr 11, 2011 12:19 am

Thanks man Smile

rep++

_________________________________________________________________
মানুষ তার স্বপ্নের সমান বড়

BIT0129-Tabassum
Global Moderator
Global Moderator

Course(s):
  • BIT

Blood Group: A+
Posts: 1496
Points: 2297

View user profile http://probe-tabassum.blogspot.com

Back to top Go down

View previous topic View next topic Back to top


Permissions in this forum:
You cannot reply to topics in this forum