Sunday 28 June 2009

how to restore your grub

methord 1
Insert your instalation cd or dvd to your drive
1)Now take a terminal by typing Alt+Ctl+F2
2)Find out the ext3 partition where you have installed your linux
this can be done by typing the cammand fdisk -l in the terminal,
for example
debian:/home/tonylijo# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x094e094d

Device Boot Start End Blocks Id System
/dev/sda2 * 1 19457 156288321 f W95 Ext'd (LBA)
/dev/sda5 4866 9730 39078081 7 HPFS/NTFS
/dev/sda6 9731 14595 39078081 83 Linux
/dev/sda7 1 4865 39078018 83 Linux
/dev/sda8 14596 15081 3903763+ 82 Linux swap / Solaris
/dev/sda9 15082 19457 35150188+ 83 Linux
3)now create a directory mkdir /linux
4)now mount the linux parrtition to this new directory
mount -t ext3 /dev/sda7 /linux
5)now make new root directory
chroot /linux
6)install grub to the master boot record
grub-install /dev/sda

methord 2:

Insert a live cd on your cdrom
boot linux from the live cd
now take a terminal or konsole
then type
grub in the terminal
then the screen will appear as

GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]

grub>
type root(hd0,x)
x=your linux partition no -1
after that type
setup(hd0)
now your grub will be re stored.....

3 comments:

  1. good work dude continue your work
    What about our free s/w community website???

    ReplyDelete
  2. Thank you for your attention on my article..... now we are engaged in building a web based app for our placement cell......so foss website is now dorment , sorry for that...

    ReplyDelete
  3. how can we restore grub in ubuntu 9.10?

    ReplyDelete