Jump to content











Photo
- - - - -

imdisk extends disk size failed (incorrect function)

imdisk extending disk size

  • Please log in to reply
5 replies to this topic

#1 redsun

redsun
  • Members
  • 6 posts
  •  
    Vietnam

Posted 18 January 2012 - 01:52 PM

Hi all,

I've searched imdisk forum for "incorrect function" error when I try to extend disk size, but there's no information.

Could anybody tell me why I got this error?
I did these step:

1. Create a imdisk virtual disk (type Harddisk, format: NTFS, size: 100MB)
2. extends with this command:
imdisk -e -s 200000000 -m I:

3. and I got this error:

Extending disk size...
I: Incorrect function.

I got the same error when I use imdiskNet.dll to extend disk size.

Thank you for your answers.

#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 19 January 2012 - 08:25 AM

I have never seen that error for hard disk type drives before.

Just one thing to check. Are you sure that you really get a hard disk type virtual disk? There are some disk sizes and file extensions that automatically translates to for example CD/DVD or floppy drives if you leave disk type at auto-select. Make sure that you specify -o hd on command line or tick the Hard disk volume box if you are using the Control Panel applet.

#3 redsun

redsun
  • Members
  • 6 posts
  •  
    Vietnam

Posted 19 January 2012 - 09:04 AM

Thank you for your answer.

Even I did check "Hard disk volume" check box.

I made a new test for this:

Test 1:
- create 100MB file.
- create a new disk (Hard disk volume), offset=0 with file above.
- format disk in NTFS
- extend disk up to 200MB
--> this works fine.

Test 2:
- create 100MB file.
- create a new disk (Hard disk volume), offset=1024 with file above.
- format disk in NTFS
- extend disk up to 200MB
-> get error : incorrect function

Could you please tell me what is different here to get error?

Acctually, I'm making a program similar to Contron Panel applet using ImDiskAPI and I faced this problem.

Thank you in advance.

#4 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 19 January 2012 - 09:24 AM

Ah, now I see. You are using an offset. I did not think of that, sorry.

Extending an image file with an offset is not allowed. This is just to be safe so that people don't accidently overwrite partition layout on mounted image files. If this would be allowed, a user could mount a partition within an image of an entire hard disk and then extend a mounted volume overwriting following volumes. Also, the skipped MBR at the beginning of the image file would not be updated to reflect this so when mounting image next time the user would get the old volume size again, but then with an extended filesystem on it that would expect a larger underlying disk size. Both these scenarios would cause trashed filesystems.

#5 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 19 January 2012 - 09:28 AM

Some other news for you and others using .NET API:
There will soon be a new version of this API with some improvements. There will be better support for auto-detecting offsets and for reading partition tables and selecting a particular partition to mount. This means that you would not have to write that logic yourself, you will be able to access the logic originally written for ImDisk Control Panel applet from your .NET application.

#6 redsun

redsun
  • Members
  • 6 posts
  •  
    Vietnam

Posted 19 January 2012 - 01:42 PM

Hi Olof Lagerkvist,

Thank you for your information and your answers. Now, I understood why I cannot extend disk size.
I am looking forward for new version of .Net API.





Also tagged with one or more of these keywords: imdisk, extending disk size

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users