reinstall grub2(ubuntu 9.10 or later) after overwriting boot section.........
2 posters
IITDU Forum :: TechTalks :: Ubuntu
Page 1 of 1
reinstall grub2(ubuntu 9.10 or later) after overwriting boot section.........
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............
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............
BIT0111-muctadir- Expert
- Course(s) :
- BIT
Blood Group : B+
Posts : 233
Points : 395
Similar topics
» Some necessary steps before you reinstall your ubuntu
» Changing the Ubuntu boot splash screen
» Two Boss function of Ubuntu in case of Boot failure
» About Microsoft Talkz and ImagineCup Boot Camp @ DU
» Microsoft Talkz & ImaineCup Boot Camp @ DU on Saturday
» Changing the Ubuntu boot splash screen
» Two Boss function of Ubuntu in case of Boot failure
» About Microsoft Talkz and ImagineCup Boot Camp @ DU
» Microsoft Talkz & ImaineCup Boot Camp @ DU on Saturday
IITDU Forum :: TechTalks :: Ubuntu
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Tue Sep 29, 2015 2:45 pm by Sophiawood
» Cisco EHWIC SFP/GE WAN Card
Mon Sep 07, 2015 11:08 am by Sophiawood
» Huawei S1700-28GFR-4P-AC Price
Thu Jun 25, 2015 2:31 pm by Sophiawood
» teach yourself C++ / Herbert Schildt Solutions
Wed Jun 03, 2015 1:52 pm by Abdullah Al Noman
» teach yourself c by herbert schildt pdf
Wed May 13, 2015 11:01 pm by Raquib Ridwan
» ASA 5506X With Firepower ASA5506-K9
Fri Apr 10, 2015 4:31 pm by Sophiawood
» New Trends in Deal Business
Tue Feb 03, 2015 9:38 pm by nersoa
» PoE Power Allocation for WS-C2960S-24PS-L
Wed Nov 05, 2014 11:12 am by Sophiawood
» How to cure back pain
Fri Oct 31, 2014 7:15 pm by Bergen Guildford