Jump to content











Photo
* * * * * 1 votes

[BUG] Raw hard disk image unmounts after copying files to logical drive

imdisk xxcopy error

  • Please log in to reply
29 replies to this topic

#1 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 15 November 2018 - 09:37 PM

I would like to confirm a possible bug that when I attempt to copy files from a source to a target where it is a logical partition on a raw hard disk image, the disk mounted using ImDisk abruptly closes resulting in any changes being lost. :(

For example, I mounted a ISO on drive J and the first logical partition mounted as drive I. I copy the files using XXCopy, I end up getting a Can't Create error message when try to create directories and this is the result of the text file:

 

XXCopy log: https://pastebin.com/EMKiffAJ

 

This problem only occurs with raw hard disk images (most common ones are the ones with the IMG format) and doesn't occurs with VHD hard disk images.

 

I was hoping that this issue can be looked into and fixed soon.

 

Thanks. :)


  • Brito likes this

#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 15 November 2018 - 10:15 PM

Thanks for your report. Could you please elaborate a little more about the scenario here? Image files involved, what they contain if the contain partitions etc and ImDisk command lines to mount them?



#3 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 15 November 2018 - 10:41 PM

Thanks for your report. Could you please elaborate a little more about the scenario here? Image files involved, what they contain if the contain partitions etc and ImDisk command lines to mount them?

 

I will try that. The image files that were involved were C:\AMI486\SCSI HD #4.img on partition 4 and H:\Icons\The Icon Pak v1.0.iso. Limited testing was done. I was using the ImDisk toolkit to mount the images, so I was unable to determine exact the command line options to mount the hard disk image.

 

If I find a utility to see which starting offset sector the third logical drive is located, I'll keep you updated.

 

Here is a screenshot of what these files look like:

 

1. https://imgur.com/a/9yqrrLf

2. https://imgur.com/a/hjMyeyn

 

I also tried to access one of the directories on the third logical partition and the raw disk image would end up closing with no warning at all.



#4 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 15 November 2018 - 10:49 PM

When the ImDisk drives are mounted, could you try at command line:

imdisk -l -m I:

and

imdisk -l -m J:

 

This will find out what options the images were mounted with. Post the results here!



#5 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 15 November 2018 - 10:52 PM

Thank you! I entered the following commands that you provided for me and here are the results:

C:\>imdisk -l -m I:
Mount point: I:
Image file: \BaseNamedObjects\Global\ImDisk188809db58c2
Size: 2146765824 bytes (1.999 GB), Proxy, HDD.

C:\>imdisk -l -m J:
Mount point: J:
Image file: \??\H:\Icons\The Icon Pak v1.0.iso
Size: 7260160 bytes (6.924 MB), ReadOnly, Removable, Queued I/O Image File, CD-ROM.

Something tells me that it's not displaying the location for the third logical partition correctly. :(

 

Now here's what I get when mount the hard disk image on the primary partition:

C:\>imdisk -l -m I:
Mount point: I:
Image file: \??\C:\AMI486\SCSI HD #4.img
Image file offset: 32256 bytes
Size: 1974034944 bytes (1.838 GB), Queued I/O Image File, HDD.

Edited by ppgrainbow, 15 November 2018 - 10:59 PM.


#6 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 16 November 2018 - 12:04 AM

Something tells me that it's not displaying the location for the third logical partition correctly. :(

 

Is that a vhd file? Fixed size? Expanding? The path in the imdisk -l output means that it is handled through another application which the driver communicates with. I would guess that you opened it using ImDisk Toolkit which recognized a vhd file and open it using a vhd library. That should of course work fine, but there could of course be cases of vhd structure corruption etc that could cause I/O to fail somewhere there. What you will see then is that the virtual disk simply disappears.



#7 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 16 November 2018 - 12:15 AM

Is that a vhd file? Fixed size? Expanding? The path in the imdisk -l output means that it is handled through another application which the driver communicates with. I would guess that you opened it using ImDisk Toolkit which recognized a vhd file and open it using a vhd library. That should of course work fine, but there could of course be cases of vhd structure corruption etc that could cause I/O to fail somewhere there. What you will see then is that the virtual disk simply disappears.

 

The third logical partition on the hard disk image that I mounted is a IMG image file (or raw hard diks image) and not a VHD. It sounds to me that right now, ImDisk has problems with opening logical partitions on the IMG-based hard disk image.



#8 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 16 November 2018 - 12:34 AM

That sounds strange. If it is a raw image it should be possible to mount using just specific offset and size.

 

If you try to mount directly with ImDisk command line control program, what happens if you for example:

 

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 1 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 2 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 3 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 4 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 5 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 6 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 7 -m #:

 

etc. This should mount each partition using parameters it might find in the MBR partition table.



#9 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 16 November 2018 - 01:01 AM

That sounds strange. If it is a raw image it should be possible to mount using just specific offset and size.

 

If you try to mount directly with ImDisk command line control program, what happens if you for example:

 

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 1 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 2 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 3 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 4 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 5 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 6 -m #:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 7 -m #:

 

etc. This should mount each partition using parameters it might find in the MBR partition table.

 

By entering this command below:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 1 -m K:

I can access the primary partition just fine. I can copy, rename and delete files without any problems.

When I enter this command below:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 5 -m K:

When I try to access the directories inside the first mounted logical drive this way, I can copy, rename or delete files without problems.

Here is the log output when I copy the files from drive I (the virtual CD-ROM) to drive K:

 

XXCopy log: https://pastebin.com/Tj7GzDWK

 

But when I access partition 6 (the second logical partition) by typing this command:

imdisk -a -f "C:\AMI486\SCSI HD #4.img" -o shared,par -v 6 -m #:

I get a message that reads:

Creating device...
Created device 6: K: -> C:\AMI486\SCSI HD #4.img
Notifying applications...
Done.

But when I try to access drive K: I get this instead:

You need to format the disk in drive K: before you can use it.

Do you want to format it?

ImDisk ends up NOT reading the file system on the second logical drive.

 

And when I remount the hard disk image again, this is what I get:

Select partition in disk image

Use entire image file
Primary partition 1 - 1.838 GB FAT16
Primary partition 2 - 5.998 Extended
Primary partition 3 - Unused
Primary partition 4 - Unused
Logical partition 1 - 1.999 GB FAT16
Logical partition 2 - 1.999 GB Extended
Logical partition 3 - Unused
Logical partition 4 - Unused

The disk image that I mounted has a primary partition (#1) and three logical drives (#5, #6 and #7). For some reason, the latest release of ImDisk isn't properly detecting more than one primary partition or one logical partition. ImDisk is supposed to detect three logical partitions, so something could be wrong with the code that doesn't allow ImDisk to display more than one primary or logical partition. :(


Edited by ppgrainbow, 16 November 2018 - 01:02 AM.


#10 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 16 November 2018 - 12:18 PM

This is a bit confused... But yes, I can confirm there are bugs with extended partitions.

Olof, I just created a small disk image using Arsenal Image Mounter. There are 3 primary partitions, and an extended partition which has 3 logicial partitions (so, 6 volumes).
All the volumes are formatted with FAT12.

Here is the image file:
http://s000.tinyuplo...111969650323778

Now, try to load this file with imdisk.cpl, you should see a big mess...

In the Toolkit, MountImg simply tries to use DiscUtilsDevio if mounting the partition with imdisk.exe produces an error or if no file system is found.
This is why MountImg is able to properly display the content of the image file and why it is able to properly mount (sometimes) extended partitions.

Anyhow, you really should investigate that.



#11 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 16 November 2018 - 12:21 PM

Thanks! I'll check!

#12 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 16 November 2018 - 07:18 PM

I have found a bug. It happens when there are more than one logical partitions in an extended partition. I'll fix that soon!


  • v77 likes this

#13 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 16 November 2018 - 07:58 PM

I have found a bug. It happens when there are more than one logical partitions in an extended partition. I'll fix that soon!

 

Yay! :D Thank you for finding the bug! I can't wait to see the bug fixed in the next version of ImDisk! :)



#14 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 17 November 2018 - 09:15 AM

Yay! :D Thank you for finding the bug! I can't wait to see the bug fixed in the next version of ImDisk! :)

 

Please note that the new driver will not be included right away in the Toolkit.

But for now, you will still be able to install the new driver for fixing that bug. This is very easy, I will describe that once Olof is done with the driver update.

 

Because of a new driver certificate format required by Windows 10, and because buying both the new and the old format would be too expensive, some old systems will not be fully supported.

In short, the only system that will have issues will be Vista 64-bit.

Windows 7 supports the new format, and both XP and Vista 32-bit do not require a valide certificate to install a driver.
However, Vista 64-bit will continue to have updates (and likely for this bug) because only the kernel part of the driver is affected by this certificate issue.
So I will need some time to test and prepare all that.


  • Olof Lagerkvist likes this

#15 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 17 November 2018 - 09:29 AM

There are only user mode changes in this case, so this will not be a problem this time. I will include the old driver with the compatible signature in the new package as well!

#16 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 18 November 2018 - 02:12 AM

A new setup package will be ready soon. Meanwhile you have the individual changed files here. It would be really helpful if someone could help testing them and see how they behave differently compared to the old versions!

 

64 bit versions:

http://ltr-data.se/f.../x64/imdisk.cpl

http://ltr-data.se/f...0/x64/devio.exe

 

32 bit versions:

http://ltr-data.se/f.../x86/imdisk.cpl

http://ltr-data.se/f...0/x86/devio.exe

 

Replace the existing imdisk.cpl in your C:\Windows\system32 directory.



#17 ppgrainbow

ppgrainbow

    Member

  • Members
  • 70 posts

Posted 18 November 2018 - 02:54 AM

A new setup package will be ready soon. Meanwhile you have the individual changed files here. It would be really helpful if someone could help testing them and see how they behave differently compared to the old versions!

 

64 bit versions:

http://ltr-data.se/f.../x64/imdisk.cpl

http://ltr-data.se/f...0/x64/devio.exe

 

32 bit versions:

http://ltr-data.se/f.../x86/imdisk.cpl

http://ltr-data.se/f...0/x86/devio.exe

 

Replace the existing imdisk.cpl in your C:\Windows\system32 directory.

 

Thank you very much! :D

 

I can't wait to see the changes in the upcoming version of ImDisk! :D



#18 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 18 November 2018 - 03:08 AM

Thank you very much! :D

 

I can't wait to see the changes in the upcoming version of ImDisk! :D

 

Does it work correctly for you if you use these versions of imdisk.cpl? It would be very good to get that confirmed before I publish a new setup package!



#19 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 18 November 2018 - 09:59 AM

This is better but there are still issues. Please retry my image file.
The control panel still show the primary partition 3 as "NTFS or HPSF", but it is FAT12.
The logical partition 3 is show as "8 MB", but it is 6 MB (and so, the size of the extended partition, that is, the primary partition 4, is also incorrect: 24 MB instead of 22 MB).


By the way, my partition 4 is a logical one. It is mounted directly with DiscUtilsDevio, but with imdisk.exe, the number 4 is considered as a primary one.
As DiscUtilsDevio ignores the extended partition (to directly enter the logical ones), I would like to reproduce the behavior with imdisk.exe.
I just seen that I have an issue with my MountImg because of the different behavior of imdisk.exe.

Moreover, there is also the case where a primary partition is deleted.
So, I really need to have a way to know when to "jump" to the logical partition.

And also, I think you should increase the number of possible logical partitions. 4 seems to me a bit limited.



#20 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 18 November 2018 - 01:57 PM

This is better but there are still issues. Please retry my image file.
The control panel still show the primary partition 3 as "NTFS or HPSF", but it is FAT12.


There is a mismatch between the partition type and formatted file system for that partition. The partition type is 0x07 (HPFS/NTFS), not 0x01 (FAT12). This should not happen really, but it could happen if you for example create a blank partition or NTFS partition and then mount that partition using for example ImDisk and format it as FAT12. Because Windows has no way of reaching the partition table to change the partition type at that point, it will remain at 0x07. This does not have any practical issues in Windows, but for MS-DOS the partition will be hidden even if the filesystem could actually have been used by MS-DOS.
 

The logical partition 3 is show as "8 MB", but it is 6 MB (and so, the size of the extended partition, that is, the primary partition 4, is also incorrect: 24 MB instead of 22 MB).

 
That was a really strange one! I'll see what could be the problem there!
 

By the way, my partition 4 is a logical one. It is mounted directly with DiscUtilsDevio, but with imdisk.exe, the number 4 is considered as a primary one.
As DiscUtilsDevio ignores the extended partition (to directly enter the logical ones), I would like to reproduce the behavior with imdisk.exe.
I just seen that I have an issue with my MountImg because of the different behavior of imdisk.exe.


Yes, it would probably make more sense to not show the extended partition at all in these cases. It is almost never of any interest to use in this way anyway. The only case I could think of would be creating an image off it, but never to mount as a virtual disk.

Moreover, there is also the case where a primary partition is deleted.
So, I really need to have a way to know when to "jump" to the logical partition.


Deleted primary partitions are not counted.

And also, I think you should increase the number of possible logical partitions. 4 seems to me a bit limited.


I changed the API now so that there is another function that can return any number of partitions by calling a callback function for each found partition and another function that directly gets just one partition information structure for a specific partition number. It is also actually easier to use to populate the list of partitions in the GUI as well using this logic, as well as easier to use for the command line tool -v switch too.

#21 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 18 November 2018 - 03:43 PM

Okay, new version to test. Would be great if you could test this one too!

It now returns partition information pretty much in the same way as DiscUtils.dll does (and therefore also how DiscUtilsDevio.exe does). It does not include the extended partition itself but rather just return primary partitions followed by logical partitions.
 
64 bit versions:
http://ltr-data.se/f.../x64/imdisk.cpl
http://ltr-data.se/f...0/x64/devio.exe
 
32 bit versions:
http://ltr-data.se/f.../x86/imdisk.cpl
http://ltr-data.se/f...0/x86/devio.exe
 
Replace the existing imdisk.cpl in your C:\Windows\system32 directory.



#22 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 18 November 2018 - 04:09 PM

Just perfect. :thumbup:

But how will we have that with imdisk.exe?



#23 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 18 November 2018 - 04:15 PM

The -v switch with imdisk.exe will work just like before, but will use the new API to find a partition with that number.



#24 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 18 November 2018 - 04:35 PM

And... imdisk.exe

64 bit version:
http://ltr-data.se/f.../x64/imdisk.exe
 
32 bit version:
http://ltr-data.se/f.../x86/imdisk.exe

Replace the existing imdisk.exe in your C:\Windows\system32 directory.

#25 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 18 November 2018 - 04:47 PM

Great! This is fine with me, but it could break compatibility for command line users who use imdisk.exe in a script to mount logical partitions... Likely a rare case, but not impossible.
That said, I still think that this is a good change and you should keep things as is.

By the way, don't forget to change the syntax help for imdisk.exe, because now, partition 4 does no longer mean "1st logical partition" but "4th partition found".







Also tagged with one or more of these keywords: imdisk, xxcopy, error

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users