aim_ll -a -t vm -S 4096 -s 512M
fsutil file createnew Z:\Temp 268435456 fsutil file setvaliddata Z:\Temp 268435456 aim_ll -a -f Z:\Temp
Edited by pter6464, 23 November 2018 - 07:09 PM.
Best Answer Olof Lagerkvist , 23 November 2018 - 07:29 PM
This happens because the top-most drive tries to read/write 512 byte aligned data in unbuffered mode. Because the underlying storage requires 4096 byte-aligned I/O for unbuffered requests, this will fail somewhere sooner or later. One way around that is to use for example devio.exe that opens the image file in buffered mode and then have the second AIM call contact the devio instance instead of opening the image file directly.
I have had some plans for introducing a command line flag for opening underlying image files in buffered mode that would solve this too. There are a few possibly dangerous side effects with allowing that because going through file system cache with requests *from* disk drivers could lead to dead-locks in file system drivers (file system driver will see this as a request from kernel mode, but still let the request go through the cache system). But it could still be useful of course. But until that is done, devio.exe or similar solutions are your best options!
Go to the full postPosted 23 November 2018 - 07:04 PM
aim_ll -a -t vm -S 4096 -s 512M
fsutil file createnew Z:\Temp 268435456 fsutil file setvaliddata Z:\Temp 268435456 aim_ll -a -f Z:\Temp
Edited by pter6464, 23 November 2018 - 07:09 PM.
Posted 23 November 2018 - 07:29 PM Best Answer
This happens because the top-most drive tries to read/write 512 byte aligned data in unbuffered mode. Because the underlying storage requires 4096 byte-aligned I/O for unbuffered requests, this will fail somewhere sooner or later. One way around that is to use for example devio.exe that opens the image file in buffered mode and then have the second AIM call contact the devio instance instead of opening the image file directly.
I have had some plans for introducing a command line flag for opening underlying image files in buffered mode that would solve this too. There are a few possibly dangerous side effects with allowing that because going through file system cache with requests *from* disk drivers could lead to dead-locks in file system drivers (file system driver will see this as a request from kernel mode, but still let the request go through the cache system). But it could still be useful of course. But until that is done, devio.exe or similar solutions are your best options!
Posted 24 November 2018 - 01:04 AM
Thank you for the fast and detailed reply! Good to know that this is an expected behavior. I'll use devio as a workaround
I updated my context menus for AIM (which I started in another thread) to support mounting through devio, here they are for those interested:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\AIMMountFile] @="Mount as &AIM Virtual Disk" "HasLUAShield"="" [HKEY_CLASSES_ROOT\*\shell\AIMMountFile\command] @="C:\\AIM\\aim_lle.bat -a -t file -o rw,fksig -f \"%L\"" [HKEY_CLASSES_ROOT\*\shell\AIMMountFileRO] @="Mount as &AIM Virtual Disk (read only)" "HasLUAShield"="" [HKEY_CLASSES_ROOT\*\shell\AIMMountFileRO\command] @="C:\\AIM\\aim_lle.bat -a -t file -o ro,fksig -f \"%L\"" [HKEY_CLASSES_ROOT\*\shell\AIMMountFile4K] @="Mount as &AIM Virtual Disk (4K sectors)" "HasLUAShield"="" [HKEY_CLASSES_ROOT\*\shell\AIMMountFile4K\command] @="C:\\AIM\\aim_lle.bat -a -t file -o rw,fksig -S 4096 -f \"%L\"" [HKEY_CLASSES_ROOT\*\shell\AIMMountFileDIO] @="Mount as &AIM Virtual Disk (thru devio)" "HasLUAShield"="" [HKEY_CLASSES_ROOT\*\shell\AIMMountFileDIO\command] @="C:\\AIM\\aim_dio.bat \"%L\"" [HKEY_CLASSES_ROOT\Drive\shell\AIMUnmount] @="Unmount &AIM Virtual Disk" "HasLUAShield"="" [HKEY_CLASSES_ROOT\Drive\shell\AIMUnmount\command] @="C:\\AIM\\aim_lle.bat -d -m %L" [HKEY_CLASSES_ROOT\Drive\shell\AIMUnmountF] @="Unmount &AIM Virtual Disk (force)" "HasLUAShield"="" [HKEY_CLASSES_ROOT\Drive\shell\AIMUnmountF\command] @="C:\\AIM\\aim_lle.bat -R -m %L"
aim_lle.bat (provides elevation, if necessary):
@echo off :checkIfElevated net session 1>NUL 2>NUL if %ERRORLEVEL% == 0 goto ok echo Admin privileges required... %~dp0aim_lle.lnk %* goto end :ok %~dp0aim_ll %* pause :end
aim_dio.bat :
@echo off set dport=9001 :findport netstat -o -n -a | find "LISTENING" | find ":%dport%" > NUL if %ERRORLEVEL% == 0 ( set /a dport += 1 goto findport ) start "" /B %~dp0devio %dport% %* %~dp0aim_lle.bat -a -t proxy -o ip -f localhost:%dport%
aim_lle.lnk is a shortcut to aim_lle.bat with 'Shortcut > Advanced > Run as admin' checked. It is required for elevation.
Boot methods & tools →
Boot from LAN →
Is it possible to use AIM as a iSCSI serverStarted by ZEE , 02 Jun 2015 storage, network, aim, iscsi |
|
|
||
|
Groups →
Security →
ProxyCryptStarted by v77 , 05 Nov 2013 arsenal image mounter, imdisk and 3 more... |
|
|
0 members, 1 guests, 0 anonymous users