Raw IO on a Volume

I have a user space application which does raw reads of non-windows
filesystems. I have found however that I can not read from a partition
if a Volume object has been created. Depending on the partition id,
windows sometimes creates a Volume object and sometimes does not.

Is there a way I can control this? Ideally from user space but if it
needs a kernel driver, what is the easiest way to do this?

John.


John Newbigin
Computer Systems Officer
Faculty of Information and Communication Technologies
Swinburne University of Technology
Melbourne, Australia
http://www.ict.swin.edu.au/staff/jnewbigin

The ‘easiest’ way to do this is to forget about it. If you have to write a
file systems driver it will take at least two man years if you are already
an expert in other drivers. I think two years is very optimistic. You can
open a ‘volume’ regardless of its type from user mode if you are an
administrator. Using an explorer extension will be much easier if it can be
done.

“John Newbigin” wrote in message
news:xxxxx@ntfsd…
>I have a user space application which does raw reads of non-windows
> filesystems. I have found however that I can not read from a partition
> if a Volume object has been created. Depending on the partition id,
> windows sometimes creates a Volume object and sometimes does not.
>
> Is there a way I can control this? Ideally from user space but if it
> needs a kernel driver, what is the easiest way to do this?
>
> John.
>
> –
> John Newbigin
> Computer Systems Officer
> Faculty of Information and Communication Technologies
> Swinburne University of Technology
> Melbourne, Australia
> http://www.ict.swin.edu.au/staff/jnewbigin
>
>
>
>
>
>

David J. Craig wrote:

The ‘easiest’ way to do this is to forget about it. If you have to write a
file systems driver it will take at least two man years if you are already
an expert in other drivers. I think two years is very optimistic. You can
open a ‘volume’ regardless of its type from user mode if you are an
administrator. Using an explorer extension will be much easier if it can be
done.

I think you misunderstood my problem. I have a user space application.
It reads a filesystem in user space. It is already complete and
works. The problem I have is that I can’t read from
\Device\HardDisk0\Partition4 is windows has created a volume object
which points to this device.

If I change the partition id using fdisk, then windows no longer created
the Volume object and I can read the partition.

This is OK as a workaround but I don’t want other users to have to do this.

John.

PS. I have also written a filesystem, ironically I have the opposite
problem, the partition does not always have a volume object so I can’t
mount it using the mount manager.

“John Newbigin” wrote in message
> news:xxxxx@ntfsd…
>
>>I have a user space application which does raw reads of non-windows
>>filesystems. I have found however that I can not read from a partition
>>if a Volume object has been created. Depending on the partition id,
>>windows sometimes creates a Volume object and sometimes does not.
>>
>>Is there a way I can control this? Ideally from user space but if it
>>needs a kernel driver, what is the easiest way to do this?
>>
>>John.
>>
>>–
>>John Newbigin
>>Computer Systems Officer
>>Faculty of Information and Communication Technologies
>>Swinburne University of Technology
>>Melbourne, Australia
>>http://www.ict.swin.edu.au/staff/jnewbigin
>>
>>
>>
>>
>>
>>
>
>
>
>
> —
> Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@ict.swin.edu.au
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>


John Newbigin
Computer Systems Officer
Faculty of Information and Communication Technologies
Swinburne University of Technology
Melbourne, Australia
http://www.ict.swin.edu.au/staff/jnewbigin

> I think you misunderstood my problem. I have a user space application.

It reads a filesystem in user space. It is already complete and
works. The problem I have is that I can’t read from
\Device\HardDisk0\Partition4 is windows has created a volume object
which points to this device.

Then read \?\Volume{guid}

Windows creates volumes for all partitions with MBR type 7 and all 3 MBR type
values for FAT (forgot them, IIRC FAT32 is 11).

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

In addition, please explain, “I can’t read from
\Device\HardDisk0\Partition4”

Does your CreateFile call fail or ReadFile fail? In any case what does
GetLastError() say ?

Harish

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-248440-
xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Saturday, April 15, 2006 10:04 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Raw IO on a Volume

> I think you misunderstood my problem. I have a user space
application.
> It reads a filesystem in user space. It is already complete and
> works. The problem I have is that I can’t read from
> \Device\HardDisk0\Partition4 is windows has created a volume object
> which points to this device.

Then read \?\Volume{guid}

Windows creates volumes for all partitions with MBR type 7 and all 3
MBR
type
values for FAT (forgot them, IIRC FAT32 is 11).

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@mendocinosoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Maxim S. Shatskih wrote:

>I think you misunderstood my problem. I have a user space application.
> It reads a filesystem in user space. It is already complete and
>works. The problem I have is that I can’t read from
>\Device\HardDisk0\Partition4 is windows has created a volume object
>which points to this device.

Then read \?\Volume{guid}

Windows creates volumes for all partitions with MBR type 7 and all 3 MBR type
values for FAT (forgot them, IIRC FAT32 is 11).
Windows XP does not create a volume for type 0x82 or 0x83 (Linux swap &
Linux)
Windows XP does create a volume for type 0x8e (Linux LVM)

I am attempting direct IO on a type 0x8e partition. I can open the
Partition4 or the Volume{guid} device. When I attempt to read I get an
error, at the moment I get error 2 (file not found) but I have also seen
other errors, 87 I think.

I have also tried with a kernel driver. It gets to AttachDevice but I
still get a read error. I have tried to attach my driver at boot time
but it could not read then either.

Unfortunalty I can’t get a checked build of XP running because the
license code I have does not work.

If you want to verify the problem, you can download my dd program
http://uranus.it.swin.edu.au/~jn/linux/rawwrite/dd-0.3.zip and test with
that.

John.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@ict.swin.edu.au
To unsubscribe send a blank email to xxxxx@lists.osr.com


John Newbigin
Computer Systems Officer
Faculty of Information and Communication Technologies
Swinburne University of Technology
Melbourne, Australia
http://www.ict.swin.edu.au/staff/jnewbigin