LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 01-11-2012, 01:14 AM   #1
warriorjames
LQ Newbie
 
Registered: Jan 2012
Distribution: Mint, Manjaro, MX and Slackware
Posts: 18

Rep: Reputation: Disabled
Dual boot Opensuse/windows - grub 1.5 error 21


Ok, I have yet to see my situation anywhere (or if it is here, I haven't been able to 'officially' find it), so...

First, let me explain how things built up. My computer has 4 hard drives: 1 1TB Hard Drive (/dev/sdb), 1 250GB Hard Drive (/dev/sdd), and 2 1.5TB (/dev/sda & sdc) Hard Drives.

The main hard drive (The 1 TB hard drive), has Windows XP Media (C)(sdb1), The extended partition (sdb2), XP Home (D)(sdb5), Server 03 (E)(sdb6), Server 08 (set aside for when I get a copy; there's nothing on it) (F) and Win 7 (G)(sdb7).

The 2 1.5 TB hard drives are for when I create a RAID1 in Linux.

The 250GB Hard Drive is what Suse is on (Split into 3 partitions: a 2 GB(sdd1), a 20 GB(sdd2) and a 210.88 GB(sdd3)).

The instilation setup was as follows: Windows Media to sdb, Windows Home to sdb & Server 03 to sdb. That created the usual 'dual boot' screen for windows. The partition for server 08 was set aside and then Windows 7 was installed, which resulted in the dual boot saying 'Windows 7 and 'older versions'.

That's how things were before I got OpenSuse 11.3. When Suse was installed, I was amazed that it had it's own boot system (grub). When I selected 'Windows', it took me to the boot screen with 'Windows 7' and 'older versions'. This maintained itself with 11.4 and 12.1.

And then I had to pull live CD stuff.

Now, everything went fine initially. The ISO burner successfully created an OpenSuse 12.1 live CD (KDE). I then went in and checked out what it could do. Upon learning that could install from the CD, I clicked the 'install' icon on the live CD desktop and chose a 16GB flash drive, thinking it would install a version of OpenSuse onto the flash that I could use for emergency purposes.

The install to the flash drive appeared to be fine (it gained the name /dev/sde), and when it is plugged in I get the usual boot up screen, plus something else to boot to (/dev/sdd2). Choosing that takes me to the boot screen for Suse that on the hard drive. The problem is, when I take the flash drive out, it hangs on “grub loading 1.5 Grub error 21.”

When I have the flash inserted, and I mount the first partition of the flash (/dev/sde1), its name changes to /media/7768faf7-25b5-4d88-9fb5-c4dd71093c58. Now, remember that XP Media is on C, or /dev/sdb1. /dev/sdb1 is also the drive that has the asterisk in its row when you do fdisk -l through the terminal. On this partition, an almost exact copy of / (or root) is found...with a few exceptions.

When I mount the second partition of the flash (/dev/sde2), its name changes to /media/d1588e98-eab2-440d-99f2-8455bdc8427e. On this partition, the users are present (the one I created, plus one called linux~). Entering both folders take you to what would be the equivalent of /home/*user*

It's almost as if the install took part of what was on the hard drive and put it on the flash.

So...am I going to have to do a complete reinstall of Suse 12.1 to get things back to normal, or can I salvage this?
 
Old 01-11-2012, 09:52 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Quote:
So...am I going to have to do a complete reinstall of Suse 12.1 to get things back to normal, or can I salvage this?
Re-installing not required.

What happened when you installed to the flash drive goes as follows:
When you got the the point of the installation which asks where to install grub, you probably accepted the default which writes the first stage of grub (along with the partition table) to the first 512 bites of the drive (the MBR of the flash drive, if you will). Now you need the flash drive plugged in so that grub knows where to find the rest of it configuration and menu list on the flash drive. If you unplug the flash drive, boot hangs. Reinstall to the flash drive and choose to install grub to the root partition of the flash drive instead of to the MBR of the hard drive will fix the installation on the flash drive.

To repair boot from the hard drive, power up with the liveCD in the drive. Select the option to boot from hard drive to boot Opensuse from the hard drive instead of the flash drive.

Once booted, run grub-install to rewrite the grub installation on the MBR of the hard drive. You will then be able to boot your Opensuse and windows installations normally without the flash drive plugged in.

Last edited by bigrigdriver; 01-11-2012 at 09:56 AM.
 
Old 01-11-2012, 02:32 PM   #3
warriorjames
LQ Newbie
 
Registered: Jan 2012
Distribution: Mint, Manjaro, MX and Slackware
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thanks, bigrigdriver. I'll get to work on the flash, but while I was waiting for a respons for this....ok, I'll simplify this:

After I put this up, I lookes around for possible solutions, The two that I'm about to mention didn't work when I first tried them (which was 2 days before I registered here):
1. the reinstall/fix grub
1. boot to live CD, open terminal, su up, and type fdisk -l to find the linux boot partition.
2. type grub-install /dev/sdx (where x is the drive letter a,b etc)
3. reboot and test
2. I think this one adjusts grub somehow.
1. boot to live CD, open terminal, su up, and type grub to enter grub.
2. type find /boot/grub/stage1
3. type root (hdX,Y) (where X & Y are the numbers)
4. type setup (hd0)
5. quit & reboot
As stated, both of those didn't work the first few times I tried them. I tried both again last night after I had thrown the & realized, after I rebooted, that I got the normal screen (no /dev/sdd2 as a selection). I went in and found I was on the hard drive linux, not the flash. It wasn't until a few minutes before I went to bed that I remembered that I had mounted the 2 partitions on the flash (which I did for the purpose of writing this), and they were still mounted when I did those. Do you think the grub-install pulled what it needed off the flash and put it back into the MBR, or do you think it was a combination of the 2?

And would you mind walking me through what I need to do with the flash. I don't to repeat this whole event.
 
Old 01-11-2012, 06:06 PM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Quote:
Do you think the grub-install pulled what it needed off the flash and put it back into the MBR, or do you think it was a combination of the 2?
Noting would have been pulled off the flash drive. The grub-install re-wrote the first stage of grub in the MBR which gives the pointer to the location of the remainder of the grub stages, config file, etc.

This is what corrected the problem:
Quote:
1. boot to live CD, open terminal, su up, and type grub to enter grub.
2. type find /boot/grub/stage1
3. type root (hdX,Y) (where X & Y are the numbers)
4. type setup (hd0)
Step 3 - tell grub where the root of the OS is located (the one you want to boot normally).
Step 4 - tell grub where to write the first stage of grub with the pointer to the remainder of grub, along with the partition table.

With regard to what to do with the flash drive, boot into the flash drive, and run grub-install. Just be careful to specify grub-install /dev/sdd or whatever the flash drive is called. That will write the first stage of grub to the MBR of the flash drive with the pointer to the rest of grub on the flash drive. It would be a good idea to unmount all other partitions so that grub only sees the partitions on the flash drive, and write a grub.cfg accordingly. Otherwise, everytime you use the flash drive on any computer, you will see not only Linux on the flash drive, but also menu entries for the other OSs on your current computer.

I hope I've explained this well enough. Good Luck.

If you have any further problems, please start another thread, and refer back to this one.

Last edited by bigrigdriver; 01-11-2012 at 06:15 PM.
 
  


Reply



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
How to dual boot opensuse 11.3 and windows xp (opensuse 11.3 is installed first) varunb Linux - Newbie 13 11-10-2011 03:10 AM
grub error 18 windows xp and ubuntu dual boot 00000 Linux - Newbie 3 03-06-2010 07:16 PM
OpenSuSE 10.3 grub dual boot xp sp2 remove LVSuSE Linux - General 4 04-20-2008 06:23 AM
Grub 1.5 Error 21 when installing Debian/Windows dual-boot VinceIP Debian 15 01-30-2007 04:13 PM
Dual boot Linux with Windows: Grub Error 17 Veniogenesis Linux - Newbie 3 10-23-2005 09:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:08 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
Open Source Consulting | Domain Registration