* Mounting a virtual hard-disk and booting from it
@ 2011-06-21 19:02 Swapnesh Chaubal
2011-06-22 13:55 ` Swapnesh Chaubal
2011-06-24 15:46 ` Lennart Sorensen
0 siblings, 2 replies; 6+ messages in thread
From: Swapnesh Chaubal @ 2011-06-21 19:02 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 368 bytes --]
Hey folks,
I use a script from VMWare to read a virtual hard-disk and then mount it to
a drive in Linux. How can I boot from this mounted drive using grub (I need
to mount the drive before booting to any OS). I could have all the mounting
stuff written in a python/bash script. However, is there a way to run that
script from GRUB or a GRUB module?
Thanks,
Swapnesh
[-- Attachment #2: Type: text/html, Size: 391 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Mounting a virtual hard-disk and booting from it
2011-06-21 19:02 Mounting a virtual hard-disk and booting from it Swapnesh Chaubal
@ 2011-06-22 13:55 ` Swapnesh Chaubal
2011-06-22 18:00 ` Martin Rosenau
2011-06-24 15:46 ` Lennart Sorensen
1 sibling, 1 reply; 6+ messages in thread
From: Swapnesh Chaubal @ 2011-06-22 13:55 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 614 bytes --]
Hey All,
For some reason I'm not getting mails in grub-devel@gnu.org. Could someone
kindly forward the replies to this id too?
Thanks,
Swapnesh
On Tue, Jun 21, 2011 at 3:02 PM, Swapnesh Chaubal <schauba@clemson.edu>wrote:
> Hey folks,
>
> I use a script from VMWare to read a virtual hard-disk and then mount it to
> a drive in Linux. How can I boot from this mounted drive using grub (I need
> to mount the drive before booting to any OS). I could have all the mounting
> stuff written in a python/bash script. However, is there a way to run that
> script from GRUB or a GRUB module?
>
> Thanks,
> Swapnesh
>
[-- Attachment #2: Type: text/html, Size: 969 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Mounting a virtual hard-disk and booting from it
2011-06-22 13:55 ` Swapnesh Chaubal
@ 2011-06-22 18:00 ` Martin Rosenau
2011-06-22 20:37 ` Swapnesh Chaubal
0 siblings, 1 reply; 6+ messages in thread
From: Martin Rosenau @ 2011-06-22 18:00 UTC (permalink / raw)
To: The development of GNU GRUB, schauba
[-- Attachment #1: Type: text/plain, Size: 905 bytes --]
Hello
I do not think you can run Python scripts from GRUB. A Python
interpreter is a very large program requiring a complete operating
system. It would be very complex to run such scripts from GRUB...
Martin
> On Tue, Jun 21, 2011 at 3:02 PM, Swapnesh Chaubal <schauba@clemson.edu
> <mailto:schauba@clemson.edu>> wrote:
>
> Hey folks,
>
> I use a script from VMWare to read a virtual hard-disk and then
> mount it to a drive in Linux. How can I boot from this mounted
> drive using grub (I need to mount the drive before booting to any
> OS). I could have all the mounting stuff written in a python/bash
> script. However, is there a way to run that script from GRUB or a
> GRUB module?
>
> Thanks,
> Swapnesh
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
[-- Attachment #2: Type: text/html, Size: 2020 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Mounting a virtual hard-disk and booting from it
2011-06-22 18:00 ` Martin Rosenau
@ 2011-06-22 20:37 ` Swapnesh Chaubal
2011-06-22 21:52 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 6+ messages in thread
From: Swapnesh Chaubal @ 2011-06-22 20:37 UTC (permalink / raw)
To: Martin Rosenau; +Cc: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]
Thanks for the reply Martin, is there any other way to achieve this? I do
not need to python script for it, I need to run an executable which reads
the virtual hard-disk. So I think I'll need to run this executable and add
an entry in grub.conf before the boot menu shows up.
On Wed, Jun 22, 2011 at 2:00 PM, Martin Rosenau <martin@rosenau-ka.de>wrote:
> **
> Hello
>
> I do not think you can run Python scripts from GRUB. A Python interpreter
> is a very large program requiring a complete operating system. It would be
> very complex to run such scripts from GRUB...
>
> Martin
>
> On Tue, Jun 21, 2011 at 3:02 PM, Swapnesh Chaubal <schauba@clemson.edu>wrote:
>
>> Hey folks,
>>
>> I use a script from VMWare to read a virtual hard-disk and then mount it
>> to a drive in Linux. How can I boot from this mounted drive using grub (I
>> need to mount the drive before booting to any OS). I could have all the
>> mounting stuff written in a python/bash script. However, is there a way to
>> run that script from GRUB or a GRUB module?
>>
>> Thanks,
>> Swapnesh
>>
>
>
> _______________________________________________
> Grub-devel mailing listGrub-devel@gnu.orghttps://lists.gnu.org/mailman/listinfo/grub-devel
>
>
>
[-- Attachment #2: Type: text/html, Size: 2344 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Mounting a virtual hard-disk and booting from it
2011-06-22 20:37 ` Swapnesh Chaubal
@ 2011-06-22 21:52 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-06-22 21:52 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]
On 22.06.2011 22:37, Swapnesh Chaubal wrote:
> Thanks for the reply Martin, is there any other way to achieve this? I
> do not need to python script for it, I need to run an executable which
> reads the virtual hard-disk. So I think I'll need to run this
> executable and add an entry in grub.conf before the boot menu shows up.
>
Have a look at ubuntu/casper and
http://www.supergrubdisk.org/wiki/Loopback.cfg to see how it's done
properly. It short: you completely miss the point and "running a
program/python script in GRUB" makes little sense. To load linux/initrd
from image from GRUB it's enough 4 simple commands: loopback, linux,
initrd, boot. But you need special initrd to do the rest
>
>
> On Wed, Jun 22, 2011 at 2:00 PM, Martin Rosenau <martin@rosenau-ka.de
> <mailto:martin@rosenau-ka.de>> wrote:
>
> Hello
>
> I do not think you can run Python scripts from GRUB. A Python
> interpreter is a very large program requiring a complete operating
> system. It would be very complex to run such scripts from GRUB...
>
> Martin
>
>> On Tue, Jun 21, 2011 at 3:02 PM, Swapnesh Chaubal
>> <schauba@clemson.edu <mailto:schauba@clemson.edu>> wrote:
>>
>> Hey folks,
>>
>> I use a script from VMWare to read a virtual hard-disk and
>> then mount it to a drive in Linux. How can I boot from this
>> mounted drive using grub (I need to mount the drive before
>> booting to any OS). I could have all the mounting stuff
>> written in a python/bash script. However, is there a way to
>> run that script from GRUB or a GRUB module?
>>
>> Thanks,
>> Swapnesh
>>
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org <mailto:Grub-devel@gnu.org>
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
--
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: Mounting a virtual hard-disk and booting from it
2011-06-21 19:02 Mounting a virtual hard-disk and booting from it Swapnesh Chaubal
2011-06-22 13:55 ` Swapnesh Chaubal
@ 2011-06-24 15:46 ` Lennart Sorensen
1 sibling, 0 replies; 6+ messages in thread
From: Lennart Sorensen @ 2011-06-24 15:46 UTC (permalink / raw)
To: The development of GNU GRUB
On Tue, Jun 21, 2011 at 03:02:14PM -0400, Swapnesh Chaubal wrote:
> I use a script from VMWare to read a virtual hard-disk and then mount it to
> a drive in Linux. How can I boot from this mounted drive using grub (I need
> to mount the drive before booting to any OS). I could have all the mounting
> stuff written in a python/bash script. However, is there a way to run that
> script from GRUB or a GRUB module?
If you expect to do it from an unmodified virtual harddisk, then you
can't. The software in it almost certainly will expect a real disk
connected to some controller, which the virtual machine software provides.
So you have to at least modify the image to work with a virtual drive
directly. This means that it must have an initrd that can mount the
real system's drive, find the virtual drive, loop mount that and make
it root and continue booting.
If you have such an initrd and kernel in the virtual drive, then grub
(on the main drive of course, not inside the virtual drive since the host
machine can't read that to boot) can loopback access the image and read
the kernel and initrd and boot those, after which it is entirely up to
the kernel and initrd to actually mount the virtual drive and use it.
The image most likely must be a raw disk image (not .vdi, or .vmk or
any of the other special virtual drive types that are not a stright
collection of disk blocks in a file).
Remember that once grub jumps to the kernel, nothing grub did exists
anymore, so there is no concept of mounting a drive in grub and even if
it could it wouldn't be mounted anymore as soon as you jump to the kernel.
The kernel/initrd must do the mounting.
--
Len Sorensen
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-06-24 15:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21 19:02 Mounting a virtual hard-disk and booting from it Swapnesh Chaubal
2011-06-22 13:55 ` Swapnesh Chaubal
2011-06-22 18:00 ` Martin Rosenau
2011-06-22 20:37 ` Swapnesh Chaubal
2011-06-22 21:52 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-06-24 15:46 ` Lennart Sorensen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.