Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

  1. #1
    Join Date
    Jan 2008
    Beans
    37

    Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    Here's what gpared shows:


    Due to several reinstallations (xp -> vista -> xp again) I ended up with my main Windows OS on drive E:
    It still had an old unused windows partition on C: but i think it just served as mount point for the windwos bootselection.

    Now I finally decided to install ubuntu as regular os on my pc with the intention of killing the C: windows and keeping the E; windows.

    I successfully installed Ubuntu 8.04 on sda1 and it boots just fine.
    The Windows E: drive is located on sda6 but wasn't detected by grub, so I have to do it manually.

    So I opened /boot/grub/menu.lst and found this:
    Code:
    title		Ubuntu 8.04, kernel 2.6.24-16-generic
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.24-16-generic root=UUID=7997de24-3f8a-4a69-a6d8-d13f1fab4bce ro quiet splash
    initrd		/boot/initrd.img-2.6.24-16-generic
    quiet
    
    title		Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.24-16-generic root=UUID=7997de24-3f8a-4a69-a6d8-d13f1fab4bce ro single
    initrd		/boot/initrd.img-2.6.24-16-generic
    
    title		Ubuntu 8.04, memtest86+
    root		(hd0,0)
    kernel		/boot/memtest86+.bin
    quiet
    No mention of sda1 - although I guess it translates to hd0,0

    So, what do I have to put in there to be able to dual boot windows from sda6 ?

    Cheers!

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    sda1 -> (hd0,0)
    sda2 -> (hd0,1)
    ...
    sda6 -> (hd0,5)
    ...
    sdb1 -> (hd1,0)
    sdb2 -> (hd1,1)
    ...

    title Windows
    root (hd0,5)
    makeactive
    chainloader +1

  3. #3
    Join Date
    Jan 2008
    Beans
    37

    Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    Thanks, but I get an error:


    error 12: Invalid Device Requested


    I played a bit with grub (really cool feature being able to edit the bootloader configuration live), but the partition containing windows gets labeled invalid.

    I'm not sure, but I assume that windows wrote something on the c: drive which allowed it to boot other windows versions from non-primary partitions.

    any ideas (or better yet: experience?)

    Cheers!

  4. #4
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,100
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    Yes, in spite of all the hype about Vista's 'new boot manager', Windows ability to boot more than one operating system remains prehistoric.

    What has happened is, Windows has been allowed to set up a 'default Microsoft style dual boot' arrangement, and in so doing, your vital boot loader files from your later Windows operating system were copied over to your older system, which you have now deleted.
    One way to avoid this is to use GRUB or some other 'third party' boot loader to 'hide' the Windows partition that's on the hard disk before installing another Windows. Then both Windows installs will remain independant and retain their vital boot loader files.
    Here's a link for more information about what happened, http://www.goodells.net/multiboot/principles.htm, and here's the home page of that site, Understanding MultiBooting and Booting Windows from an Extended Partition.

    So, to get your operating system to boot now, you need to get back a copy of your vital boot loader files.
    I'm not sure how to do that with Vista. With Windows XP it was okay to go find another Windows XP install in another computer and copy the files ntldr, NTDETECT.COM and boot.ini, and paste those into the root of your Windows drive and boot.
    I don't even know what the boot loader files for Vista are called.

    The other things to do are to set the boot flag in your logical partition with GParted by right-clicking on the partition and clicking 'manage flags'. As far as I know, no boot loader can set the boot flag in a logical partition, but a partition editor can.
    Also, you need to comment out the 'makeactive' command from your Windows booting stanza in your /boot/grub/menu.lst. GRUB's 'makeactive' command is for setting the boot flag. Windows can't boot without a boot flag, and even though the boot flag is already there, GRUB will think it has to do it, and give you 'Error 12: Invalid device requested, Press and key to continue...', and fail.

    You should be able to boot your Vista with GRUB if you can do those three or four things.
    ie set boot flag, add boot loader files, delete 'makeactive' command and if needed, edit boot.ini as well.

    Actually, after re-reading your posts, I'm still a little unclear if you have deleted Windows XP, and you're trying to boot Vista,, or the other way around. I'm just guessing that's it's Vista you want to boot.
    If it was XP you wanted to get going again, the CD from the following website, How to fix: NTLDR is missing, press any key to restart, not only contains the files you need, but also will boot Windows for you so you can edit boot.ni from within Windows itself.
    That CD may boot Vista too, I really don't know.
    The other way to do it is to use a Windows Installation CD, (that should contain the files you need), and run 'bootcfg /rebuild', if it's Windows XP, to generate a new boot.ini if none exists, or repair your old boot.ini if there is one. I don't know what command to use if you have Vista.

    If you have a floppy disc drive, another thing you can do is you can make a bootable floppy disc from another Windows computer. I don't know of another way to do it that will work, maybe with syslinux, I have yet to try that. You will be able to copy the boot loader files from the CD to the floppy disc using Ubuntu, and edit the boot.ini file in the floppy disk from Ubuntu to boot Vista (from the boot floppy). You must only edit letters and numbers, avoid making any new lines in the boot.ini file.

    Anyway, I'm sure you'll be able to get it to boot if you keep on trying and don't give up.

    Regards, Herman
    Last edited by Herman; April 25th, 2008 at 12:46 PM.
    Ubuntu user since 2004 (Warty Warthog)

  5. #5
    Join Date
    Jan 2008
    Beans
    37

    Wink Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    Thank you for your elaborate answer.

    Before I read your advice, I already tried some things by myself:

    I copied the boot.ini, ntdetect.com and ntldr files from another xp installation to the sda6 partition. And yes, it's Windows XP.

    I edited the grub entry:
    Code:
    title         Windows XP
    rootnoverify  (hd0,5)
    chainloader +1
    boot
    This made a difference because i didn't get the invalid device error anymore.
    Grub now tries to boot the partition, but I get stuck immedeatly afterwards, getting a fresh black screen with the message:
    Code:
    Starting up ...
    or so in the top left.

    I'm not sure if that's a windows message or a grub message, but i suspect it's the former.

    Sadly I get no further messages thereafter since it's stuck there. I don't even get to "NTLDR is missing, press any key to restart"

    I'll read through the material you gave me but I don't understand why flagging the sd6 with boot could help. Wouldn't that mean that grub gets completely ignored because gparted removes the boot flag from the sda1 partition when I do that ?

    Anyway, thanks, I'll try some of those.

    Cheers!

    PS: About the xp/vista history: I started out with xp on c: and a big d: partition. I resized d: and created an e: partition for vista. I ran into the notorious vista multiboot problems some time later, got fed up and killed vista and installed xp on the now vacant e: partition, keeping the old and crowded XP on c: without ever using it. Now I installed ubunta on what was formerly c:. I hope that makes it clearer.
    Last edited by aroddo; April 25th, 2008 at 01:14 PM.

  6. #6
    Join Date
    Jan 2008
    Beans
    37

    Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)



    menu.lst
    Code:
    title		Windows XP
    root		(hd0,5)
    chainloader +1
    I copied the ntdetecd.com, ntldr and boot.ini to the XP partition.

    I flagged sda6 with boot.

    I still get the freeze at:
    Starting up ..
    And since it looks like a Grub message (i see that when booting ubuntu, too) I have to assume that grub detects the partition as bootable but doesn't do anything about it.

    After all, i should get at least some error messages saying that no OS is present or something along that line...

    doesn't look like there's an easy way out.

    [edit]
    Just for the heck of it I changed the root to (hd0,4) and got the exact same result. looks like there's more to it than just setting flags and copying files.
    Last edited by aroddo; April 25th, 2008 at 03:11 PM.

  7. #7
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    Boot your Windows XP Installation CD and enter the Recovery Console. Try to restore the boot sector of the partition:
    Code:
    FIXBOOT E:

  8. #8
    Join Date
    Feb 2007
    Location
    Maryland, USA
    Beans
    3,396
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    I have heard that Windows will not boot on a logical partition, only on a primary partition. Since /dev/sda5 is a logical partition, could this be your problem? The "Starting up..." is coming from grub, but it gives that message and hands control over to the boot loader. It is not a grub error, just grub's last message. Grub is chainloading the first sector of the target partition, then jumping to it. If that sector contains garbage, it will freeze, and not give an error. Or, if it is a Windows boot loader, any errors would be expected to come from the Windows loader. So, really, your problem is with the Windows boot loader, or with the Windows boot sector, and not with grub. The grub menu seems to be set up correctly. I suspect that your Windows is set up to boot, or is not happy being on a logical partition.

  9. #9
    Join Date
    Jan 2008
    Beans
    37

    Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    Fixboot E: didn't help although truth be told I had to type Fixboot D: since for some arcane reasons my e: drive shows up as d: in the recovery console.

    I also managed to boot XP with the help of the boot-cd found here: http://tinyempire.com/notes/ntldrismissing.htm

    I got it running by picking the fifth option, which amounts to a boot.ini entry of

    multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Micro soft Windows XP Professional"
    I have no idea how that entry relates to the real world, but that's not my problem since I can't even get there using grub.

    Right now I don't see any solution apart from stuffing the windows bootloader on a primary drive and then reinstalling ubuntu. and I just know that this will screw up in a slightly different way.

    I'd prefer to convince windows to accept it's place on that logical partition but in case it doesn't, does anyone know the best way to get the windows bootloader(or whatever) on a primary partition without having to install the whole windows crap AND keeping grub for choosing what to boot ?

  10. #10
    Join Date
    Feb 2007
    Location
    Maryland, USA
    Beans
    3,396
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Grub configuration with partition Ubuntu (sda1) & Windows (sda6)

    If Windows boots after fixboot d:, and your boot.ini shows that the Windows partition is no. 3, try to chainload with root (hd0,4) again.
    Code:
    root		(hd0,4)
    makeactive
    chainloader +1
    You can enter these commands at the grub menu by pressing 'c' to get a command line. If you do it that way, you might have to also enter boot after the commands to make it go. Or, you can edit the /boot/grub/menu.lst file.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •