LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-31-2006, 03:12 PM   #1
Diomedes
Member
 
Registered: Dec 2004
Distribution: Slackware 13
Posts: 113

Rep: Reputation: 16
Dual Boot Issue


I currently run on Ubuntu 6.06. Today I installed Windows XP Professional Edition so that I could use some Windows apps that I can not run in Wine. I was intending to dual-boot, but instead the XP installation deactivated my Linux partition and I can not boot into it. Windows does not mention dual-boot or multiple boot anywhere, and I am unsure of what Windows' bootloader is anyway. Can anyone help me dual-boot with Linux and Windows (and preferably make Linux the default)?

Thanks,
Diomedes
 
Old 10-31-2006, 03:25 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
You want to use this link, task B5. You should be able to use your Ubuntu install CD as the live CD.

Make sure that you mount and use the right partition. The example shown in the link uses /dev/hda4, which would be the fourth partition on the first IDE hard drive. You're basically looking for the root partition of your linux install. fdisk -l may help you figure out which one it is.
 
Old 10-31-2006, 11:03 PM   #3
Diomedes
Member
 
Registered: Dec 2004
Distribution: Slackware 13
Posts: 113

Original Poster
Rep: Reputation: 16
Thank you very much. I will try this out.
 
Old 11-01-2006, 02:50 AM   #4
Diomedes
Member
 
Registered: Dec 2004
Distribution: Slackware 13
Posts: 113

Original Poster
Rep: Reputation: 16
I got all the way to "grub-install /dev/sda" (sda is my primary hard drive where Linux is installed to sda1) and it says, "/dev/sda: not found or not a block device"
What does this mean? What exactly is going on?
 
Old 11-01-2006, 06:45 AM   #5
linux-india
LQ Newbie
 
Registered: Oct 2006
Posts: 16

Rep: Reputation: 0
Dear it is very easy to use Dual boot with linux.

Just first install Windows, and then install Linux - UUbuntu 6.06.
As then Grub will every time ask you that what you want to start?

pl. for more details steps installtion, google it.

or just ask us any specific thing, i will reply you.

Thanks.
With Warm Regards,
Ashish Barot.

Last edited by linux-india; 11-03-2006 at 07:57 AM.
 
Old 11-01-2006, 08:11 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
For linux-india: Yes, he can start over and do what you say. It will only take a few hours.
Let's see if we can fix the current setup first........

for Diomedes:
From the initial post, I infer that you could not get into Linux. How then are you doing grub-install? (Live CD?)

Assuming that you can get running on some kind of Linux, do "fdisk -l" (as root), and post the output here.

If you don't have a live CD, get one---eg Knoppix
http://www.knoppix.net/
 
Old 11-01-2006, 01:26 PM   #7
Diomedes
Member
 
Registered: Dec 2004
Distribution: Slackware 13
Posts: 113

Original Poster
Rep: Reputation: 16
I know I could redo everything, india, but I already have a sizable Linux setup. I already have XP installed as well, and I refuse to go through that hassle again unless absolutely necessary.

Yeah, I am using my Ubuntu CD (which doubles as a Live CD).
Here is the output of sudo fdisk -l:

Code:
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device     Boot     Start         End      Blocks   Id  System
/dev/sda1               1       10443    83883366   83  Linux
/dev/sda2   *       10444       14219    30330720    c  W95 FAT32 (LBA)
/dev/sda3           14220       14593     3004155    5  Extended
/dev/sda5           14220       14593     3004123+  82  Linux swap / Solaris
 
Old 11-01-2006, 01:47 PM   #8
Tehnoman
LQ Newbie
 
Registered: Oct 2006
Posts: 9

Rep: Reputation: 0
First you have to toggle the boot flag, so system uses proper partition to boot!
For changing the active (boot) partition, I used "parted", but I believe that You can do it with fdisk or some other programs. However in parted the operation is simple - I just entered command "flag", chose partition number (most probably 1 for you), selected "boot" flag and turned it "on". And that's it. Maybe you first have to switch off boot flag for partition 2, don't know, 'couse I had lost that flag completley. Then with "fdisk -I" check again to see whether the boot flag now stands for /dev/sda1.

I think that this should solve your problem. WinXP can't read Linux partitions so It couldn't delete grub files in your boot partition.

HOWEVER, if something is not right, make shure that you have {stage1,stage2,*stage1_5...} files in your /boot/grub directory, then chroot in /mnt/[your system mountpoint], run "grub", with "cat (" + "TAB" find correct disk and partition (my guess, it would be hd0,0 if you have only one HDD), enter "root (hd0,0)" (with TAB you can check whether it is your Linux partition, TAB should show folders located in / ). And if all is OK, then enter "setup (hd0)". Replace hd0 and hd0,0 with your own, if these are not correct. That's the way I have reinstalled grub tousand times...
 
Old 11-01-2006, 01:50 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
OK--so Windows is in sda2 (on a FAT32 partition!!)

I assume that the grub config file is still in /dev/sda1---in /boot/grub (you can check with the live CD, by mounting /dev/sda1)

To install grub to the mbr (from the live CD):
Code:
grub   (starts the grub shell)
root (hd0,0)    (tells grub that its files are on disk 1, partition 1  (grub counts from 0) )
setup (hd0)     (puts grub on the mbr of disk 1)
reboot   (REMOVE THE CD)
This **should** get you back into Ubuntu. Then you may need to edit the grub config file to correctly point to Windows (since it is not in the first partition)
 
Old 11-01-2006, 01:55 PM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by Tehnoman
First you have to toggle the boot flag, so system uses proper partition to boot!
I don't think so. OP installed Windows after Linux and thus Windows took over the mbr. Once GRUB is back in the mbr, the boot flag on the Linux partition is irrelevant. (None of mine are ever on)
 
Old 11-01-2006, 02:01 PM   #11
Tehnoman
LQ Newbie
 
Registered: Oct 2006
Posts: 9

Rep: Reputation: 0
Well, mbr is quite simple code, which only points, where next bootloader is located. And WinXP MBR looks, which partition is active (boot flag), as far as I remember.MBR codes are different indeed, I have experienced that in some cases boot flag is required to boot. Turning boot flag on wouldn't kill anyone either... Of course, grub setup to hd0 will solve all problems.

EDIT: The bootloader that refused to boot without boot flag, was EXTLINUX. Maybe I did something wrong, but seting boot flag "on" solved the problem...

Last edited by Tehnoman; 11-01-2006 at 02:12 PM.
 
Old 11-01-2006, 02:07 PM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I have installed Linux maybe 100 times on various machines---never used a boot flag yet.

We're straying off-topic here, but here's my hunch: AFAIK, Windows has NTLDR in the boot sector of its partition--and the Windows mbr code points there. Linux does not do it this way.
Having said this, now maybe I'll go poke around and see if that's right......
 
Old 11-01-2006, 05:28 PM   #13
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by pixellany
I have installed Linux maybe 100 times on various machines---never used a boot flag yet.

We're straying off-topic here, but here's my hunch: AFAIK, Windows has NTLDR in the boot sector of its partition--and the Windows mbr code points there. Linux does not do it this way.
Having said this, now maybe I'll go poke around and see if that's right......
I just did some checking, and this appears to be correct. It seems that partitions have 2 "empty" sectors at the beginning. For Windows, the NTLDR code is there. For Linux (at least ext3), they are empty---unless of course someone put grub or lilo there instead of in the mbr.

So.....does the Windows partition need a boot flag because NTLDR is there??
 
Old 11-01-2006, 10:21 PM   #14
Diomedes
Member
 
Registered: Dec 2004
Distribution: Slackware 13
Posts: 113

Original Poster
Rep: Reputation: 16
Well, I got it working. It turns out the problem was that I was going into the grub command line as a user. I entered "sudo grub" and it worked smooth as silk.
Thank you very much for your help, everybody.
 
  


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
Dual boot issue tntcoder Linux - General 4 08-06-2006 05:36 PM
dual boot issue ailstyn Linux - Newbie 6 06-01-2005 08:28 PM
Dual Boot Issue ZeppelinDL Mandriva 0 04-17-2004 11:52 PM
dual boot issue which won't go away penguincrazy Linux - Hardware 1 10-24-2003 10:34 AM
XP Dual Boot Issue taran Linux - Software 2 07-08-2003 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:34 AM.

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