Hello dear guest!

Boot Land is a community driven site established since 2006 and focused on data recovery/backup boot disks, research of Windows 2000/XP/2003/Vista/7 install/deployment/antivirus tools, customizing Windows PE systems and even learning how to recover from disaster situations.

How about joining our boot disk community? So do it. Life's short!

  - You get free access to our newsletter with all the interesting buzz about boot disks
  - We share publicity revenue with everyone who wishes to participate at the forums
  - Publicity is never, never, never displayed to members (along with many other cool things)
http://boot-land.net/register

2 Pages V   1 2 >  
Reply to this topic
 Hddimage - Batch command to create a hard disk image, Modifed from jaclaz's mbrbatch/mkimg
post Sep 11 2009, 03:21 PM
Post #1
oriensol
Frequent Member   ***
Group: Members

  Joined: 17-August 09
Posts: 151
Thank(s): 50


India


Here's a tool (adapted from Jaclaz's mbrbatch/mkimg batches) with a simplified interface to create hard disk images. The motivation to make this was to have an easy way to create a hard disk image, without worrying about the details.

It takes a filename for the disk image, a size in bytes (with optional K,M or G suffix for KB, MB or GB) and an optional /R parameter to create a disk image rounded to cylinder boundary.

You need to have these files from jaclaz's zip file to run this batch command: gsar.exe dsfo.exe dsfi.exe fsz.exe - http://www.boot-land.net/forums/index.php?...batch&st=40 . For AMD64, you will need the bpatcher from http://www.boot-land.net/forums/?showtopic=5000 - see post 3 of Lancelot below.

Thanks to jaclaz.

Hope this helps.

CODE
D:\MBR Batch>hddimage

Usage: hddimage.cmd targetfile diskimagesize [round-to-cylinder=/R

targetfile is the path of the Disk Image File to be created

diskimagesize is the image size in bytes - add a suffix K, M or G for Kilo, M
ega or Giga

Optionally, specify '/R' to round the disk image size to cylinder boundary

1. A copy of the MBR is embedded inside a few system files:
- %SystemRoot%\System32\dmadmin.exe
- %SystemRoot%\System32\spcmdcon.sys
- %SystemRoot%\ServicePackFiles\I386\setupdd.sys
hddimage.cmd uses dmadmin.exe by default

If you are using a "lited" 2K/XP where this file has been removed
edit the batch accordingly, if you use the batch on just one system
you may also set a fixed offset and avoid the need for gsar.exe

If your OS doesn't have dmadmin.exe, find and copy it to the current directory

2.
The disk image is created with 255/63 geometry
Minimum disk image size is 16 MB (for 255/63 geometry)
If the size supplied is less than 32130 sectors, an image of size 32130 sector
s will be created
The largest possible partition is created, if size is not a multiple of 512
A single unformatted NTFS partition is created
Please format the partition later on to your liking
You may also create multiple partitions later on, if needed
Use the optional round-cylinder option (/R) to ensure image ends at cylinder b
oundary
Using /R will prevent the grub4dos warning while mapping the drive
Remember to use something like:
vdk open * imagename.pln [/RW] /p:1 [/l:z:]
each time you use the image with vdk or better still, do NOT use the /p switch at all
When the round-cylinder option is used, the size is 'increased', if needed
3.
You can mount the image using vdk
Use the .pln file in the target directory to open with 255/63 geometry using v
dk
The default geometry used by vdk is 64/32
vdk available from [url="http://chitchat.at.infoseek.co.jp/vmware/vdk.html"]http://chitchat.at.infoseek.co.jp/vmware/vdk.html[/url]
You can also mount the image using ImDisk
4.
EXAMPLES:
hddimage.cmd "X:\my folder\my disk.img" 20M
hddimage.cmd my_disk2.img 1G /R

D:\MBR Batch>





Please format the partition later on to your liking
Using /R will prevent the grub4dos warning while mapping the drive
Remember to use something like:
vdk open * imagename.pln [/RW] /p:1 [/l:z:]
each time you use the image with vdk or better still do NOT use the /p switch (thanks AGAIN to Jaclaz for pointing this out)
Use the .pln file in the target directory to open with vdk to ensure 255/63 geometry is used (thanks to Jaclaz for pointing this out)

Included the patch for AMD64 (see Lancelot's post 3 below).
Added .pln creation in target directory for use with vdk for 255/63 geometry (see Post 5 below)
Fixed problem with free space determination when using European Windows
Fixed AMD64 issue and removed use of echoo.com, using bpatcher instead in all cases
Added support for blanks in file path and name
Added check for dmadmin.exe in current directory and error if not supplied
If size given is less than 16 MB, instead of error message the smallest possible image is created
Fixed issue with special characters as numeric separator

Thanks owed to Lancelot for the suggestions for version 0.4 and testing the AMD64 issues.
Thanks to dera for help with testing version 0.5 - special numeric separator

The full set of needed files is available in the zip. The file list is: hddimage.cmd, gsar.exe, dsfo.exe, dsfi.exe, fsz.exe and bpatcher.exe.

You may need to manually copy dmadmin.exe to the hddimage directory, if it is not available at %SystemRoot%\System32\.

Latest version with all needed files can be downloaded from http://public.winbuilder.net/5F_oriensol/hddimage05.zip

Please keep informed of any issues you may find with Alpha 0.5.






1 user(s) said "Thank you!" to oriensol for this fantastic post:
wimb
+Quote Post
post Sep 11 2009, 03:57 PM
Post #2
oriensol
Frequent Member   ***
Group: Members

  Joined: 17-August 09
Posts: 151
Thank(s): 50


India


Some links:

http://www.boot-land.net/forums/index.php?showtopic=8265

http://www.boot-land.net/forums/index.php?...ic=8804&hl=

http://www.boot-land.net/forums/index.php?...ic=8862&hl=

http://www.boot-land.net/forums/index.php?showtopic=8168

http://www.boot-land.net/forums/index.php?...amp;hl=mbrbatch

+Quote Post
post Sep 11 2009, 03:59 PM
Post #3
Lancelot
Frequent Member   **
Group: .script developer

  Joined: 8-May 08 From: Turkiye/Izmir

Posts: 91
Thank(s): 497


Turkiye


Hi oriensol,

a minor thing wink.gif, can you make batch not using echooo.com for hostosx64 compatibility biggrin.gif
check post 6 here (if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto echooox64bypass....)


--------------------
1 user(s) said "Thank you!" to Lancelot for this fantastic post:
oriensol
+Quote Post
post Sep 11 2009, 04:25 PM
Post #4
oriensol
Frequent Member   ***
Group: Members

  Joined: 17-August 09
Posts: 151
Thank(s): 50


India


@Lancelot

I have quickly updated the batch with the change for AMD64/bpatcher.

Thanks cheers.gif
+Quote Post
post Sep 11 2009, 06:31 PM
Post #5
was_jaclaz
Finder   ******
Group: Advanced user

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

Posts: 7,224
Thank(s): 547


Italy


Another thing.....

The advise to mount it with VDK is partially deceiving.

If you mount a 255/63 (or ANY xx/yy) geometry image under VDK directly it will be mounted with a a 64/32 geometry, which is something you DON'T want.

You need a .pln file with the right geometry and mount the .pln file (as opposed to the actual image .img file).

Should you have removed from MBRbatch the part that makes the .pln, one can use this "self-standing" batch:
http://www.forensicfocus.com/index.php?nam...sc&start=38
(or a simplified version "fixed" to 255/63.

cheers.gif

jaclaz


--------------------
+Quote Post
post Sep 11 2009, 10:58 PM
Post #6
oriensol
Frequent Member   ***
Group: Members

  Joined: 17-August 09
Posts: 151
Thank(s): 50


India


@jaclaz

Thanks a lot. cheers.gif

Updated the tool with creation of .pln file in target directory in addition to the fix for AMD64.

When using with vdk use thus (/P:1 is optional as we have only one partition and /RW if you want the disk read/write):

CODE
vdk open * x:\myfolder\mydisk.pln /RW
vdk open * my_disk2.pln /P:1
vdk open * my_disk3.pln /RW /P:1
vdk open * my_disk4.pln /RW
+Quote Post
post Sep 12 2009, 12:11 AM
Post #7
oriensol
Frequent Member   ***
Group: Members

  Joined: 17-August 09
Posts: 151
Thank(s): 50


India


Fixed a minor bug with .pln. Please redownload, if you downloaded version 0.2 within the past hour or so. Sorry.
+Quote Post
post Sep 13 2009, 07:58 AM
Post #8
wimb
Frequent Member   ***
Group: Advanced user

  Joined: 10-July 07
Posts: 489
Thank(s): 134


Netherlands


The hddimage.cmd batch fails on non-English Windows Versions.
The FREEBYTES routine is the problem.

My language is Dutch and then I have to use "bytes beschikbaar" instead of "bytes free"
and a dot in "tokens=1-10 delims=." instead of a comma in "tokens=1-10 delims=,"

After these changes I can use the batch.

May be you can use other routine which supports International use.


--------------------
+Quote Post
post Sep 13 2009, 08:12 AM
Post #9
oriensol
Frequent Member   ***
Group: Members

  Joined: 17-August 09
Posts: 151
Thank(s): 50


India


@wimb

Thank you. Should be fixed now.

Please download version 0.3.
+Quote Post
post Sep 13 2009, 09:18 AM
Post #10
oriensol
Frequent Member   ***
Group: Members

  Joined: 17-August 09
Posts: 151
Thank(s): 50


India


Revised 0.3 posted - removed assumption of English.
1 user(s) said "Thank you!" to oriensol for this fantastic post:
wimb
+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 attachmentsCreate ISO_RAM (with grub4dos & WinVBlock)
Alternative method to BootSDI.script
14 acus 782 5th February 2010 - 05:07 AM
Last post by: acus
No new tool to track install wanted!
31 MedEvil 4,735 3rd February 2010 - 11:43 AM
Last post by: m4dm4Xz
No New Posts Created image on windows, does not boot on linux
2 Intelio 1,957 17th January 2010 - 03:26 PM
Last post by: nealmazer33
No New Posts Topic has attachmentsCreate Universal Ghost or WIM Image of Windows XP
12 Shirin Zaban 2,393 29th December 2009 - 06:41 PM
Last post by: Shirin Zaban
No New Posts Hardware Detection Tool (HDT)
program that runs directly on the SYSLINUX bootloader
11 Icecube 3,122 21st December 2009 - 05:11 PM
Last post by: Icecube