Digg this topic Add to my del.icio.us Submit to SlashDot 3 Pages V  < 1 2 3 >  
Reply to this topicStart new topic
> ImDisk commandline script to create/mount RamDisk, from regular Windows OS
MedEvil
post Sep 4 2007, 05:31 PM
Post #11


Advanced Member
***

Group: .script developer
Posts: 1,803
Joined: 29-December 06
Member No.: 2,192



QUOTE (jaclaz @ Sep 4 2007, 06:59 PM) *
As far as I know in Mounted Devices you get only drive letters and VolumeID. (and "coupling" them is not that easy)

(IMG:http://www.boot-land.net/forums/style_emoticons/default/confused1.gif) It's pretty easy and straight forward, i thought.

QUOTE (jaclaz @ Sep 4 2007, 06:59 PM) *
Does that mean that you also don't know how to do it? (IMG:http://www.boot-land.net/forums/style_emoticons/default/confused1.gif)
In other words, WHERE? means that I would like to get informations about WHERE and HOW to find it, not generic references to the Registry, to a Registry hive or the advice to search for it.

I was just giving you a general answer, since i have no clue what informations you're exactly looking for.

QUOTE (jaclaz @ Sep 4 2007, 06:59 PM) *
The point is that as far as I know with the VolumeId one can "search for all other informations" but cannot find:
1) the arcpath link
2) the \Device\HarddiskVolumen symlink
3) the \device\Harddiskx\Partitiony\ symlink

Sorry, but i don't understand what exactly you mean. Where do you hope to find those structures? Or maybe better asked, where do you got those structure from?

(IMG:http://www.boot-land.net/forums/style_emoticons/default/cheers.gif)
Go to the top of the page
 
+Quote Post
Olof Lagerkvist
post Sep 4 2007, 07:58 PM
Post #12


Advanced Member
***

Group: Developer
Posts: 120
Joined: 27-April 07
From: Borås, Sweden
Member No.: 6,234


Sweden


QUOTE (jaclaz @ Sep 4 2007, 06:59 PM) *
@Medevil

As far as I know in Mounted Devices you get only drive letters and VolumeID. (and "coupling" them is not that easy)

The easiest (in my opinion (IMG:http://www.boot-land.net/forums/style_emoticons/default/whistling.gif) ) is to use winobj and look in the \Device, \GLOBAL?? and \Device\Harddiskn directories.

http://www.microsoft.com/technet/sysintern...ion/WinObj.mspx
Go to the top of the page
 
+Quote Post
jaclaz
post Sep 4 2007, 08:51 PM
Post #13


Finder
***

Group: Advanced user
Posts: 1,581
Joined: 14-July 06
Member No.: 2


Italy


@Medevil
QUOTE
I was just giving you a general answer, since i have no clue what informations you're exactly looking for.


Look, the question appeared to me clear enough:
QUOTE (jaclaz)
How can one find the other names like
\device\Harddiskx\Partitiony\ ??

i.e. the type of volume names imdisk understands and that Bilou Gateux had a problem with.
...and, sorry (IMG:http://www.boot-land.net/forums/style_emoticons/default/sad.gif) , but yours is not a "general" answer, it is a "non-answer". (IMG:http://www.boot-land.net/forums/style_emoticons/default/frusty.gif)

QUOTE (Medevil)
Sorry, but i don't understand what exactly you mean. Where do you hope to find those structures? Or maybe better asked, where do you got those structure from?

I do not hope to find these structures ANYWHERE in the Registry, I am actually pretty sure they are NOT there, it was you that suggested the use of the Registry.

To recap, in windows volumes can have different "names" or "links" (sorry but I simply do not have the needed knowledge to apply the proper term), let's say that a volume can be referenced in different ways, the one I know are, besides drive letters or mount points:
1) the arcpath link
2) the \Device\HarddiskVolumen symlink
3) the \device\Harddiskx\Partitiony\ symlink

To get the above I have found:

For #1 the Recovery Console map arc command and, indirectly, dmdiag.exe.

As Olof pointed out, it is possible to get #3 with winobj, a GUI program by Mark Russinovich, and #2 by his dosdev program.

I already knew that, but instead of dosdev I use the dsfok toolkit vlm.exe program as the dosdev being "dosdevices centered" is only valid for volumes to which a Dosdevice letter has been assigned.

For #3 the only tool I found was the said dmdiag.exe, which is however normally not installed on Windows XP and needs to be downloaded (as part of the Resource Kit) for Win2Kand, besides, it is very slow, as it gathers and outputs a great number of info, which again is a bit difficult (and thus slow) to parse.

@Olof
Yes, I am aware of that, but Winobj is not very useful for a batch file, is it? (IMG:http://www.boot-land.net/forums/style_emoticons/default/whistling.gif)
Ideally, some programmer, possibly from Sweden, and with initials O.L., (IMG:http://www.boot-land.net/forums/style_emoticons/default/wink.gif) would write a program called "volnames.exe" which, when executed, would output something like:
CODE

A: Removable disk
A: = \Device\Floppy0 [Removable]
A: \Device\Floppy0
A: \\?\Volume{a6098580-a8ad-11d7-be49-004063c5ef4c}\

\??\PhysicalDrive0 (SymbolicLink) -> \Device\Harddisk0\DR0
\Device\Harddisk0\Partition0 (SymbolicLink) -> \Device\Harddisk0\DR0

C: Fixed disk PhysicalDrive0
C: \Device\Harddisk0\Partition1 (SymbolicLink) -> \Device\HarddiskVolume1
C: = \Device\HarddiskVolume1 [Fixed]
C: \Device\HarddiskVolume1 \Device\Harddisk0\DR0
C: \\?\Volume{c13e09f2-fd22-11d4-9f0a-806d6172696f}\
C: \??\Volume{c13e09f2-fd22-11d4-9f0a-806d6172696f} (SymbolicLink) -> \Device\HarddiskVolume1
\??\C: (SymbolicLink) -> \Device\HarddiskVolume1
C:\ multi(0)disk(0)rdisk(0)partition(1)\

D: Fixed disk PhysicalDrive0
D: \Device\Harddisk0\Partition2 (SymbolicLink) -> \Device\HarddiskVolume2
D: = \Device\HarddiskVolume2 [Fixed]
D: \Device\HarddiskVolume2 \Device\Harddisk0\DR0
D: \\?\Volume{c13e09f3-fd22-11d4-9f0a-806d6172696f}\
D: \??\Volume{c13e09f3-fd22-11d4-9f0a-806d6172696f} (SymbolicLink) -> \Device\HarddiskVolume2
\??\D: (SymbolicLink) -> \Device\HarddiskVolume2
D:\ multi(0)disk(0)rdisk(0)partition(2)\


(IMG:http://www.boot-land.net/forums/style_emoticons/default/cheers.gif)

jaclaz
Go to the top of the page
 
+Quote Post
MedEvil
post Sep 4 2007, 11:23 PM
Post #14


Advanced Member
***

Group: .script developer
Posts: 1,803
Joined: 29-December 06
Member No.: 2,192



Sorry jaclaz, but if you can't tell me, what you're looking for, in a way that i understand it, i for sure can't help you find it.

About finding data in the way imdisk understands them. I admit i have absolutely no idea, in what way or form imdisk likes it's data, but i'm pretty sure no other program will store them in exactly that way. Especialy Windows.
It's a question of knowing what data you need and then of extracting and converting them, as always.

About your little code snippet.
You use registry structures, boot.ini structures and some that look like they could be Linux. (IMG:http://www.boot-land.net/forums/style_emoticons/default/confused1.gif)
Are those really all the same to you?
That's like mixing several languages in a sentence!
Go to the top of the page
 
+Quote Post
jaclaz
post Sep 5 2007, 08:54 AM
Post #15


Finder
***

Group: Advanced user
Posts: 1,581
Joined: 14-July 06
Member No.: 2


Italy


Medevil,
1) take a deep breath
2) run dmdiag.exe on a machine, redirecting output to a .txt file like in:
CODE
dmdiag.exe >dmdiag.txt

3) Read attentively the contents of dmdiag.txt, if needed re-read it
4) Preferably read this:
http://www.microsoft.com/technet/sysintern...ion/WinObj.mspx
download winobj and run it, looking at what data it displays on your machine
5) Take your time thinking about what you read
6) Consider whether, at the light of the precious experiences, you want to reconsider what you wrote:
QUOTE (Medevil)
About finding data in the way imdisk understands them. I admit i have absolutely no idea, in what way or form imdisk likes it's data, but i'm pretty sure no other program will store them in exactly that way. Especialy Windows.

(bolding is mine)

About this:
QUOTE (Medevil)
About your little code snippet.
You use registry structures, boot.ini structures and some that look like they could be Linux.
Are those really all the same to you?
That's like mixing several languages in a sentence!


in my opinion, by hinting that I don't know what I am talking about and that I am not able to properly express myself, is unneededly offensive. (IMG:http://www.boot-land.net/forums/style_emoticons/default/realmad.gif)

Is there any reason for this attitude? (IMG:http://www.boot-land.net/forums/style_emoticons/default/confused1.gif)

jaclaz
Go to the top of the page
 
+Quote Post
MedEvil
post Sep 5 2007, 11:11 AM
Post #16


Advanced Member
***

Group: .script developer
Posts: 1,803
Joined: 29-December 06
Member No.: 2,192



QUOTE (jaclaz @ Sep 5 2007, 10:54 AM) *
Medevil,
1) take a deep breath
2) run dmdiag.exe on a machine, redirecting output to a .txt file like in:
.
.
.
download winobj and run it, looking at what data it displays on your machine

(IMG:http://www.boot-land.net/forums/style_emoticons/default/laugh.gif) I think, i'm starting to understand where our problem lies. You're an admin, arn't you? I'm a coder.
We were comparing apples with pears!
In your world data exist in the form they are input or output of programs.
You can't find data in that form in the registry. In the registry exist data, as in any configuration file, as they are intenally stored and used.
So my information, was from your point of view, really absolutely useless!
Seems i've been hanging out too much with psc and Nuno, was thinking everyone around here is a coder. (IMG:http://www.boot-land.net/forums/style_emoticons/default/wink.gif)

QUOTE (jaclaz @ Sep 5 2007, 10:54 AM) *
in my opinion, by hinting that I don't know what I am talking about and that I am not able to properly express myself, is unneededly offensive. (IMG:http://www.boot-land.net/forums/style_emoticons/default/realmad.gif)

Is there any reason for this attitude? (IMG:http://www.boot-land.net/forums/style_emoticons/default/confused1.gif)

And (IMG:http://www.boot-land.net/forums/style_emoticons/default/laugh.gif) again!
I'm not hinting at anything, except that we had a serious communication problem, which, as with all communications, can never be the fault of just one party.
So assuming, that i think it's all your fault, only means that you're taking yourself faaaaar too important. (IMG:http://www.boot-land.net/forums/style_emoticons/default/wink.gif) (IMG:http://www.boot-land.net/forums/style_emoticons/default/wink.gif) (IMG:http://www.boot-land.net/forums/style_emoticons/default/wink.gif)

(IMG:http://www.boot-land.net/forums/style_emoticons/default/cheers.gif)
Go to the top of the page
 
+Quote Post
jaclaz
post Sep 5 2007, 12:18 PM
Post #17


Finder
***

Group: Advanced user
Posts: 1,581
Joined: 14-July 06
Member No.: 2


Italy


Well,
I am not an admin (apart from here at boot-land and on a couple other boards around), but I don't see how that would change the situation, as well as the fact whether you are a coder or not.
Let's not be racists or classists. (IMG:http://www.boot-land.net/forums/style_emoticons/default/smile.gif)

QUOTE (Medevil)
We were comparing apples with pears!

Well, NO, maybe you.
I sometimes compare apples with oranges (IMG:http://www.boot-land.net/forums/style_emoticons/default/whistling.gif) , but that's allright:
http://www.improb.com/airchives/paperair/v...1-3-apples.html
(IMG:http://www.boot-land.net/forums/style_emoticons/default/wink.gif)

I asked a question, you provided an answer (that turned out to be completely unuseful).

This happened because, NO MATTER THE REASON WHY, i.e. my incapacity to ask the question, my supposed "admin" view of the problem, your incapacity to understand the question, your supposed "developer" view of the problem, you provided a "general" answer.

This answer was not useless "from one's point of view", it was useless.
(last character in the above sentence is a "full stop" or "period")

Of course it all depends on the definition of answer you use:
http://www.thefreedictionary.com/answer
QUOTE
an·swer (nsr)
n.
1.
a. A spoken or written reply, as to a question.
b. A correct reply.
2.
a. A solution, as to a problem.
b. A correct solution.
3. An act in retaliation or response: Our only possible answer was to sue.
4. Something markedly similar to another of the same class: cable TV's answer to the commercial networks' sportscasts.
5. Law A defendant's defense against charges.


For me a non-useless answer is something described in points #1.b., #2.a. or #2.b.

You seem to use definitions #1.a. and #3.

I still have the question and I still miss an answer (as per my definition above) to it (IMG:http://www.boot-land.net/forums/style_emoticons/default/sad.gif) .

However in the meantime I have been accused of not being able to express myself and now that, being an admin, I am narrow minded, and finally that I consider myself too important.(IMG:http://www.boot-land.net/forums/style_emoticons/default/frusty.gif)

I guess I'll better stick to dmdiag.exe before someone comes out saying that I am also responsible for 9/11 and for desertification. (IMG:http://www.boot-land.net/forums/style_emoticons/default/rolleyes.gif)

I wish however to thank you for the time and attention you devoted to the problem and for the answers and comments you provided, valueless as I might consider them.

jaclaz
Go to the top of the page
 
+Quote Post
MedEvil
post Sep 5 2007, 03:05 PM
Post #18


Advanced Member
***

Group: .script developer
Posts: 1,803
Joined: 29-December 06
Member No.: 2,192



Ok jaclaz, I take everything back.
Your no admin, i'm out to get you and the registry holds absolutely no informations about HDDs. (IMG:http://www.boot-land.net/forums/style_emoticons/default/wink.gif)

(IMG:http://www.boot-land.net/forums/style_emoticons/default/cheers.gif)
Go to the top of the page
 
+Quote Post
jaclaz
post Sep 5 2007, 03:56 PM
Post #19


Finder
***

Group: Advanced user
Posts: 1,581
Joined: 14-July 06
Member No.: 2


Italy


(IMG:http://www.boot-land.net/forums/style_emoticons/default/offtopic.gif)

@Medevil
You forgot to affirm that elephants don't fly!

QUOTE (Title : Elephants Don't Fly)
As I glanced up in the sky
A bird dropped something from ahigh.
As I wiped it from my eye.
I thanked the Lord elephants don't fly.


(IMG:http://www.boot-land.net/forums/style_emoticons/default/roll1.gif)

jaclaz
Go to the top of the page
 
+Quote Post
Olof Lagerkvist
post Sep 5 2007, 04:22 PM
Post #20


Advanced Member
***

Group: Developer
Posts: 120
Joined: 27-April 07
From: Borås, Sweden
Member No.: 6,234


Sweden


Well, oh well (IMG:http://www.boot-land.net/forums/style_emoticons/default/wink.gif)

The format for the image file used by ImDisk command line control program with the -F switch or by the ImDisk driver in the registry setting FileName0 is not that specific to ImDisk, it is called the Windows NT Native Path format. It is the path format used internal by the Windows kernel, that is, the only path format that the kernel and other drivers will understand. It could look a bit tricky to use, especially because there are literally hundreds of ways to express the same path because of all kinds of virtual paths through symbolic link objects and other things that only exist for compatibility with older versions of Windows.

Example:
You have the path C:\images\disk.img and you want to use that in the FileName0 value in the ImDisk driver settings. The easiest thing is to just append \??\ before the drive letter based path. This gives a perfectly valid native path.
CODE
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\ImDisk\Parameters]
"FileName0"="\\??\\C:\\images\\disk.img"
"LoadDevices"=dword:00000001


If anyone want to investigate further what really happens, we must identify what C: really points to. My dosdev utiltiy does that, or looking in the \GLOBAL?? directoty with winobj will do the same.
CODE
C:\>dosdev -q C:
C: => \Device\HarddiskVolume1

This means that the registy file above could have been:
CODE
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\ImDisk\Parameters]
"FileName0"="\\Device\\HarddiskVolume1\\images\\disk.img"
"LoadDevices"=dword:00000001


\Device\HarddiskVolume1 is the real device object for the disk volume, handled by the disk driver and given this particular name by the volume manager.

Now what about for example \Device\Harddisk0\Partition1?
If you look at Windows NT 4.0 or earlier version, you will see that it works a little different.
CODE
C:\>dosdev -q C:
C: => \Device\Harddisk0\Partition1

There is no volume manager before Windows 2000, so the partition objects the disk drivers created where named like that, with the number of the harddisk (starting 0) and the number of the partition (starting 1). So, on Windows NT 4.0 you could use this syntax:
CODE
REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\ImDisk\Parameters]
"FileName0"="\\Device\\Harddisk0\\Partition1\\images\\disk.img"
"LoadDevices"=dword:00000001


But for compatibility reasons, the disk drivers today also create symbolic links called for example \Device\Harddisk0\Partition1 pointing to for example \Device\HarddiskVolume1 so that the old syntax could still be used to make old drivers compatible with newer versions of Windows (or just to make it easy to write software for both Windows NT 4.0 and Windows 2000).

It is easy to programmatically check what a symbolic link points to, but Windows provides no easy way to find all symbolic links pointing to a particular device object. This means that it is very easy to find out \Device\HarddiskVolume1 given the path \Device\Harddisk0\Partition1, but not very easy to know that \Device\Harddisk0\Partition1 points to it given only the path \Device\HarddiskVolume1. The only way is to work through all symbolic links on the system and check each one of them and that it pretty much what you do manually if you check with the winobj tool.

Hope this gave answeres to some of the questions in this thread. (IMG:http://www.boot-land.net/forums/style_emoticons/default/smile.gif)
Go to the top of the page
 
+Quote Post

3 Pages V  < 1 2 3 >
Fast ReplyReply to this topicStart new topic

Members Who Viewed Topic Today ()

 

RSS Lo-Fi Version Time is now: 27th February 2008 - 05:19 PM

MKPortal ©2003-2006 mkportal.it