Wilders Security Forums  

Go Back   Wilders Security Forums > Software, Hardware and General Services > all things UNIX
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread
  #1  
Old April 3rd, 2010, 11:25 AM
taytong888 taytong888 is offline
Regular Poster
 
Join Date: Mar 2006
Posts: 96
Unhappy Pls. help repair/restore grub in multiboot system

Hi,

I have a laptop with 250 GB SATA HD that has the following:

Win7 Pro installed first with sda1=system reserved partition, sda2=C: drive, sda5=separate software application programs to differentiate from Windows' Program Files. Ubuntu 9.10 was installed next (sda6=common swap partition for all Linux distros, sda7=Ubuntu root, sda8=Ubuntu home). Then Opensuse 11.2 was installed with sda12=root and sda13=home. Finally FedoraCore11 was installed with sda9=boot, sda10=root and sda11=home. Ubuntu and Suse have grub loader in their own root partitions.

Suse's grub menu controls all OS's. From this grub menu I can select Windows or any other Linuxes. Suse uses legacy grub because it was installed right after Ubuntu 9.10 which uses (legacy) grub.

Here is opensuse's grub menu:

# Modified by YaST2. Last modification on Wed Mar 31 11:49:28 EST 2010
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 1
timeout 15
##YaST - generic_mbr
gfxmenu (hd0,11)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Debug -- openSUSE 11.2 - 2.6.31.12-0.2
root (hd0,11)
kernel /boot/vmlinuz-2.6.31.12-0.2-debug root=/dev/disk/by-id/ata-Hitachi_HTS543225L9A300_090707FB2D00LJCT6UGB-part12 resume=/dev/disk/by-id/ata-Hitachi_HTS543225L9A300_090707FB2D00LJCT6UGB-part6 splash=silent quiet showopts vga=0x317
initrd /boot/initrd-2.6.31.12-0.2-debug

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.2 - 2.6.31.12-0.2
root (hd0,11)
kernel /boot/vmlinuz-2.6.31.12-0.2-default root=/dev/disk/by-id/ata-Hitachi_HTS543225L9A300_090707FB2D00LJCT6UGB-part12 resume=/dev/disk/by-id/ata-Hitachi_HTS543225L9A300_090707FB2D00LJCT6UGB-part6 splash=silent quiet showopts vga=0x317 acpi=off noapic
initrd /boot/initrd-2.6.31.12-0.2-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.2 - 2.6.31.12-0.2
root (hd0,11)
kernel /boot/vmlinuz-2.6.31.12-0.2-default root=/dev/disk/by-id/ata-Hitachi_HTS543225L9A300_090707FB2D00LJCT6UGB-part12 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x317
initrd /boot/initrd-2.6.31.12-0.2-default

###Don't change this comment - YaST2 identifier: Original name: Ubuntu 9.10, kernel 2.6.31-20-generic (/dev/sda7)###
title Ubuntu 9.10, kernel 2.6.31-20-generic (/dev/sda7)
rootnoverify (hd0,6)
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title Windows 7_Professional_32-bit
rootnoverify (hd0,0)
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title windows 2
rootnoverify (hd0,1)
chainloader +1

###Add Fedora Core 11 to the GRUB menu###
title Fedora Core 11 on /dev/sda10 (root partition sda10)
configfile (hd0, /grub/grub.conf

$fdisk -l gives:

Device Boot Start End Blocks Id System
/dev/sda1 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 3200 25600000 7 HPFS/NTFS
/dev/sda3 * 3201 15332 97450290 5 Extended
/dev/sda5 3201 6387 25599546 7 HPFS/NTFS
/dev/sda6 6388 6514 1020096 82 Linux swap / Solaris
/dev/sda7 6515 7534 8193118+ 83 Linux
/dev/sda8 7535 8519 7911981 83 Linux
/dev/sda9 11560 11582 184716 83 Linux
/dev/sda10 11583 13390 14522728+ 83 Linux
/dev/sda11 13391 15332 15599083+ 83 Linux
/dev/sda12 8520 10057 12353953+ 83 Linux
/dev/sda13 10058 11559 12064783+ 83 Linux

My problem is that while trying to fix a problem upgrading Ubuntu 9.10 to 10.04 LTS beta1 which I eventually overcame, I misunderstood about grub and thought I would have to (re)install grub to Ubuntu because sudo gedit /etc/boot/grub/menu.lst gives a blank file (I found out much later this is because Ubuntu 10.10 uses grub2 which replaces grub's /etc/boot/grub/menu.lst with /etc/boot/grub/grub.cfg). Following a recent Ubuntuforums tutorial entitled"Grub/XP/Vista Boot Loader", I did the following commands to restore grub to Ubuntu:

sudo mkdir /media/sda7

sudo mount /dev/sda7 /media/sda7

Install grub to /dev/sda as (hd0):

sudo grub-install --root-directory=/media/sda7 /dev/sda

Then I only saw Ubuntu's grub menu. In a panick, I tried to reverse the above in order to install grub back to opensuse (sda12) hoping to get back to the way it was before:

sudo mkdir /media/sda12

sudo umount /dev/sda7 /media/sda7

sudo mount /dev/sda12 /media/sda12

sudo grub-install --root-directory=/media/sda12 /dev/sda12

Somehow I also messed up Windows' boot file and boot partition table. Now I am still trying to use Windows installation CD to repair Windows but it has taken several hours and am still waiting for screen response. I cannot boot into any Linux distro either.

I would very much appreciate your help restoring grub so that I can boot into Windows and any Linux distros.
  #2  
Old April 4th, 2010, 09:35 AM
Ocky's Avatar
Ocky Ocky is offline
Very Frequent Poster
 
Join Date: May 2006
Location: George, S.Africa
Posts: 2,537
Default Re: Pls. help repair/restore grub in multiboot system

Suse uses grub legacy, so to install to sda12 isn't it ..... ?

sudo grub
find /boot/grub/stage1
root (hd?,?)
setup (hd0)
quit
sudo reboot


sudo grub
root (hd0,11)
setup (hd0)
quit
sudo reboot
__________________
Ubuntu Kubuntu Xubuntu Scientific Linux
  #3  
Old April 4th, 2010, 10:43 AM
taytong888 taytong888 is offline
Regular Poster
 
Join Date: Mar 2006
Posts: 96
Default Re: Pls. help repair/restore grub in multiboot system

Thanks for your reply. Yesterday my laptop took 8-10 hours+ to do a startup repair and even when I finally was able to boot into Win 7, I still have to do another system restore and clean up. Windows repair wiped out all my Linuxes so I have to do some partitioning and Linux re-installation!

Is there a way to set up GRUB/GRUB2 for a multiboot system such that if one system crashes, e.g. either Windows or one Linux OS crashes, I can still boot into the remaining ones?

Thanks in advance.

Last edited by taytong888 : April 4th, 2010 at 10:51 AM. Reason: revision
  #4  
Old April 4th, 2010, 11:20 AM
Ocky's Avatar
Ocky Ocky is offline
Very Frequent Poster
 
Join Date: May 2006
Location: George, S.Africa
Posts: 2,537
Default Re: Pls. help repair/restore grub in multiboot system

Sorry to hear that - very frustrating indeed.
Anyway for starters have a look here (How to make a dedicated grub partition)....
http://members.iinet.net/~herman546/...GRUB_Partition

If using Suse to boot the OS's then, this ....

http://members.iinet.net/~herman546/...rub_Partition_
__________________
Ubuntu Kubuntu Xubuntu Scientific Linux

Last edited by Ocky : April 4th, 2010 at 11:33 AM.
  #5  
Old April 4th, 2010, 11:35 AM
mack_guy911's Avatar
mack_guy911 mack_guy911 is offline
Very Frequent Poster
 
Join Date: Mar 2007
Posts: 2,483
Default Re: Pls. help repair/restore grub in multiboot system

best way make your windows install 1st and from windows you can use easybcd tool

2nd if you want to put grub 1st then put it separately what i did is i got 2 disk one from windows second for linux and from linux i make 1st drive of my fedora 1024 mb for boot (grub install) then / and then home all different and other linux with grub in their root so i my root go away i dont need to worry i still boot from grub others only my root wont work

3rd please backup your menu.lst from grub you can check and add manually changes if anything happen

and make a backup of your hardisk or clone from software like paragon or clonezilla it make you restore in 5-10 mins you get everyting till backup date dont need to install and tweak every thing in window make a backup atleast once in the month specially for windows at least it save you from lot of pain from installing everything
  #6  
Old April 4th, 2010, 12:16 PM
taytong888 taytong888 is offline
Regular Poster
 
Join Date: Mar 2006
Posts: 96
Default Re: Pls. help repair/restore grub in multiboot system

Hi mack_guy911,

Thanks for your reply.

1. Did try using Easybcd v2beta1 which works with windoz 7 and ubuntu but didn't work well if opensuse was installed later but wants to control grub.

2. Two hard disks would be ideal but that is for a desktop. I only have one hard disk in my laptop.

3 & 4. Point taken.

Thanks a lot.
  #7  
Old April 4th, 2010, 12:19 PM
taytong888 taytong888 is offline
Regular Poster
 
Join Date: Mar 2006
Posts: 96
Default Re: Pls. help repair/restore grub in multiboot system

Hello Ocky,

Thanks for giving me the 2 links. Will the procedure in Link#2 work with Grub2?

Have a nice day!
  #8  
Old April 4th, 2010, 12:32 PM
Ocky's Avatar
Ocky Ocky is offline
Very Frequent Poster
 
Join Date: May 2006
Location: George, S.Africa
Posts: 2,537
Default Re: Pls. help repair/restore grub in multiboot system

I am not an expert , but I think you can just make chainloader entries for the other OS,s.
Quote:
6) Delete all the old operating system boot entries in the new GRUB partition's menu.lst file and replace them with Operating System entries for multibooting other Linux Systems instead, and Windows Operating System Entries.
You can also delete the entire Debian Automagic Kernels List too. Since the menu.lst file isn't in an operating system anymore, the Debian Automagic Kernels List won't be needed.

Quote:
Once your grub partition is in place, adding a distro is as simple as installing that distro, then mounting the grub partition, and adding the new distro's grub boot information (menu.lst) to the boot distro's menu.lst, and then resetting the hard disk MBR to point to the grub partition.
__________________
Ubuntu Kubuntu Xubuntu Scientific Linux

Last edited by Ocky : April 4th, 2010 at 02:37 PM.
  #9  
Old April 4th, 2010, 12:34 PM
mack_guy911's Avatar
mack_guy911 mack_guy911 is offline
Very Frequent Poster
 
Join Date: Mar 2007
Posts: 2,483
Default Re: Pls. help repair/restore grub in multiboot system

youre welcome taytong888 but if you like you can use a external small usb drive i use that on my brother laptop most of times as he dont want me to install linux on his machine

i mean these kinda if you like you can use them as well

http://nexus404.com/Blog/wp-content/...ive-detail.jpg
  #10  
Old April 4th, 2010, 01:07 PM
mack_guy911's Avatar
mack_guy911 mack_guy911 is offline
Very Frequent Poster
 
Join Date: Mar 2007
Posts: 2,483
Default Re: Pls. help repair/restore grub in multiboot system

Quote:
Originally Posted by taytong888

1. Did try using Easybcd v2beta1 which works with windoz 7 and ubuntu but didn't work well if opensuse was installed later but wants to control grub.


sorry i didnt try easybcd v2 beta i use fedora grub i am not an expert but what i did was

http://www.wilderssecurity.com/showt...22#post1645522

please check fedora forums link as well
  #11  
Old April 4th, 2010, 05:55 PM
taytong888 taytong888 is offline
Regular Poster
 
Join Date: Mar 2006
Posts: 96
Default Re: Pls. help repair/restore grub in multiboot system

Hi again mack_guy911,

Which open source software do you recommend that can do whole disk & partition image backup and restore on both Windows 7 and Linux operating systems? Can Paragon and Clonezilla do this on multiboot systems?

Thanks for your help.
  #12  
Old April 5th, 2010, 11:26 AM
mack_guy911's Avatar
mack_guy911 mack_guy911 is offline
Very Frequent Poster
 
Join Date: Mar 2007
Posts: 2,483
Default Re: Pls. help repair/restore grub in multiboot system

yes

what they are doing it mirroring your data sector by sector regardless of operating system

both are capable of backup partition and cloning

for paragon please dont split image make it one if you use live winPE cd its recommended

http://www.wilderssecurity.com/showthread.php?t=269237

for Free Imaging software - CloneZilla & PartImage - Tutorial

please check mrk forum its great

http://www.dedoimedo.com/computers/f..._software.html

Last edited by mack_guy911 : April 5th, 2010 at 11:32 AM.
  #13  
Old April 5th, 2010, 11:41 AM
mack_guy911's Avatar
mack_guy911 mack_guy911 is offline
Very Frequent Poster
 
Join Date: Mar 2007
Posts: 2,483
Default Re: Pls. help repair/restore grub in multiboot system

also please read this one as well

http://www.wilderssecurity.com/showthread.php?t=258481

http://www.dedoimedo.com/computers/grsync.html
 

Wilders Security Forums > Software, Hardware and General Services > all things UNIX « Previous Thread | Next Thread »

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 11:57 AM.


Powered by vBulletin® Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2013, Wilders Security Forums