Jump to content
Can't remember your login details? Read more... ×
TinBane

Grub2 on a windows drive

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.org/showthread.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.linuxquestions.org/questions/li...56/#post1526191

 

to rewrite the entire mbr, use 512 instead of 446

ref. http://www.cyberciti.biz/faq/linux-how-to-uninstall-grub/

 

Hope this helps, regards Glenn

Edited by GlennsPref

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×