Jump to content











Photo
- - - - -

RamDisk (ImDisk) - calculate size


  • Please log in to reply
19 replies to this topic

#1 nikzzzz

nikzzzz

    Frequent Member

  • .script developer
  • 263 posts

Posted 21 August 2008 - 08:23 AM

The automatic choice of the size of a disk is not absolutely correct - the memory necessary for job of system is not considered.
For its small memory can not suffice, for big it is used irrationally (small RamDisk).
Bat-File Calculation of the size RamDisk.
@echo off

:: %1=MountPoint %2=FileSystem %3=MinSize %4=Reserv %5=Size %6=Unit %7=label %8=Pack 

:: MinSize - The minimum size RamDisk

:: Reserv -  It is reserved under system

set FileSystem=%2

set Pack=%8

:: The rigid size

if "%6"=="M" (

  set "Size=%5"

  goto _1

)

:: Calculation of the size

for /f "usebackq skip=1 tokens=3 delims=: " %%i in (`RamStatus.exe`) do set size=%%i

set /a size=%size%/1024

set /a "size=(%size%-%4)*%5/100"

if %size% lss %3 set size=%3

:_1

::There is no sense to use NTFS for small disks 

if %size% lss 16 set "FileSystem=fat"

:: Packing is incompatible with FAT  

if "%FileSystem%"=="fat" set "Pack= "

imdisk.exe -a -t vm -m %1 -s %size%M -p "/fs:%FileSystem% /q /y /v:%7 %Pack%"



Regards,
Nikzzzz.

#2 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 22 August 2008 - 04:34 AM

Hi Nikzzzz,

Nice idea!

The ImDisk script base you used was a little out-of-date, so I added your additions to the latest. Version 16 is now on the LiveXP server.

Regards,
Galapo.

#3 nikzzzz

nikzzzz

    Frequent Member

  • .script developer
  • 263 posts

Posted 22 August 2008 - 08:38 AM


Not essentially - ufat.dll copied in two places ([Process] and [FastFat])
ImDisk updated to version 1.03 (in a script - 1.02), fixed considerable bugs.

Can be to combine scripts Imdisk and TempPe?

Regards,
Nikzzzz.

#4 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 22 August 2008 - 08:45 AM

I'll have to update the update!

#5 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 23 August 2008 - 11:33 AM

I've uploaded a new version which deletes one of the references to ufat.dll and updated to latest imdisk version.

Can be to combine scripts Imdisk and TempPe?


Maybe, but I guess I like providing the option of including imdisk in the build (necessary, say, for WimPack with vmdk option) but wher %temp% is on %systemdrive%. In this case, TempPE would set %temp% to %systemdrive% and so would not install imdisk. So perhaps best to keep them separate.

Regards,
Galapo.

#6 nikzzzz

nikzzzz

    Frequent Member

  • .script developer
  • 263 posts

Posted 04 September 2008 - 11:35 PM

Small addition - Shortcut in the menu administration.
Attached File  ImDisk.7z   89.53K   289 downloads
Regards,
Nikzzzz.

#7 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 05 September 2008 - 12:15 AM

Hi Nikzzzz,

Thanks for that. I've increased the version number and uploaded to the LiveXP server.

Regards,
Galapo.

#8 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5,013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 05 September 2008 - 01:42 AM

Hi Nikzzzz,

Thanks for imdisk :whistling:

I have a wish for imdisk,

I tried to create pagefile on ramdisk (6mb) to make pagefile required utility work easly, but creating on ramdisk or mounted bootsdi image failed, creating on existing disk success.

Galapo wrote before:

I think the reason why the pagefile cannot be created on ramdrive in LiveXP is that default ramdrive is created by ImDisk. ImDisk disks aren't listed under 'System\MountedDevices' and so the pagefile is not created.


is it possible to have imdisk mounted drives on 'System\MountedDevices' ;)

#9 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 05 September 2008 - 02:32 AM

is it possible to have imdisk mounted drives on 'System\MountedDevices' :whistling:

No, it would require a re-write and change of logic by the imdisk driver.

I'm not sure of any way, on the other hand, of being able to "trick" a pagefile into being created on an imdisk ramdrive given the way imdisk works (partition mounting vis-a-vis disk mounting).

Regards,
Galapo.

#10 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5,013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 05 September 2008 - 03:03 AM

Thanks for clearing that out of my mind Galapo :whistling: ;)

#11 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 05 September 2008 - 06:03 AM

@Lancelot

Try using VDK, which has a more "hard disk like" integration in the system (is accessible as \\.\PhysicalDriven)

http://chitchat.at.i...vmware/vdk.html

jaclaz

#12 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5,013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 05 September 2008 - 07:21 AM

@jaclaz

Thanks for your concern,
it was in my mind too, i make a trial after your message which ringed the bell "time came for vmdk trial" :whistling: but this time mounting .vmdk which is in ramdisk cause trouble.

here i try to mount a .vmdk image in ramdrive, which fails
http://img158.images...25/snap1vv6.png
here i try to mount same .vmdk image in harddisk, which succeed
http://img158.images...00/snap2ka1.png
(I can already create pagefile on harddisk)

my aim was putting pagefile to ramdisk (for pc which have lots of ram, or by automating with 'when ramdisk is bigger than xx than create pagefile') so pagefile creation will be independent from the need of real disk, without mounting i cant create pagefile in .vmdk ;)

#13 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,098 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 05 September 2008 - 05:54 PM

Some ideas:
Have you tried with RAW images (NOT .vmdk) + .pln file?
Is the IMDISK ramdisk formatted as NTFS?
Is the .vmdk RAW image a sparse file?
Has it already been properly partitioned and formatted?

Use my batches to create a sparse file RAW image, partition and format it:
http://www.boot-land...?showtopic=3191
http://www.boot-land...?showtopic=5000

Once partitioned and formatted, you can continue usng the .pln descriptor file or directly mount the image file.

jaclaz

#14 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7,687 posts

Posted 05 September 2008 - 06:56 PM

I presume the problem with ImDisk is that it's seen as a removable drive and Windows does not like to put the swap file on a removable drive.

:whistling:

#15 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 04 November 2008 - 09:29 AM

Script updated with new ImDisk version. Available off the LiveXP server.

Regards,
Galapo.

#16 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 24 November 2008 - 12:11 AM

Script updated with new ImDisk version -- 1.1.0 Available off the LiveXP server.

Regards,
Galapo.

#17 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 26 November 2008 - 09:59 PM

Script updated with new ImDisk version 1.1.1. Available off the LiveXP server.

Regards,
Galapo.

#18 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 02 December 2008 - 10:36 PM

Script updated with new ImDisk version 1.1.2. Available off the LiveXP server.

Regards,
Galapo.

#19 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 07 December 2008 - 03:45 AM

Script updated with new ImDisk version 1.1.3. Available off the LiveXP server.

Regards,
Galapo.

#20 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 06 May 2010 - 09:59 AM

Script updated with new ImDisk version 1.2.8. Available off the LiveXP server.

Regards,
Galapo.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users