LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 01-31-2008, 06:46 PM   #1
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 681

Rep: Reputation: 42
Lightbulb can I build a mbr in a ntfs partition and install grub to it


Ladies & Gentlemen,

I know there are a lot of posts on setting up grub and I have read or scanned through a bunch of them. None of them seam to relate to the issue I have. I am trying to use an existing xp install on hdb2 partition in virtualbox. I did finally get it set up so the vm could see it but it does not boot. I don't find that suprising because the vm is seeing it as hda1 which would have an mbr and this partition does not have one.

The first partition on this drive is the recovery partition. I could give the vm access to the whole drive but I would rather not.

I thought about making a grub cd and then making an iso from it and assigning it to the vm.

I could do the same with a floppy image.

What I would really like to do is install grub on the ntfs-xp partition and build an mbr on it.

Or maybe a better option that you super linux hackers know about.

The virtualbox documentation is really slim as for setting up anything. I had to take pieces from several scattered places just to be able to see the drive.

Trashing the drive is OK because it stupid windows doesn't run right. i.e, when you launch the file browser it launches the install shield briefly before the file browser comes up. Like I said stupid windows.

If I can get this drive to at least try to boot then I will reinstall it and convert it to a true virtualbox install. (windows oem Compaq)

Any thoughts?

Thanks
 
Old 01-31-2008, 06:52 PM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
http://www.geocities.com/lode_leroy/grubinstall/
... but why would you want to?

Quote:
I am trying to use an existing xp install on hdb2 partition in virtualbox. I did finally get it set up so the vm could see it but it does not boot. I don't find that suprising because the vm is seeing it as hda1 which would have an mbr and this partition does not have one.
Surely this is a problem with the way the VM is set up in Virtualbox, (note: virtualbox, itself, is not a vm) or the way Virtualbox is set up. You are best to fix the actual problem than go for fuzzy workarounds like this.
 
Old 01-31-2008, 08:14 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,500

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Wouldn't help anyway. Grub merely chainloads to a Windoze partition - the boot sector record there gets control. If that boot sector record is invalid, it doesn't matter what you use - even ntldr.

If you (normally) have to chainload to the recovery partition rather than Windoze itself (unlikely but possible), you'll have to make an image of that available as well, and it will chainload to Windoze.
As I said - unlikely. Your problems are probably elsewhere - check the message at failure.
 
Old 02-01-2008, 07:12 AM   #4
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 681

Original Poster
Rep: Reputation: 42
Thanks Simon Bridge & syg00

Quote:
Surely this is a problem with the way the VM is set up in Virtualbox
This would not surprise me because I had to glean fragments from many different places to get this far.

This is how this partition is booted native.

From grub menu.lst
Code:
title		XP Home testing installation
root		(hd1,1)
map (hd0) (hd1)
map (hd1) (hd0)
savedefault
makeactive
chainloader	+1
Then it hits longhorn as pointed out by syg00

From boot.ini located in the C:\ of the partition
Code:
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP Home test install" /fastdetect /NoExecute=OptIn /bootlog /sos
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons
Then xp comes up in it's malfunctioning state.

The last line is the recovery console and as I understand it the '/cmdcons' is some kind of pointer to a file buried in windows somewhere that tells the boot loader where and how to boot it.

syg00
Quote:
check the message at failure.
The only message I get when I try to launch the vm is about the host os, Debian Lenny, sound system not working which may cause the guest os sound apps to hang. If I reset the vm I don't get that message. In either case the vm just sits there with a black screen and my processor is at 100%.

The command I used to create the vmdk image (if image is the right word).
Code:
VBoxManage internalcommands createrawvmdk -filename /home/rbees/.VirtualBox/VDI/WinXP.vmdk -rawdisk /dev/hdb -partitions 2 -relative -register
I guess I can make a vmdk that points to the whole drive my understanding is that they don't take up very much space because they only hold the wright through information. Doesn't take very long either about a minuet or so.

Quote:
If that boot sector record is invalid, it doesn't matter what you use - even ntldr.
An invalid boot sector would not surprise me either. The short version; Windows did bsod, bsod said cause may be hard drive, did complete reinstall including rc partition, still bsod, installed new master hard drive moved old drive to slave installed to master, still bsod, windows on slave not boot either, told wife she would have to deal with it, booted into Etch problem cured. Stupid windows.

That was a couple of years ago. Now that the vm's have gotten to a more useable state I decided to get that non booting partition to boot in a vm, then my wonderful wife could run her windows dependent bowling league and book keeping programs without having to boot into windows.

Would looking at the boot sector of that partition tell me anything?

How do I look at it?

Thanks

Last edited by rbees; 02-01-2008 at 07:14 AM. Reason: wrong os
 
Old 02-02-2008, 07:57 PM   #5
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 681

Original Poster
Rep: Reputation: 42
OK

I have made an image of the whole disk and that won't boot either. It also pegs the cpu at 100% and sets there with a black screen. I know that the sound system in Lenny is working right, so I don't know why it is giving me the message about the sound system. I did disable sound in the vm and that stopped the error. I am beginning to wonder if there is something wrong with the command I am using to make the images with.

I did have virtualbox-ose installed before I installed the version off from their site because I could not get the driver to load. Then I discovered I needed the kernel source which I didn't install when I updated the kernel awhile ago. Probably why the 'ose' version wouldn't load the driver. Version conflict maybe?

I have looked at the boot sector of those partitions and the mbr of that drive, but I don't know what to make of what I can read. Most of it is jiberish even when looking at it in a hex editor. I am looking at a copy made with something like
Code:
dd if=/dev/hda2 of=/mnt/ntc/boot.lnx bs=512 count=1
not the actual sector, safer that way.

Any thoughts?

Thanks
 
Old 02-02-2008, 08:22 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,500

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Sorry, I unsubscribed from this thread. If you see the boot.ini menu, the chainloading and the boot sector record are fine.
It's probably now the first partition - change boot.ini to "multi(0)disk(0)rdisk(0)partition(1)" and try that.

Gotta go walk the mutts - rain has just let up.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Messed up my MBR, now GRUB and Extended Partition Info lost Q-Continuum Suse/Novell 16 05-07-2007 03:29 AM
How to install Grub other than MBR? terryxela Ubuntu 1 04-08-2007 05:31 PM
grub/NTFS/MBR death llamaofdeath Linux - Software 3 08-26-2006 12:58 AM
Getting rid of GRUB on a partition (NOT MBR) KuRe Linux - Newbie 1 03-31-2005 09:06 PM
Help with Grub in MBR and /boot partition! zLinuxz Linux - General 11 11-17-2003 12:42 PM


All times are GMT -5. The time now is 04:35 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration