2 Pages V   1 2 >  
Reply to this topic
 Firadisk and .VHD /.IMG images
post Nov 6 2009, 08:15 AM
Post #1
Marietto2009
Frequent Member   ***
Group: Members

  Joined: 26-August 09 From: Italy

Posts: 169
Thank(s): 8


Italy


I'm running Windows 7 from RAM for all my days activites. No problems at all. I have two disks on my computer. On the first one I installed Windows Vista and on the second Windows XP. When my computer starts,I choose to boot from disk n.2. These are the boot configuration files located on disk 2 :

boot.ini

CODE
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows FLP" /noexecute=optin /fastdetect
c:\grldr="Grub4Dos"


menu.lst

CODE
title Boot 7 from RAMDisk
find --set-root /7-ram.img
map --mem /7-ram.img (hd0)
map --hook
root (hd0,0)
chainloader /bootmgr


7-ram.img is saved on \disk 2. To make Windows 7 bootable from the RAM Disk,I used the Karyonix commands :

CODE
bcdedit /store "virtual ram drive:"\boot\bcd /set {bootmgr} device boot
bcdedit /store "virtual ram drive:"\boot\bcd /set {default} device boot
bcdedit /store "virtual ram drive:"\boot\bcd /set {default} osdevice boot


+Quote Post
post Nov 6 2009, 11:03 AM
Post #2
karyonix
Frequent Member   ***
Group: Members

  Joined: 5-March 08
Posts: 268
Thank(s): 199


Thailand


@Marietto2009
I think you can convert 7-ram.img to fixed size VHD image for easier maintenance.
If your small Windows 7 is ultimate edition, you can use its VHD native boot feature to boot direct from VHD and make changes.
When you want to run in RAM, use GRUB4DOS to load disk image from inside the fixed size VHD.
1 user(s) said "Thank you!" to karyonix for this fantastic post:
Marietto2009
+Quote Post
post Nov 6 2009, 04:58 PM
Post #3
Marietto2009
Frequent Member   ***
Group: Members

  Joined: 26-August 09 From: Italy

Posts: 169
Thank(s): 8


Italy


@karyonix : which kind of tool can I use to convert from img to vhd ?
+Quote Post
post Nov 6 2009, 05:38 PM
Post #4
was_jaclaz
Finder   ******
Group: Advanced user

  Joined: 14-July 06 From: Gone in the mist

Posts: 7,230
Thank(s): 564


Italy


QUOTE (Marietto2009 @ Nov 6 2009, 06:58 PM) *
@karyonix : which kind of tool can I use to convert from img to vhd ?


You can try:
qemu-img (part of Qemu):
http://www.winimage.info/forum/viewtopic.php?f=7&t=3268

and Clonedisk:
http://www.boot-land.net/forums/index.php?showtopic=8480

jaclaz


--------------------
1 user(s) said "Thank you!" to jaclaz for this fantastic post:
Marietto2009
+Quote Post
post Nov 6 2009, 05:57 PM
Post #5
karyonix
Frequent Member   ***
Group: Members

  Joined: 5-March 08
Posts: 268
Thank(s): 199


Thailand


QUOTE (Marietto2009 @ Nov 6 2009, 11:58 PM) *
@karyonix : which kind of tool can I use to convert from img to vhd ?

Create a new VHD in Disk Management or diskpart of Windows 7.
Initialize disk, create partition, format, mark partition as active.
Mount raw image with Imdisk.
Clone Windows 7 to VHD drive as described in http://www.boot-land.net/forums/index.php?showtopic=9196
- Copy files from raw image drive to VHD drive
- Adjust \DosDevices\C: in system hiv in VHD drive.
- Create BCD store in host drive. Set its {bootmgr} device to "boot". Set its {default} device and osdevice to VHD drive.
- Leave BCD store in VHD drive as is. Its {bootmgr} device and {default} device and osdevice is already "boot".

or
Create VHD footer manually and append it to raw disk image then rename it to VHD.
Use information from Virtual Hard Disk Image Format Specification http://technet.microsoft.com/en-us/virtual...r/bb676673.aspx
or
Tell me your RAW image size (in bytes or secters) and geometry (CHS). And I will try to construct VHD footer for you.
1 user(s) said "Thank you!" to karyonix for this fantastic post:
Marietto2009
+Quote Post
post Nov 7 2009, 12:41 AM
Post #6
karyonix
Frequent Member   ***
Group: Members

  Joined: 5-March 08
Posts: 268
Thank(s): 199


Thailand


@corsair
No speed improvement in last 2 months.
I am rewriting firadisk to use a separate thread for virtual drive but not completed yet.

@Marietto2009
RAW2VHD is now completed.
Attached File  raw2vhd.7z ( 6.5K ) Number of downloads: 62
(It requires Visual C++ runtime libraries to work.)
All it does is append 512-byte VHD footer to raw disk image file.
The disk image file will become VHD and can be attach in Disk Management of Windows 7.
You may have to rename file extension to .vhd yourself.
It does not check for existing VHD footer, so don't run it twice for the same disk image file.
You can revert the change made by RAW2VHD by deleting last 512 byte of disk image file (that begin with "conectix").
example:
CODE
C:\data>raw2vhd
Convert raw disk image file to fixed size VHD file

RAW2VHD  imgfilename


C:\data>raw2vhd image2.img
detected geometry  C=331 H=255 S=63    totalsize=2726297600 bytes
complete

C:\data>ren image2.img image2.vhd

C:\data>
+Quote Post
post Nov 9 2009, 12:45 PM
Post #7
Marietto2009
Frequent Member   ***
Group: Members

  Joined: 26-August 09 From: Italy

Posts: 169
Thank(s): 8


Italy


@karyonix :

I've converted my virtual ram disk from img to vhd format using your tool. This is the error encoutered :

Total sectors calculated from partition table (5349645) is greater than the number of sectors in the whole disk image (5333581). The int13 header will disable any read / write operation across the image boundary. That means you will not be able to read / write sectors (in absolute address,IE lba) 5333581 - 5349644 ,tought they are logically inside your emulated virtual disk (according to the partition table) :

Probed C/H/S = 333/255/63
Probed total sectors : 5349645
1 user(s) said "Thank you!" to Marietto2009 for this fantastic post:
karyonix
+Quote Post
post Nov 9 2009, 01:41 PM
Post #8
was_jaclaz
Finder   ******
Group: Advanced user

  Joined: 14-July 06 From: Gone in the mist

Posts: 7,230
Thank(s): 564


Italy


QUOTE (Marietto2009 @ Nov 9 2009, 02:45 PM) *
Total sectors calculated from partition table (5349645) is greater than the number of sectors in the whole disk image (5333581). The int13 header will disable any read / write operation across the image boundary. That means you will not be able to read / write sectors (in absolute address,IE lba) 5333581 - 5349644 ,tought they are logically inside your emulated virtual disk (according to the partition table) :

Probed C/H/S = 333/255/63
Probed total sectors : 5349645

The above comes from grub4dos, right? dubbio.gif

How was the "source". img created?
Which settings does it have in the MBR?
How big it is in bytes?

Another idea, would Disk2vhd work?
Disk2vhd
http://technet.microsoft.com/en-us/sysinte...s/ee656415.aspx

jaclaz


--------------------
1 user(s) said "Thank you!" to jaclaz for this fantastic post:
karyonix
+Quote Post
post Nov 9 2009, 02:29 PM
Post #9
karyonix
Frequent Member   ***
Group: Members

  Joined: 5-March 08
Posts: 268
Thank(s): 199


Thailand


It is warning message, not error message.

Originally you have 332*255*63*512 = 2730792960 bytes long raw disk image.
When GRUB4DOS reads this image, it known this file is 2730792960/512 = 5333580 sectors long.
It detects disk geometry H=255 S=63. Then it calculates number of cylinders from 5333580 / (255*63) = 332.
332*255*63 = 5333580. There is no problem.

When you add VHD footer. The file is 512 bytes longer. Its size is now 2730792960 + 512 = 2730793472 bytes.
If you mount this VHD image in Windows 7, its capacity is 2730792960 bytes.
When GRUB4DOS reads this image, it calculate number of sectors from file size (including the VHD footer) 2730793472/512 = 5333581.
It detects disk geometry H=255 S=63. Then it calculates number of cylinders from 5333581 / (255*63) = 332 and 1 remainder. It rounds up the number to 333.
It then thinks the geometry size is 333*255*63 = 5349645 which is longer that the actual size 5333581.
So it warns that sectors between 5333581-5349645 is not accessible.

Sectors between 5333581-5349645 is beyond the end of original image. We don't use them.

The sector 5333580 is VHD footer. It is mapped into GRUB4DOS's virtual disk. If you modify this sectors in image file, VHD footer will become invalid. But it is unlikely that it will be modified since it is outside of all partitions. And even if it is modified in RAM drive, image file will remain unchanged.


QUOTE (jaclaz @ Nov 9 2009, 08:41 PM) *
Another idea, would Disk2vhd work?
Disk2vhd
http://technet.microsoft.com/en-us/sysinte...s/ee656415.aspx

It seems to be able to take snapshot of the disk you are running Windows from.
Its output seems to be dynamic size VHD. You just have to convert it to fixed size VHD (how?) before loading it with GRUB4DOS.
However, the size of virtual disk will be as large as the source disk. It is probably unsuitable for RAM booting.
+Quote Post
post Nov 9 2009, 07:24 PM
Post #10
ireneuszp
Frequent Member   ***
Group: Advanced user

  Joined: 29-September 06
Posts: 155
Thank(s): 42


Poland


QUOTE (karyonix @ Nov 9 2009, 03:29 PM) *
You just have to convert it to fixed size VHD (how?)


maybe this will be helpfull
VHD Resizer
http://vmtoolkit.com/files/folders/converters/entry87.aspx

http://vmtoolkit.com/files/default.aspx


--------------------
+Quote Post

2 Pages V   1 2 >
Reply to this topic
1 User(s) are reading this topic ()



Collapse

  Topic Replies Topic Starter Views Last Action
No new Topic has attachmentsFiraDisk (0.0.1.24)
File/RAM Disk driver for Windows.
358 karyonix 86,471 30th August 2010 - 05:45 PM
Last post by: karyonix
No new Topic has attachmentsImgPTEdit v0.1.0.2 [Update]
Partition Table Editor for RAW Disk Images
21 TheK 1,175 29th August 2010 - 12:22 PM
Last post by: voyajer
No new Pinned: Firadisk Guide
15 diddy 6,364 4th June 2010 - 03:44 PM
Last post by: psc
No New Posts VHD got a Bit Locked up...
... and it's my only boot entry. Help!
4 allanf 1,442 13th April 2010 - 09:04 PM
Last post by: techvslife
No new Firadisk
Thank You's
14 cdob 3,488 4th April 2010 - 09:28 AM
Last post by: Mammuth