* Re: Make grub treat a virtual hard disk as a physical hard disk
2011-04-15 19:41 ` Lennart Sorensen
@ 2011-04-15 20:00 ` Swapnesh Chaubal
2011-04-15 20:12 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-04-15 20:43 ` Lennart Sorensen
2 siblings, 0 replies; 6+ messages in thread
From: Swapnesh Chaubal @ 2011-04-15 20:00 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: Lennart Sorensen
[-- Attachment #1: Type: text/plain, Size: 1918 bytes --]
Thank you for the quick reply Len, but it raised more questions in my mind
than it answered.
As for why I am doing this, it is a project that I am working on. I need to
boot physical machines using virtual images via network. One use of the
project is to keep each file systems as a single file on the server and
booting from there. The physical machine will be dummy terminal with nothing
much on it.
Booting the physical machine is only part of the bigger problem which is to
boot it via a network.
Thanks,
Swapnesh
On Fri, Apr 15, 2011 at 3:41 PM, Lennart Sorensen <
lsorense@csclub.uwaterloo.ca> wrote:
> On Fri, Apr 15, 2011 at 03:37:32PM -0400, Swapnesh Chaubal wrote:
> > I am working on booting a physical machine using VHD files (regarding
> which
> > I have not accomplished much) and I believe one way to go about it would
> be
> > to make grub treat a virtual hard disk as physical hard disk. This way,
> the
> > physical machine does not need to know what it is booting from and the
> rest
> > of the booting and running should proceed as it normally does.
> >
> > Is there any way to achieve this?
>
> And who is going to map the VHD file to the physical disk for the system
> running from the VHD file?
>
> You probably could convince grub to read a filesystem, find a vhd file,
> teach grub how to parse it and figure out how to find the right offsets
> in it to read its filesystem and find the kernel to boot that way, but
> you still have the larger problem of then making that kernel work with
> a VHD file rather than direct hardware access (in fact it would have to
> do both. Read the physical device and filesystem to get at the vhd and
> read that).
>
> I really have to wonder what the point of the exercise is?
>
> --
> Len Sorensen
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
[-- Attachment #2: Type: text/html, Size: 2506 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Make grub treat a virtual hard disk as a physical hard disk
2011-04-15 19:41 ` Lennart Sorensen
2011-04-15 20:00 ` Swapnesh Chaubal
@ 2011-04-15 20:12 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-04-15 20:38 ` Lennart Sorensen
2011-04-15 20:43 ` Lennart Sorensen
2 siblings, 1 reply; 6+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-04-15 20:12 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
On 15.04.2011 21:41, Lennart Sorensen wrote:
> On Fri, Apr 15, 2011 at 03:37:32PM -0400, Swapnesh Chaubal wrote:
>> I am working on booting a physical machine using VHD files (regarding which
>> I have not accomplished much) and I believe one way to go about it would be
>> to make grub treat a virtual hard disk as physical hard disk. This way, the
>> physical machine does not need to know what it is booting from and the rest
>> of the booting and running should proceed as it normally does.
>>
>> Is there any way to achieve this?
> And who is going to map the VHD file to the physical disk for the system
> running from the VHD file?
>
> You probably could convince grub to read a filesystem, find a vhd file,
> teach grub how to parse it and figure out how to find the right offsets
> in it to read its filesystem and find the kernel to boot that way,
This part is done and supported (loopback command) as long as the disk
format is raw (I don't know whether VHD is raw or not).
> but
> you still have the larger problem of then making that kernel work with
> a VHD file rather than direct hardware access (in fact it would have to
> do both. Read the physical device and filesystem to get at the vhd and
> read that).
This part is OS-specific. In case of GNU/Linux, FreeBSD, GNU/kFreeBSD,
NetBSD, OpenBSD, xnu-based Systems (Darwin and MacOSX), Solaris and
probably some other multiboot systems you can have a small initial
ramdisk which is used as root at first and has a sole purpose of finding
the other root and mounting it accordingly.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Make grub treat a virtual hard disk as a physical hard disk
2011-04-15 20:12 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-04-15 20:38 ` Lennart Sorensen
0 siblings, 0 replies; 6+ messages in thread
From: Lennart Sorensen @ 2011-04-15 20:38 UTC (permalink / raw)
To: The development of GNU GRUB
On Fri, Apr 15, 2011 at 10:12:14PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> This part is done and supported (loopback command) as long as the disk
> format is raw (I don't know whether VHD is raw or not).
It is not raw. It has sparse allocation support and supports snapshots
(in seperate files) as well. It can be raw with a header, or it can be
a sparser format.
> This part is OS-specific. In case of GNU/Linux, FreeBSD, GNU/kFreeBSD,
> NetBSD, OpenBSD, xnu-based Systems (Darwin and MacOSX), Solaris and
> probably some other multiboot systems you can have a small initial
> ramdisk which is used as root at first and has a sole purpose of finding
> the other root and mounting it accordingly.
Yeah certainly not grub's problem.
--
Len Sorensen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Make grub treat a virtual hard disk as a physical hard disk
2011-04-15 19:41 ` Lennart Sorensen
2011-04-15 20:00 ` Swapnesh Chaubal
2011-04-15 20:12 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-04-15 20:43 ` Lennart Sorensen
2 siblings, 0 replies; 6+ messages in thread
From: Lennart Sorensen @ 2011-04-15 20:43 UTC (permalink / raw)
To: The development of GNU GRUB
On Fri, Apr 15, 2011 at 03:41:51PM -0400, wrote:
> And who is going to map the VHD file to the physical disk for the system
> running from the VHD file?
>
> You probably could convince grub to read a filesystem, find a vhd file,
> teach grub how to parse it and figure out how to find the right offsets
> in it to read its filesystem and find the kernel to boot that way, but
> you still have the larger problem of then making that kernel work with
> a VHD file rather than direct hardware access (in fact it would have to
> do both. Read the physical device and filesystem to get at the vhd and
> read that).
>
> I really have to wonder what the point of the exercise is?
You should have a look at this project:
http://boot.kernel.org/
--
Len Sorensen
^ permalink raw reply [flat|nested] 6+ messages in thread