BootCD problem: Ramdisk (xmsdsk.exe) and Ghost.ini

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Facts
  • Using Bart's Corpmb bootcd
  • altered the relevant menu entry so that a ghost settings file (ghost.ini) is also copied over to the ramdisk (Frank Uberto's xmsdsk.exe)
    Code:
    #if_exist %cddrv%\ghost\ghost.exe
    Symantec Ghost
      if "%dmpdrv%" == "" goto _ghost
      %dmpdrv%
      cd \
      echo.
      echo You can store your ghost images on drive %dmpdrv%...
      echo.
      :_ghost
      echo Copying Ghost to ramdisk...
      echo.
      copy %cddrv%\ghost\ghost.exe %tmp%\ghost.exe
      copy %cddrv%\ghost\ghost.ini %tmp%\ghost.ini               <---what I added
      ; %tmp%\ghost.exe -afile=%tmp%\ghost.err                 <---thought cmdline switches might have been overriding .ini so I commented it out
      %tmp%\ghost.exe                                            <--- added basic line in its place
      del %tmp%\ghost.exe
      del %tmp%\ghost.ini
      if errorlevel 1 pause
    #endif
  • ghost launches but ignores the settings file
  • but if ghost is not copied to the ramdisk, and just run from its directory on the CD, it utilizes the settings file...same thing if you put them on a floppy (no surprise given the former)
Any ideas why ghost is ignoring the ini file when its run from the ramdisk?
 

blakerwry

Storage? I am Storage!
Joined
Oct 12, 2002
Messages
4,203
Location
Kansas City, USA
Website
justblake.com
Try this... I think ghost uses the ini file in the path that ghost was ran from, not where it is stored... .
Code:
#if_exist %cddrv%\ghost\ghost.exe
Symantec Ghost
  if "%dmpdrv%" == "" goto _ghost
  %dmpdrv%
  cd \
  echo.
  echo You can store your ghost images on drive %dmpdrv%...
  echo.
  :_ghost
  echo Copying Ghost to ramdisk...
  echo.
  copy %cddrv%\ghost\ghost.exe %tmp%\ghost.exe
  copy %cddrv%\ghost\ghost.ini %tmp%\ghost.ini               <---what I added
  ; %tmp%\ghost.exe -afile=%tmp%\ghost.err                 <---thought cmdline switches might have been overriding .ini so I commented it out
  cd %tmp%
  ghost.exe                                            <--- added basic line in its place
  del %tmp%\ghost.exe
  del %tmp%\ghost.ini
  if errorlevel 1 pause
#endif
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
I think ghost uses the ini file in the path that ghost was ran from, not where it is stored...
But it was in the path that ghost was run from.

  • The ramdisk is Q:
  • The cddrv is R:
  • The files ghost.exe and ghost.ini reside in the directory R:\ghost
  • Both files are then copied into the directory Q:\tmp (Note: both Q and all related paths, such as the tmp directory, have been correctly set eariler)
  • ghost.exe is then executed from Q:\tmp

The result is complete ignorance of the ini settings.

If, on the otherhand, we forget about doing anything with the ramdisk, and instead drop to the cmdline and just execute ghost from the directory R:\ghost, the result is that ghost will use the ini file.

I'm just not sure why it doesn't run correctly when its executed with both files in the Ramdisk. Bug?

Try this.
no dice...actually results in an error and so exits back to the menu. xmsdsk won't let you switch to the its directories for some reason. For example, say you're at the cmd prompt and in root of R:, then the following is what happens:

R:\copy R:\ghost\ghost.exe Q:\tmp\ghost.exe
1 file copied
R:\cd Q:
R:

hmmm, how about:

R:\dir Q:\tmp
1 file ghost.exe blah blah blah....
R:\

Okay then. :roll: I can copy stuff into the ramdisk, and I can run commands from the ramdisk, yet I just can't access the directory on the ramdisk....hmmm, perhaps the same applies to ghost.exe....maybe it can't access the directory either....hmmm going to have a look at the switches used for the ramdisk.
 

mubs

Storage? I am Storage!
Joined
Nov 22, 2002
Messages
4,908
Location
Somewhere in time.
Can you change directories to the CD, then run Ghost from the Ramdrive and let it pick up the ini from the CD?
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
The autoexec.bat of the boot image sets up the ramdisk as follows:
Code:
xmsdsk 8192 %ramdrv% /y /t
and the xmsdsk /? verbose is as follows:
Code:
XMSDSK : adjustable XMS RAMdisk             (v1.9I - 08/98)
   Copyright (C) Franck UBERTO      38000 Grenoble - FRANCE

- Install driver either in config.sys:
   device[high]='path'\xmsdsk.exe [size in KB]
                             default size is 0.
- Reboot your system.
- _OR_ in autoexec.bat:
   xmsdsk [size in KB] [drive:] [options]
     Options are:  /? - this help
                   /y - default to yes
                   /u - unload driver
                   /t - top of XMS memory
                   /c - cluster size in sectors
                        (1 to 64, power of 2)
- Enter 'xmsdsk' to display current RAMdisk size.
- Enter 'xmsdsk <size in KB>' to change RAMdisk size.
The readme file for xmsdsk goes into a little more detail, but not much of importance (note: ignore the stuff about emsdsk, as the readme was written for both the xms and ems version of the driver)
Code:
if you want to do it purposely, in autoexec.bat for
  example, type:

  XMSDSK [size in Kbytes] [drive:] [/c##] [/t] /y (or EMSDSK)
     This will try to load driver in upper mem without being prompted.
     The driver part is relocated in the "best fit" place, first in upper
     memory otherwise, if unsuccessful, in lower memory. This should prevent
     memory fragmentation.
     If a drive is specified then it will be tried, otherwise first available
     drive will be used. Drive must be <= LASTDRIVE (in config.sys or 
     dblspace/drvspace.ini, see NB2 above).
     Parameter /t can be used to tell the driver to allocate XMS memory from
     the top addresses instead of lower ones. Some machines under Win95 hang 
     up when there's no free memory under 16 MBytes. It can be used too if 
     you have problem playing sounds under Windows. These 2 issues seem to be
     related to DMA buffering.
     Parameter /c is used to set a cluster size. Without it the RAMdisk is 
     formatted to have the least number of clusters (more speed). With /c you
     can specify a cluster size from 1 to 64 sectors (syntax: /c## or /c ##).
     Remember too that clusters are always a power of 2. If the given size 
     can't work (too much clusters) the next good size will be used, so
     setting "/c1" will always give the smallest cluster size possible (less 
     wasted space).
     Options are not case-sensitive, can be entered in any order, with or 
     without space.

  XMSDSK (or EMSDSK)
     On DOS command line, tells you the size and drive used by the ramdisk.

  XMSDSK <size in Kbytes> [/t] [/c##] (or EMSDSK)
     Modify the size of the ramdisk.
     Eventually setting the cluster size and using "top" XMS memory.

  XMSDSK <size in Kbytes> /y [/c ##] [/t] (or EMSDSK)
     In a batch file this prevents being prompted when modifying size.
     XMSDSK (and EMSDSK) returns a value which can be used with "errorlevel"
     to tell where it is installed: 0 if not installed or in case of error,
     1 for drive A (huh?), 2 for B (huh huh?), 3 for C (hmmm?), etc ...

  XMSDSK /u (or EMSDSK)
     Remove driver from memory, disk doesn't exist anymore.
     
  XMSDSK /u /y (or EMSDSK)
     Same as above, without prompting.  :-)
  
  XMSDSK /? (or EMSDSK)
     A little help.


  NB1: size is in Kbytes (1024 bytes) and rounded to the upper 16 Kbytes.
  NB2: it's BETTER TO NOT USE LOADHIGH with EMS/XMSDSK as it can relocate
       itself with more success than DOS could do.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
mubs said:
Can you change directories to the CD, then run Ghost from the Ramdrive and let it pick up the ini from the CD?
That's a thought. I'm not even certain what the initial working directory is, but anyways, I'll give this a go:

#if_exist %cddrv%\ghost\ghost.exe
Symantec Ghost
if "%dmpdrv%" == "" goto _ghost
%dmpdrv%
cd \
echo.
echo You can store your ghost images on drive %dmpdrv%...
echo.
:_ghost
echo Copying Ghost to ramdisk...
echo.
copy %cddrv%\ghost\ghost.exe %tmp%\ghost.exe
cd %cddrv%\ghost
%tmp%\ghost.exe
del %tmp%\ghost.exe
if errorlevel 1 pause
#endif
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
CityK said:
I'm not even certain what the initial working directory is
oops, I guess the " cd \ " means its in the root of the cddrv ....or maybe the root of the boot image...either way, its not were I want to be
 

Fushigi

Storage Is My Life
Joined
Jan 23, 2002
Messages
2,890
Location
Illinois, USA
CityK said:
R:\copy R:\ghost\ghost.exe Q:\tmp\ghost.exe
1 file copied
R:\cd Q:
R:

hmmm, how about:

R:\dir Q:\tmp
1 file ghost.exe blah blah blah....
R:\
This is the way CD functions. "cd Q:" does not change to drive Q:; it changes the current directory on Q: to what you specify; in this case nothing so no change actually occurs.

R:> cd Q:\tmp would change to the tmp dir on Q: but leave you on R:. Anything accessed on Q: would default to looking in the Q:\tmp dir. Executing "Q:" would result in a Q:\tmp> prompt.

I think what you mean to do is:

Q:
CD \tmp

Or, using your batch vars:

%cddrv%
cd \%tmp%
 

sechs

Storage? I am Storage!
Joined
Feb 1, 2003
Messages
4,709
Location
Left Coast
Is there some reason that you cannot use command switches instead of the .ini file? That would alleviate the whole issue.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Fushigi said:
This is the way CD functions. "cd Q:" does not change to drive Q:; it changes the current directory on Q: to what you specify; in this case nothing so no change actually occurs.

R:> cd Q:\tmp would change to the tmp dir on Q: but leave you on R:. Anything accessed on Q: would default to looking in the Q:\tmp dir. Executing "Q:" would result in a Q:\tmp> prompt.
I'm a monkey. I should have remembered that. But thanks for refreshing my memory .... the ol' grey mare she ain't what she used to be, ain't what she used to be, ain't what she used to be!. The ol'.....

I think what you mean to do is:

Q:
CD \tmp

Or, using your batch vars:

%cddrv%
cd \%tmp%
Close!

The winning (relevant) code was:
Code:
  copy %cddrv%\ghost\ghost.exe %tmp%\ghost.exe
  copy %cddrv%\ghost\ghost.ini %tmp%\ghost.ini
  %ramdrv%
  cd %ramdrv%\tmp
  ghost.exe
  del %tmp%\ghost.exe
  del %tmp%\ghost.ini
  %cddrv%
Is there some reason that you cannot use command switches instead of the .ini file? That would alleviate the whole issue.
It would indeed. But then I'd be right back to my original problem: occasionally forgetting to manually set the option switches before proceeding with the ghost operation.[/quote]
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
sechs said:
Perhaps I'm missing something.
No, but I certainly am! :D Oh man, I'm really being a monkey. For some reason I thinking along the lines that using the commandline swithches would launch ghost in a non-gui mode....then I got obsessive with trying to figure out the ini business.

Oh well. I relearned a few things along the way, so it was still a useful exercise.
 

sechs

Storage? I am Storage!
Joined
Feb 1, 2003
Messages
4,709
Location
Left Coast
While you certain can run Ghost in batch mode, be default, it runs the full-screen interface.

Check your online manuals. There are enough command-line options to kill a horse. On a bored day, I used to force maximum compression, which is not an option in the program.
 
Top