Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)?
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.
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?
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
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...
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)
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)
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...
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 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??
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.