LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2011, 12:50 PM   #1
Aagam
LQ Newbie
 
Registered: Dec 2011
Posts: 25

Rep: Reputation: Disabled
things went wrong while restoring grub


hiiiiii everybody!!!
i had ubuntu 11.10
today i insatlled windows 7 and the follwed the following steps from a website to recover the grub after installation
1. Create NTFS partition using gparted.
2. Backup MBR using dd command e.g. “dd if=/dev/sda9 of=/mbr.bin bs=446 count=1″.
3. Boot Windows installation CD and install it onto newly created NTFS partition.
4. Boot into Linux live CD e.g. Ubuntu Live CD.
5. Restore MBR using dd e.g. “dd if=/media/sda9/mbr.bin of=/dev/sda bs=446 count=1″.
6. Reboot.

the problem is that when i start my system neither of windows and ubuntu start and system gets stuck showing something like |bes.|bes.
i have to use the live cd to use my pc....,
 
Old 12-28-2011, 01:13 PM   #2
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
I have to ask why did you go through such elaborate steps when ubuntu could have installed grub on itself (and perhaps would have even located the windows partition and made it bootable? Why did you not install the grub from ubuntu? You can still install grub from the ubuntu cd/dvd and get things working.
As far as I understand 'dd' - I tend _not_ to use it very often I believe the if=/dev/sda (someone correct me if I am wrong) as I belive windozed mbr is on the sda and not sdax.
Hope this helps.
 
Old 12-29-2011, 04:49 AM   #3
Aagam
LQ Newbie
 
Registered: Dec 2011
Posts: 25

Original Poster
Rep: Reputation: Disabled
i am not able to do that from live cd however this is output of sudo bash boot_info_script.sh
Code:
============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for  on this drive.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:  

sda5: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   According to the info in the boot sector, sda5 starts 
                       at sector 1232. But according to the info from fdisk, 
                       sda5 starts at sector 62461952.
    Operating System:  
    Boot files:        

sda6: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP
    Boot sector info:   According to the info in the boot sector, sda6 starts 
                       at sector 63.
    Operating System:  
    Boot files:        

sda7: __________________________________________________________________________

    File system:       
    Boot sector type:  -
    Boot sector info:  
    Mounting failed:   mount: unknown filesystem type ''

sda8: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  Grub2 (v1.99)
    Boot sector info:   Grub2 (v1.99) is installed in the boot sector of sda8 
                       and looks at sector 129576144 of the same hard drive 
                       for core.img, but core.img can not be found at this 
                       location.
    Operating System:  Ubuntu 11.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda9: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  
    Boot files:        

sda10: _________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   According to the info in the boot sector, sda10 
                       starts at sector 63.
    Operating System:  
    Boot files:        

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *             63    62,460,719    62,460,657   7 NTFS / exFAT / HPFS
/dev/sda2          62,461,950   312,560,639   250,098,690   f W95 Extended (LBA)
/dev/sda5          62,461,952   107,354,111    44,892,160   7 NTFS / exFAT / HPFS
/dev/sda6         229,204,143   312,560,639    83,356,497   7 NTFS / exFAT / HPFS
/dev/sda7         186,329,088   190,326,783     3,997,696  82 Linux swap / Solaris
/dev/sda8         107,356,160   144,375,807    37,019,648  83 Linux
/dev/sda9         190,328,832   229,197,823    38,868,992  83 Linux
/dev/sda10        144,376,218   186,321,869    41,945,652   7 NTFS / exFAT / HPFS


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs   
/dev/sda1        7910F5E72B92A211                       ntfs       windows7
/dev/sda10       66B08088B0806103                       ntfs       
/dev/sda5        BE4837424836F92B                       ntfs       Movie
/dev/sda6        84083AF3083AE3B8                       ntfs       Aagam
/dev/sda8        9ed5964e-61ff-4785-a755-bd2d60483b87   ext4       
/dev/sda9        a2ef5948-9d8f-4530-9241-0a9fc022c9c6   ext4       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sda10       /media/66B08088B0806103  fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda1        /media/windows7          fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda5        /media/Movie             fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda6        /media/Aagam             fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda8        /mnt                     ext4       (rw)
/dev/sda9        /media/a2ef5948-9d8f-4530-9241-0a9fc022c9c6 ext4       (rw,nosuid,nodev,uhelper=udisks)
/dev/sr0         /cdrom                   iso9660    (ro,noatime)


=========================== sda8/boot/grub/grub.cfg: ===========================
it shows that grub2 is present in mbr in /dev/sda but i am not able to boot....
 
Old 12-29-2011, 05:07 AM   #4
Aagam
LQ Newbie
 
Registered: Dec 2011
Posts: 25

Original Poster
Rep: Reputation: Disabled
hmmm thats fine i got it.i used this in terminal and ubuntu started working with next reboot....
grub-install --root-directory=/mnt/ /dev/sda
THNX EVEYONE
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[openbox] My autostart.sh file is not restoring things Removed44 Linux - Newbie 4 06-14-2010 10:31 PM
Need help restoring grub LinuxFrusss Linux - Newbie 23 03-29-2010 12:16 PM
Changing HD's and things go wrong brgsousa Linux - Software 4 08-23-2008 10:50 AM
restoring grub dasy2k1 SUSE / openSUSE 5 02-22-2007 09:57 PM
Is my PC too old for linux or am I doing things wrong? pauloszz Ubuntu 23 01-13-2007 07:16 AM


All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration