Notifications
Clear all

Mounting an image

65 Posts
13 Users
0 Likes
4,592 Views
jaclaz
(@jaclaz)
Posts: 5133
Illustrious Member
 

jaclaz,

I'm finding that the IMDisk utility keeps wanting to format the drive whenever I mount a dd image file as a drive. My goal is to open an image file ("image.dd") and mount it as an F\ drive, as read-only.

If the "dd image" is that of a "whole" hard disk, you need to supply IMDISK the correct offset to the bootsector of the partition you want to mount, making it skip the MBR+hidden sectors.
On most of modern hard disks, geometry is set to nx255x63, so the first partition is 63 sectors away from the beginning.
Consequently, you need to tell IMDISK to have an "Image file offset" of 63 and set the "Unit of image offset" as blocks, or set "Image file offset" to 63x512=32256 and set the "Unit of image offset" as bytes.
If the volume you want to mount is second or further partition, you need to find it's start (the bootsector) and "feed" it to IMDISK.

VDK, on the other hand, parses the contents of the MBR and mounts partition(s) correctly.

In other words, VDK is a "Virtual Hard Disk" driver, whilst IMDISK is a "Virtual Partition" or "Virtual Filesystem" driver.

VDK creates in 2K/XP a normal "low-level" drive link, like \\.\PHYSICALDRIVEn, whilst IMDISK treats each mounted volume as it were a "superfloppy".

If you use (as you should until you get familiarity with IMDISK) the control panel GUI, and mount an image with the wrong offset, the data in the "Filesystem" column will be "N/A", whilst if you mount it with the right one, the correct filesustem type will appear (of course limited to FAT, FAT32 or NTFS unless you have some other IFS filesystem drivers installed).

jaclaz

 
Posted : 17/11/2007 2:53 pm
keydet89
(@keydet89)
Posts: 3568
Famed Member
Topic starter
 

Jaclaz,

Thanks. I think I'll stick w/ VDK…

H

 
Posted : 17/11/2007 5:48 pm
jaclaz
(@jaclaz)
Posts: 5133
Illustrious Member
 

I simply forgot that I already had put together a small batch to help creating a .pln file for a RAW image

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEEXTENSIONS
SET /A HEADS=255
SET /A SECTORS=63

ECHO.
ECHO makepln.cmd small batch file to create a .pln descriptor file
ECHO for RAW disk images to be used with VDK.EXE to
ECHO mount the image with the correct geometry
ECHO Author jaclaz http//home.graffiti.net/jaclazgraffiti.net/
ECHO.

IF %1.==/?. GOTO Usage
IF %1.==. GOTO Interactive

IF NOT EXIST %1 ECHO File NOT FOUND &GOTO Interactive
CALL Setvars %1
IF NOT %2.==. SET HEADS=%2
IF NOT %3.==. SET SECTORS=%3
GOTO DOIT

Interactive
ECHO Please input filename of the imagefile
SET /P imgfile=
ECHO Imgfile is %imgfile%
CALL Setvars %imgfile%
IF NOT EXIST %imgP%%imgN%%imgE% ECHO File NOT FOUND &GOTO Interactive
ECHO Please input number of Heads for the imagefile [ENTER] for default 255
SET /P HEADS=
REM SET /A HEADS=%HEADS%
ECHO Please input number of Sectors for the imagefile [ENTER] for default 63
SET /P SECTORS=
REM SET /A SECTORS=%SECTORS%

DOIT
FOR /F "tokens=3 delims= " %%A in ('DIR /-C %imgP%%imgN%%imgE% ^|FIND "%imgN%%imgE%"') DO SET /A TOTsectors=%%A/512
DIR /-C %imgP%%imgN%%imgE% |FIND "%imgN%%imgE%"
ECHO Tot sectors are %TOTsectors%
SET /A CYLYNDERS=%totsectors%/%SECTORS%/%HEADS%
CheckSize
SET /A CheckCyl=%CYLYNDERS%*%SECTORS%*%HEADS%
IF NOT %CheckCyl% LEQ %totsectors% SET /A CYLYNDERS=%CYLYNDERS%-1&GOTO CheckSize

IF %CYLYNDERS% LEQ 0 ECHO ERROR! Image too little for this geometry.&PAUSE&goto EOF

ECHO.
ECHO The Following will be written to %imgP%%imgN%.pln
CALL Writefile CON
SET Confirm=
ECHO.
ECHO Type Y to confirm, Enter to abort
SET /P Confirm=
IF /I NOT %Confirm%.==Y. PAUSE&GOTO EOF
CALL Writefile "%imgN%.pln"
ECHO File %imgP%%imgN%.pln written.
PAUSE
GOTO EOF

Setvars
%~d1
CD %~dp1
SET imgN=%~n1
SET imgE=%~x1
SET imgP=%~dp1
GOTO EOF

Writefile
(
ECHO DRIVETYPE ide
ECHO CYLINDERS %CYLYNDERS%
ECHO HEADS %HEADS%
ECHO SECTORS %SECTORS%
ECHO ACCESS "%imgN%%imgE%" 0 %TOTsectors%
) > %1
GOTO EOF

Usage
ECHO Usage
ECHO makepln.cmd [filename] [heads] [sectors]
ECHO Examples
ECHO makepln.cmd C\testimg.img 16 63
ECHO makepln.cmd C\testimg.img (will default to Nx255x63)
ECHO Long filenames are OK, as long as given inside double quotes
ECHO If no parameters are given, will enter interactive mode
GOTO EOF

 
Posted : 18/11/2007 9:42 pm
jaclaz
(@jaclaz)
Posts: 5133
Illustrious Member
 

@keydet89

FYI, Olof has recently released a newish version of IMDISK that (finally) "automaps" the partition
http//www.boot-land.net/forums/index.php?showtopic=2148&st=20&start=20
wink

jaclaz

 
Posted : 28/11/2008 11:34 pm
(@mmachor)
Posts: 70
Trusted Member
 

Ok, along the lines of this post, does anyone have any known image mounting software that will work with Windows Vista? I have Smart Mount, ImDisk, FTK Imager. Get the same problem with all of them, access is denied when trying to mount image as a drive. I've already checked the permissions and have full access to the image. Any ideas?

 
Posted : 01/12/2008 12:17 am
jaclaz
(@jaclaz)
Posts: 5133
Illustrious Member
 

Ok, along the lines of this post, does anyone have any known image mounting software that will work with Windows Vista? I have Smart Mount, ImDisk, FTK Imager. Get the same problem with all of them, access is denied when trying to mount image as a drive. I've already checked the permissions and have full access to the image. Any ideas?

Mind you I don't use /like Vista, but maybe

Have you tried running as "true Admin"?
http//www.boot-land.net/forums/?showtopic=4057

With UAC disabled?
http//www.boot-land.net/forums/?showtopic=1703&st=25

jaclaz

 
Posted : 01/12/2008 6:20 am
(@mmachor)
Posts: 70
Trusted Member
 

Have tried both with the same results. Thanks though. I'll keep trying untill I find something.

 
Posted : 01/12/2008 7:17 am
(@mmachor)
Posts: 70
Trusted Member
 

I have been using ImDisk. Seems to work good, and is a freeware tool.

 
Posted : 06/12/2008 2:18 am
jaclaz
(@jaclaz)
Posts: 5133
Illustrious Member
 

I have been using ImDisk. Seems to work good, and is a freeware tool.

I don't get it.

You had just posted that IMDISK did not work for you? 😯

Does it work or does it not?

jaclaz

 
Posted : 07/12/2008 11:28 pm
keydet89
(@keydet89)
Posts: 3568
Famed Member
Topic starter
 

Cygwin should be able to provide this through the loopback adapter.

I'm looking at Cygwin now…any thoughts on using mount to mount a dd image?

From here
http//sources.redhat.com/cygwin/cygwin-ug-net/using-utils.html#mount

I don't see where I can use '-o' to mount a dd image as a read-only file system.

For mounting a .iso file on Vista, this may work
http//www.howtogeek.com/howto/windows-vista/mount-an-iso-image-in-windows-vista/

Thanks

 
Posted : 08/12/2008 3:53 am
Page 5 / 7
Share: