Jump to content


Photo

Grub2 on a windows drive


  • Please log in to reply
8 replies to this topic

#1 TinBane

TinBane

    Super Hero

  • Mod
  • 21,394 posts

Posted 22 August 2011 - 04:52 PM

I have a laptop with two physical hard drives. One is Ubuntu, one is Windows 7. I want to take out the ubuntu drive, but I've found that Ubuntu has helpfully set it up so GRUB2 is installed on the windows partition, and panics when the ubuntu one is absent. I don't have the windows disk which can reinstall the windows bootloader (sigh, OEM HP windows 7). When I try and configure the grub2 install, it configures it on the Ubuntu drive, not the Windows drive. How do I change the configuration so that the only entry is windows?
Romans 10:3 absit iniuria verbis

#2 TinBane

TinBane

    Super Hero

  • Mod
  • 21,394 posts

Posted 23 August 2011 - 10:06 AM

I have a laptop with two physical hard drives.
One is Ubuntu, one is Windows 7.
I want to take out the ubuntu drive, but I've found that Ubuntu has helpfully set it up so GRUB2 is installed on the windows partition, and panics when the ubuntu one is absent.
I don't have the windows disk which can reinstall the windows bootloader (sigh, OEM HP windows 7).

When I try and configure the grub2 install, it configures it on the Ubuntu drive, not the Windows drive.
How do I change the configuration so that the only entry is windows?


I tried using one of those super-grub disks that allows you to recover your windows boot whatsit, but it didn't load even in failsafe mode :(
Don't normally have an issue booting liveCDs.

I can still boot the Ubuntu partition, but I don't know how to change the Grub settings on the windows disk (non primary disk).

Edited by TinBane, 23 August 2011 - 10:07 AM.

Romans 10:3 absit iniuria verbis

#3 SledgY

SledgY

    Primarch

  • Atomican
  • 917 posts

Posted 23 August 2011 - 07:43 PM

Grub isn't installed entirely into the boot record, there is a small program installed which intern loads the main grub program off of another partition. Due to size constrains of the boot record grub supports only a few file systems. Likely NTFS isn't one of them and hence grub will be storing itself on your Ubuntu partition. To get grub onto the windows drive you are going to need a boot partition for grub to install itself into (this can be 20mb).
poweredbypenguins.org - SledgY lives in the cloud...

#4 TinBane

TinBane

    Super Hero

  • Mod
  • 21,394 posts

Posted 24 August 2011 - 12:00 PM

Grub isn't installed entirely into the boot record, there is a small program installed which intern loads the main grub program off of another partition.

Due to size constrains of the boot record grub supports only a few file systems. Likely NTFS isn't one of them and hence grub will be storing itself on your Ubuntu partition. To get grub onto the windows drive you are going to need a boot partition for grub to install itself into (this can be 20mb).



EDIT: Thanks for your help SledgY :)

You can't resize an NTFS partition can you?
If it was a mac, I'd resize my partition to make the 20MB free space needed.

Sigh, stupid windows. I guess I'll have to download a pirated copy of the windows CD, which actually has the utilities needed to fix the MBR.
Fuck you HP, fuck you microsoft.

Fixing a partition should be a core function of the OS, and any backup media it comes with.
The stupid HP/COMPAQ junk win7 disk I made from the laptop will only (and I mean ONLY) wipe everything back to factory settings.
It's like every other function the disk can have has been left off.

Edited by TinBane, 24 August 2011 - 12:00 PM.

Romans 10:3 absit iniuria verbis

#5 CptnChrysler

CptnChrysler

    Master

  • Atomican
  • 1,105 posts

Posted 24 August 2011 - 04:38 PM

Yep - It's a PITA.

You'll either need a windows disk or use something like EasyBCD to restore the windows boot loader.

Or you can create a small ext3 partition on the windows drive, copy the ubuntu /boot directory over, edit the grub configuration to point to the new directory and re-install grub.


Or re-install/restore windows

Any way you go it's a pain.

Edited by CptnChrysler, 24 August 2011 - 04:41 PM.

Everyone's entitled to my opinion! I've got the T-Shirt to prove it.

#6 TinBane

TinBane

    Super Hero

  • Mod
  • 21,394 posts

Posted 24 August 2011 - 04:40 PM

Cheers for that. I'll try using EasyBC, then move on to a pirate windows disk. If they don't work, I'm not sure what I'll do next. Probably erase the computer and sell it off.
Romans 10:3 absit iniuria verbis

#7 eckythump

eckythump

    Master

  • Atomican
  • 1,902 posts

Posted 25 August 2011 - 05:54 PM

Uh, you can resize NTFS. Use something like parted/gparted under ubuntu to do this. Failing that, you can do it manually with the resize utility from ntfsprogs. Resize the filesystem, then shrink the partition down with fdisk. This isn't too hard, but it's riskier if you're not careful. Another option would be to use the FreeBSD boot manager. Grab a "bootonly" FreeBSD 8.x install cd, boot it, go to "Index", "fdisk", select the windows drive, don't change the partitions at all, just press W to write the partition table as-is, and then choose the boot manager. That should do the trick for you. Not sure the FreeBSD boot manager is smart enough to boot linux. It's *very* basic which is why it doesn't have any helper-bits outside of the bootsector. You could probably also have someone with a dual-boot machine dd their windows bootsector, send it to you and then dd it onto your windows drive.
One good thing about V3 is that I no longer have to see this shit. :D

#8 GlennsPref

GlennsPref

    Charge

  • Atomican
  • 2,173 posts

Posted 08 October 2011 - 12:46 PM

I realise this is a bit late, but i thought a solution may help in future.

install lilo and use it to rewrite the mbr of the windows partition.

This will remove grub2 from there.

If you do not have access to the Windows CD, the following commands will rewrite the MBR, removing Grub and allowing the system to boot directly into Windows.

install lilo (for ubuntu)
sudo apt-get install lilo

command,
sudo lilo -M /dev/sda mbr
ref. http://ubuntuforums....d.php?t=1195275 16.

edit, I've used this on my systems. to clean up after failed attempts to install and configure grub2

another way to rewrite the mbr from gnu/linux is dd.
of the 512 bites the partition table resides at 447, so this will leave the partition table alone and write the rest.
dd if=/dev/zero of=/dev/hda/ bs=446 count=1
ref. http://www.linuxques...56/#post1526191

to rewrite the entire mbr, use 512 instead of 446
ref. http://www.cyberciti...uninstall-grub/

Hope this helps, regards Glenn

Edited by GlennsPref, 08 October 2011 - 03:39 PM.

"Everything depends upon relative minuteness". Life is what "you" make of it. http://counter.li.org registered as GNU/Linux user #406321 Mageia1, kde4, openbox VirtualBox (non-ose AMD64) must read... http://www.religious....org/taoism.htm #(spiritual-stuff, it's good!) http://www.webofdebt...r-deception.php

#9 TinBane

TinBane

    Super Hero

  • Mod
  • 21,394 posts

Posted 13 October 2011 - 09:13 AM

Cheers Glenn. In the end, I downloaded a retail disk of windows, put it on a CD, fixed the MBR, and then threw out the disk and deleted the iso. Got ubuntu happily running on it's own SSD.
Romans 10:3 absit iniuria verbis




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users