Jump to content


Grub


  • Please log in to reply
33 replies to this topic

#1 OFFLINE   zeek

zeek

    Message Adept

  • Members
  • PipPipPip
  • 62 posts

Posted 14 January 2010 - 11:58 PM

Useful tools to help in recovery of the GRUB bootloaderNB: Continued on post #18, and post #27, and post #290) Bruno's Tips1) Supergrub Disk (SGD): It's menu is a bit cryptic at firstFor example:   GRUB => MBR & !LINUX! (1) AUTO

means install/re-install GRUB into the MBRthen boot into Linux and do this automaticallythe (1) means you have only one partition on the hard-drive

As of this date, their wiki site is down (has been for awhile). but via this link one can at least see the basic look and steps involved.When 1st booting up the SGD you will be greeted with a screen.From here, one has a few options.1) Quick Method --> Automatically fix the MBR.  Basically:

  1a) If only have 1 GNU/Linux distro, and want to re-install GRUB, then Select the option:  GRUB => MBR & !LINUX! (1) AUTO 1b) If have more than 1 distro and want to re-install GRUB, then Select:    GRUB => MBR & !LINUX! (>=2) MANUAL  Then pick the partition that holds the distro that initially loaded Grub into the MBR

2) Classical Method --> SGD still does the work for you  

Select "Choose a Lang & HELP" option   then, select "English Super Grub Disk" (obviously, choose your language)   then, select "GNU/Linux"   then, select "Fix Boot of GNU/Linux"   then, in the window select the partition that holds [ /boot ]   then, in a few short seconds it states: "SGD HAS SUCCEEDED"

3) Manual Method - Select the Advanced option and walk through the options. At each step SGD does tell you what it is about to do and one uses the arrows keys to select the proper options.   Question: Does anyone know if Super Grub will restore a Grub-2 booboo? (asked on another thread)

Tried to find out, but their wiki is still down. But, this link seems to suggest yes.Current version available is: 1.21 via mirror #0

2) Discover Boot Script at sourceforgeInitially referenced from Ubuntu forums (sorry, forgot link)

"DL script anywhere (eg, your Desktop), then run it as root# bash ~/Desktop/boot_info_script047.shcreates a results.txt file" and provides useful info for troubleshooting

3) Backup/Restore your MBRAs root (assuming the MBR you are using is located on the 1st hard drive (which is true for most of us)  
# dd if=/dev/hda of=bootsector.img bs=512 count=1
To restore back to the MBR  
# dd if=bootsector.img of=/dev/hda
4) menu.lstAs suggested on another thread, back up your menu.lst as well (printer or usb)NB: menu.lst is only part of Grub legacy (ie, it's no longer part of the newer version of Grub, called Grub2)CheersEdit #1: Expanded the options available on SGD & formattingEdit #2: Even if you choose not to use SGD, stepping through its menus does provide helpful info

Edited by zeek, 31 January 2010 - 08:00 PM.


#2 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,168 posts

Posted 15 January 2010 - 12:12 AM

Good info! :lol:

#3 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 22,993 posts

Posted 15 January 2010 - 02:47 AM

Thanks for the post Zeek!!
Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#4 OFFLINE   zlim

zlim

    It's me, plodr

  • Forum MVP
  • 7,013 posts

Posted 15 January 2010 - 10:20 PM

I'd like to interject a question.Currently I have 2K, XP and PCLinux with Grub handling the selection of OS.I'd like to "upgrade" XP to Win 7, once I figure out how much RAM this built computer (not built by me and haven't heard from the builder in a couple of years) can handle. Since Win 7 works differently, can this work for me if I do the upgrade? If not, any ideas on how to tackle this or is it a waste of time?
Liz
Registered Linux User # 401459
Posted Image

#5 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,168 posts

Posted 15 January 2010 - 11:02 PM

Windows will probably take over your MBR as soon as you upgrade, so be prepared... you're going to have to boot with another source (Live CD) and reinstall your PCLOS GRUB. Once you do that, then you should be able to chainload Windows just like you've been doing. You probably won't even need to change you menu.lst to do it.

#6 OFFLINE   zlim

zlim

    It's me, plodr

  • Forum MVP
  • 7,013 posts

Posted 16 January 2010 - 03:37 PM

Quote

you should be able to chainload Windows just like you've been doing.
I've heard the term - chainload windows but since I don't know how to do it, I don't think I'm doing it.I simply put in my SuperGrub boot floppy and went through the menus until I found one that said "repair windows mbr". That's what I picked.
Liz
Registered Linux User # 401459
Posted Image

#7 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,168 posts

Posted 16 January 2010 - 04:18 PM

I'll bet you are doing it. Post me a copy of your PCLOS /boot/grub/menu.lst here, please. :w00t:

#8 OFFLINE   zlim

zlim

    It's me, plodr

  • Forum MVP
  • 7,013 posts

Posted 17 January 2010 - 06:53 PM

timeout 10color black/cyan yellow/cyangfxmenu (hd1,5)/boot/gfxmenudefault 3title linuxkernel (hd1,5)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=fb6fb899-f5f1-4032-b701-0ef14d0b7b4f  acpi=on splash=silent vga=788initrd (hd1,5)/boot/initrd.imgtitle linux-nonfbkernel (hd1,5)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=fb6fb899-f5f1-4032-b701-0ef14d0b7b4f  acpi=oninitrd (hd1,5)/boot/initrd.imgtitle failsafekernel (hd1,5)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=fb6fb899-f5f1-4032-b701-0ef14d0b7b4f  failsafe acpi=oninitrd (hd1,5)/boot/initrd.imgtitle windowsroot (hd0,0)makeactivechainloader +1Well what do you know it shows chainloader +1 at the bottom. I guess I need to start reading up on this.  :w00t: Looking over the title listings, linux-nonfb is not showing at bootup. I guess I'll have to search to see what that means too.My mbr went south after I tried to install Ubuntu on my slave drive. I partitioned, using Ubuntu and then it said I needed to reboot. When I rebooted, Ubuntu started partitioning my master drive and royally screwed up windows. I used my True Image image and restored windows but when I tried to boot up, I got a screen filled with numbers. So I fired up my Super Grub boot floppy and fixed windows. Eventually I installed PCLinux 2009 and I guess that took over. Somewhere I have notes on what choices I made.
Liz
Registered Linux User # 401459
Posted Image

#9 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,168 posts

Posted 17 January 2010 - 07:58 PM

Once you upgrade that XP installation to the  the Windows 7 you were talking about, it may take control of your MBR again. Just fire up the PCLOS disk and I believe there is an option on that disk to repair your MBR/GRUB. Do that. Since you have a stock menu.lst (no customizations), you shouldn't even have to edit it for it to boot the newly upgraded Windows installation. As you see, you already have a chainloading entry for your existing XP. Since the upgrade will not change anything partition-wise for Windows, the existing chainload Windows entry will work fine. Easy-peasy! :(

#10 OFFLINE   zlim

zlim

    It's me, plodr

  • Forum MVP
  • 7,013 posts

Posted 18 January 2010 - 02:53 PM

Thanks Eric. I think I can handle that.First I need to hunt and see how much RAM this home built computer can handle. I'm not about to do any upgrade while running just 1GB of RAM. Stupid me, I had it open this morning because I had to replace the CMOS battery and I swapped out a case fan hoping to make it quieter. I was so busy cleaning, I didn't even bother looking to see how many slots for RAM on the motherboard. <sigh> Oh well, I wanted to open it up again because the case now seems to pick up a vibration. I may run it with the side off to see if I can get it quieter. It has been noisy from day 1 and I never was really thrilled with the amount of noise.I just opened it and there are three slots for RAM. 512 sticks in two of the slots. I might just buy 3 - 1GB sticks and put them in; provided the board (ASUS) can handle that.

Edited by zlim, 18 January 2010 - 03:48 PM.

Liz
Registered Linux User # 401459
Posted Image

#11 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,168 posts

Posted 18 January 2010 - 05:20 PM

More RAM = gooder. ;)

#12 OFFLINE   Temmu

Temmu

    The Assimilator

  • Forum MVP
  • 12,531 posts

Posted 19 January 2010 - 03:51 AM

good topic, zeek!any other recovery ideas?isn't there a disk imager out there in linux land?

Edited by Temmu, 19 January 2010 - 03:52 AM.

Posted Image

#13 OFFLINE   zlim

zlim

    It's me, plodr

  • Forum MVP
  • 7,013 posts

Posted 19 January 2010 - 08:34 PM

Quote

isn't there a disk imager out there in linux land?
PCLinux has one which I've used. I think it is called, Make LiveCDNot only did I use it to make a live cd copy of my 2006 PVCLinux install on my desktop but I also used it to install on my HP notebook! My notebook was so messed up that I figured trying to run it wasn't going to do any further damage. I was shocked when it installed and worked!
Liz
Registered Linux User # 401459
Posted Image

#14 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,168 posts

Posted 19 January 2010 - 08:46 PM

EDIT: Oops! I just realized it was temmu asking about this, not Liz. I'm sure there are quite a few hard drive cloning apps, Liz. I"ve never had the need for one, so I don't know of any to recommend to you at the moment. Also, you could always use the "dd" command in terminal --> http://www.brunolinu...dd_command.html

#15 OFFLINE   zeek

zeek

    Message Adept

  • Members
  • PipPipPip
  • 62 posts

Posted 20 January 2010 - 12:03 AM

Liz:
  • When updating Vista/Win7 via update packs one needs to consider the following: that it might be best to have Windows re-install its own bootloader into the MBR before doing the service pack updates.  And after Windows competes its updates re-intall your favorite Linux distro's GRUB back into the MBR. (don't remember where I read this)
  • Did everything work out OK????
  • Sorry that I didn't respond until now.
Temmu
  • Any other recovery ideas? I'm currently looking into Test-Disk
  • Disk Imager? Are you thinking of backing up the MBR this way?
Cheers

#16 OFFLINE   zlim

zlim

    It's me, plodr

  • Forum MVP
  • 7,013 posts

Posted 20 January 2010 - 04:45 PM

zeek, I haven't done this yet. I need to add more RAM before I consider "upgrading" for XP to Win 7.I've spent the last two days putting in and taking out a case fan. I'm trying to get the computer quieter. If I can't, I'm not going to waste money on RAM. My two current "work horses" my eeepc and an eMachines are so quiet that I really notice the noise on this 2K/XP/linux computer.My husband tells me I need to buy another computer. You have to love him because we have 8 computers in the house. :hysterical: 7 belong to us and one I will work on belongs to a friend. The last thing I need or want is yet another computer!
Liz
Registered Linux User # 401459
Posted Image

#17 OFFLINE   zeek

zeek

    Message Adept

  • Members
  • PipPipPip
  • 62 posts

Posted 20 January 2010 - 07:26 PM

Liz: Quiet is nice, mine likes to make its presence known to all who dare to come near. Wow! an octo-computer householdCheersPS: By the way, your husband is right - it's in the genes! (just kidding).

Edited by zeek, 22 January 2010 - 01:11 AM.


#18 OFFLINE   zeek

zeek

    Message Adept

  • Members
  • PipPipPip
  • 62 posts

Posted 20 January 2010 - 08:01 PM

Continuation of first post:Subject: menu.lst and chainloadingQuestion: What is going on when installing Gnu/Linux distros from GRUB's menu.lst file point of view?The discussion that follows shows the importance of the menu.lst file (and thus knowing which partition holds the GRUB files you need to re-install). When you are re-installing GRUB, you are also telling GRUB which menu.lst file to pay attention too - the one from distro_1 or the one from distro_2 or from distro_3, and so on.Overall Scenario:Windows already installedInstall the first distro, called distro_1Install another distro, called distro_2Assume:1 hard disk (hd0), with a few partitions on it(hd0,0) Windows  partition(hd0,1) Distro_1 partition(hd0,2) Distro_2 partitionBackground on menu.lst file:
  • The menu.lst file contains commands that boots the distro properly.
  • Each distro has its own menu.lst file with certain commands added that will boot that particular distro properly.
  • Each distro's menu.lst file is stored in the partition where the distro's own root directory is stored. It's stored in a subdir of root called boot. So:.    distro_1 menu.lst is located in the /boot subdirectory of (hd0,1).    distro_2 menu.lst is located in the /boot subdirectory of (hd0,2)
All distros install the same GRUB files, but different menu.lst files. GRUB is installed in 2 different places: into the MBR and in /boot subdir. The memu.lst file is installed into one place: the /boot subdir of that particular distro.1) Install the 1st GNU/Linux distro:
  • You want to install distro_1 into the (hd0,1) partition
  • Distro_1 will install the necessary GNU/GRUB file into the MBR
  • Then, distro_1 will install its own menu.lst into its own partition - that is, into the /boot subdirectory of the (hd0,1) partition.
  • Now, when you reboot the computer, you should see options to boot both distro_1 and windows.
  • The basic steps the computer goes through to boot distro_1 are: BIOS --> MBR --> the MBR says now go to the /boot subdir of (hd0,1) and find the menu.lst and run those commands
2) Install the 2nd distro:
  • You want to install distro_2 into the (hd0,2) partition
  • Distro_2 will want to install GRUB into the MBR
  • But, you already have GRUB in the MBR (when you installed distro_1). So, you tell it not to install into the MBR, but install the necessary GRUB files into the root partition instead.
  • This last step installs the remaining Grub files into the /boot subidr of the (hd0,2) partition. This will also install distro_2's menu.lst file into the /boot subdir of the (hd0,2) partition.
IF you now reboot the computer after just installing distro_2, you will still see the options to only boot distro_1 and windows. To boot distro_2, you have to manually add distro_2 as an option to the menu.lst that belongs to distro-1. When that is done, you can now boot distro_2.To boot distro_2, the process now is: BIOS --> MBR --> use menu.lst from distro_1 located in /boot of (hd0,1) partition. And IF the user wants to boot distro_2 (after adding this option manually), then go to the /boot of (hd0,2) and use the menu.lst located in (hd0,2) for instructions on how to properly boot distro_2.  This is an example of chainloading (ie, passing control to the config file that knows how to boot the distro you want to boot).In summary:In this scenario, when re-installing Grub - you need to know to choose to use the menu.lst from distro_1.  When using SGD, choose the partition that contains distro_1's /boot subdir - (hd0,1). The (hd0,1 partition will contain the menu.lst file with all the distros listed that you want to boot. NB:
  • The above is not complete (many details left out as there are a plethora of variations/options available)
  • Obviously, when installing distro_2, one could select distro_2 to write to the MBR. Then have distro_2 automatically write the proper commands into its own menu.lst file to boot all the other distros. Unfortunately, this doesn't always work because some distro_2s will not recognize the other distros and thus not write the proper commands to boot the other distros.
  • I selected the scenario to have distro_2 to install its bootloader into the root partitions instead of the MBR for a very good reason: it simplifies things and preempts problems (eg, kernel upgrades).
  • A newer version of GRUB is currently being tested. The newer version is called GRUB2, while the older one is called "Grub Legacy." Grub2 does not have a menu.lst among other differences, but the basic idea still holds - that each distro will need to install its Grub config file (eg, menu.lst) into its own partition in order to boot properly.
CheersEdit : formatting

Edited by zeek, 22 January 2010 - 01:06 AM.


#19 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 22,993 posts

Posted 20 January 2010 - 08:07 PM

Excellent Zeek!!!
Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#20 OFFLINE   Temmu

Temmu

    The Assimilator

  • Forum MVP
  • 12,531 posts

Posted 21 January 2010 - 05:46 PM

View Postzeek, on Jan 19 2010, 10:03 PM, said:

...Temmu
  • Any other recovery ideas? I'm currently looking into Test-Disk
  • Disk Imager? Are you thinking of backing up the MBR this way?
Cheers
good write-up!the disk imager - something that does a bit-wise copy of an entire hd...  a bit off-topic, but... :thumbsup:& looking fwd to the test-disk results!
Posted Image

#21 OFFLINE   sunrat

sunrat

    Thread Kahuna

  • Forum Moderators
  • 5,310 posts

Posted 21 January 2010 - 07:46 PM

Disk imager:ClonezillaI've always used partimage or dd, and that's what Clonezilla uses but with a more friendly interface.
registered Linux user number 324659  || The importance of Reading The *Fine* Manual! :D
Posted ImagePosted ImagePosted ImagePosted ImageKXStudio
For the things we have to learn before we can do them, we learn by doing them.

#22 OFFLINE   réjean

réjean

    Discussion Deity

  • Forum MVP
  • 4,467 posts

Posted 25 January 2010 - 11:52 PM

Someone should make a sticky out of zeek's post IMHO!
registered linux user #374889

#23 OFFLINE   Frank Golden

Frank Golden

    Migrant Nuclear Worker

  • Forum MVP
  • 1,516 posts

Posted 26 January 2010 - 06:01 AM

View Postsunrat, on Jan 21 2010, 03:46 PM, said:

Disk imager:ClonezillaI've always used partimage or dd, and that's what Clonezilla uses but with a more friendly interface.
I use partimage, been using it for quite sometime.It works with Windows (NTFS) and all flavors of linux.I presently maintain 6 images on a couple of Fat 32 USB flash drives and can restore them from there.Those 6 images are Win 7, XP Pro, Ubuntu Hardy 64 bit, Ubuntu Intrepid 64 bit and both KDE and Gnome versions of PCLinuxOS 2009.I just recently replaced them with fresh images after extensive system updates.The older images were waiting in the wings in case I screwed up the updates.Partimage only creates images of the used space of a partition.It has built in compression options to help keep the images fairly small.It also will split the image up into smaller pieces to accomodate storage on Fat 32 media.You can store the images on any type of media but a restore must be from Fat 32 or ext3 formatted media.I my case it takes about 24 minutes to create and store directly to a 16 GB Corsair thumbdrive my 9 GB Win 7 install.That's 9 GB of a 22 GB NTFS partition.I creates two images of less than 4 GB and with moderate compression that amounts to about 4.5 GB about half the size of the original used space.Restore from the thumb drive is very fast (about 4 minutes for the above example).The version I use is on the SystemRescueCD and the links below are for tutorials on how to use it from SystemRescueCD.The first link is for a how to I wrote and posted a couple of years ago at the Ubuntu forums.The second one is a more polished how to by another forum member based on my tutorial.He PM'd for permission before posting.http://ubuntuforums....ad.php?t=226402http://ubuntuforums....ad.php?t=287522Enough of partimage.More OT, I first began experimenting with Linux (Ubuntu Breezy) and dual/multibooting at about the same time.A fantastic source of info was a tutorial posted by an Aussie, hermanzone, that contained a wealth of knowledge aboutdual booting, GRUB and FSTAB. Recently his provider dropped support for his web site and after seeking advice at the Ubuntu forums he decided to keep the site alive with another ISP.If you had his old site bookmarked it won't work.Below is his new site.http://members.iinet...n546/index.htmlBelow is a link to the Ubuntu thread he sought advice from.http://ubuntuforums....d.php?t=1176678

Edited by Frank Golden, 26 January 2010 - 06:04 AM.

Frank Golden

Acer Aspire as5672WLMi, Core 2 Duo Merom (T7200/2.0 GHz) Centrino, 500 GB Seagate Momentus 7200 rpm (SATA) HDD,   4 GB Corsair DDR2-PC5300 ram, ATi Radeon X1400 (128 MB built-in vram/384 MB system ram),
Win 7 Home Premium | Ubuntu 10.04 LTS  & Ultimate Edition 2.8 | Mandriva 2010.2 Gnome | PCLinuxOS 2010 Gnome & KDE ]
Registered Linux User #423741
Registered Ubuntu User # 6235


"Any sufficiently advanced technology is indistinguishable from magic"-Arthur C. Clarke

#24 OFFLINE   Frank Golden

Frank Golden

    Migrant Nuclear Worker

  • Forum MVP
  • 1,516 posts

Posted 26 January 2010 - 12:39 PM

View Postsunrat, on Jan 21 2010, 03:46 PM, said:

Disk imager:ClonezillaI've always used partimage or dd, and that's what Clonezilla uses but with a more friendly interface.
Thank you, sunrat for the clonezilla link.I've been playing with it for the last couple of hours and I must say I'm impressed.It is slicker than partimage but more complicated and almost entirely GUI.It might be quicker than partimage after I get used to it.I can see me replacing partimage with is some day.I was able to use clonezilla to fix an issue I've had with partimage and Win 7.My Win 7 partimage would restore fine on my main HDD, no issues butI also have a spare HDD with the identical partition structure to my main drive.In the past when I created fresh images of my Windows and linux installs I would restore them to the spare drive so that I'd havea complete copy of my main drive in case my main drive failed.For some inexplicable reason restoring Win 7 partimages to my spare drive would fail to boot correctly.It would boot to the point of the welcome screen then and then hang.It would eventually finish to a blank desktop and a message that the copy of Win 7 was not genuine.XP and my linux images would install with no issues but Win 7 wouldn't.All this with partimage.Clonezilla avoids this problem entirely, sucessfully restoring Win 7 to my spare drive.I suspect the issue has something to do with my spare drive having a different serial numberfrom the drive Win 7 was initially installed on. Some kind of WGA issue.Again thanks, another great tool in my toolkit.

Edited by Frank Golden, 26 January 2010 - 01:00 PM.

Frank Golden

Acer Aspire as5672WLMi, Core 2 Duo Merom (T7200/2.0 GHz) Centrino, 500 GB Seagate Momentus 7200 rpm (SATA) HDD,   4 GB Corsair DDR2-PC5300 ram, ATi Radeon X1400 (128 MB built-in vram/384 MB system ram),
Win 7 Home Premium | Ubuntu 10.04 LTS  & Ultimate Edition 2.8 | Mandriva 2010.2 Gnome | PCLinuxOS 2010 Gnome & KDE ]
Registered Linux User #423741
Registered Ubuntu User # 6235


"Any sufficiently advanced technology is indistinguishable from magic"-Arthur C. Clarke

#25 OFFLINE   Temmu

Temmu

    The Assimilator

  • Forum MVP
  • 12,531 posts

Posted 26 January 2010 - 02:50 PM

thanks -sunrat for clonezilla frank for partimage!  :(
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users