Mount Request - Reading the boot sector

Hi!
I (still) have a problem with mounting my FS
Partition. :slight_smile: In the mount IRP handler, I try to read
the first 512 bytes of data (boot sector). I hava a
problem with this.
This is what I do.

//*************************************************
//Edited code snippet…
//*************************************************

IrpSp = IoGetCurrentIrpStackLocation( Irp );
TargetDeviceObject =
IrpSp->Parameters.MountVolume.DeviceObject;
ByteOffset = 0;
NumberOfBytesToRead = 512;
Irp = IoBuildSynchronousFsdRequest( IRP_MJ_READ,
TargetDeviceObject,
Buffer,
NumberOfBytesToRead,
&ByteOffset,
&Event,
&Iosb );
IoCallDriver( TargetDeviceObject, Irp );

// I now wait on the event if necessary …
//*****************************************************

I have three FAT 32 partitions (extended). I am
able to read the first 512 bytes for those partitions
just fine.
I also have an NTFS (boot) partition and a ext2
(primary) partition.
I get one mount before the FAT 32 mount requests,
and one after loggin in. For those, what I read is the
first sector of the disk, not that of the ext2
partition.
Now questions. I should be getting a request for
the ext2 partition also, right? If so, why am I not
able to read the first sector of the partition? Am I
making some wrong assumptions or doing something
wrong?

Thanks in advance for any suggestions you can give me.

Manoj

=====

Manoj Paul Joseph,
Master of Computer Applications (final year student),
School of Computer Science and Engineering,
Anna University,
Chennai (Madras),
India.


Do You Yahoo!?
Everything you’ll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Bo!
No I haven’t setup a drive letter before hand. I
didn’t know I had to! I just assumed that every
partition got a mount request.
So, how do I set up a driveletter? Can I do without
it?
Manoj

— Bo_Brantén wrote: > On Tue, 22
Jan 2002, Manoj Paul Joseph wrote:
>
> > Now questions. I should be getting a request
> for
> > the ext2 partition also, right? If so, why am I
> not
> > able to read the first sector of the partition? Am
> I
> > making some wrong assumptions or doing something
> > wrong?
>
> Have you set up an driveletter for the ext2
> partition beforehand?
>

=====
-----------------------------------
Manoj Paul Joseph,
Master of Computer Applications (final year student),
School of Computer Science and Engineering,
Anna University,
Chennai (Madras),
India.

__________________________________________________
Do You Yahoo!?
Everything you’ll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

On Tue, 22 Jan 2002, Manoj Paul Joseph wrote:

didn’t know I had to! I just assumed that every
partition got a mount request.

In the mailing list archive you can find:

On Sat, 12 Jun 1999, [iso-8859-2] Petr Chmela? wrote:

Then I wait for I/O Manager’s mount reguests for each partition object
that doesn’t have the VPB_MOUNTED flag set.
Unfortunately, the I/O Manager calls my FS control routine obstinately
only with those target objects, that correspond to partitions that have
already been mounted (my FAT & NTFS partitions).
I extract the target object from
IRPCurrentStack->Parameters.MountVolume.DeviceObject.

The I/O Manager wont send you a mount reguest for an “unrecocnized”
partition until it is first accessed. You do that by creating a symbolic
link from a drive letter to the partition of interest and then try to
access it.

To make that happen automatically at boot you can add something like the
following lines to the registry:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS
Devices]
“X:”=“\Device\Harddisk0\Partitionx”


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Bo!
Your suggestion worked. Thanks!
I have another doubt. For unrecoganised partitions,
I get mount requests and the target device seems to
point to the whole disk. Am I right about this? I try
reading the first sector and I see the disk’s first
sector. Is there a reason for this behaviour?
If my assumption is right, then I can create the
DOS Device symbolic links after reading the partition
table (I use the Device Object that represents the
entire disk)? Any comments?

Manoj

PS: By the way, there doesn’t seem to be a way of
location mail sent in 1999 to this list.
Aren’t all that mail still in the archive?

— Bo_Brantén wrote: > On Tue, 22
Jan 2002, Manoj Paul Joseph wrote:
>
> > didn’t know I had to! I just assumed that every
> > partition got a mount request.
>
> In the mailing list archive you can find:
>
> On Sat, 12 Jun 1999, [iso-8859-2] Petr Chmelaø
> wrote:
>
> > Then I wait for I/O Manager’s mount reguests for
> each partition object
> that doesn’t have the VPB_MOUNTED flag set.
> > Unfortunately, the I/O Manager calls my FS control
> routine obstinately
> only with those target objects, that correspond to
> partitions that have
> already been mounted (my FAT & NTFS partitions).
> > I extract the target object from
>
IRPCurrentStack->Parameters.MountVolume.DeviceObject.
>
> The I/O Manager wont send you a mount reguest for an
> “unrecocnized”
> partition until it is first accessed. You do that by
> creating a symbolic
> link from a drive letter to the partition of
> interest and then try to
> access it.
>
> To make that happen automatically at boot you can
> add something like the
> following lines to the registry:
>
>
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
> Manager\DOS
> Devices]
> “X:”=“\Device\Harddisk0\Partitionx”
>
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

=====
-----------------------------------
Manoj Paul Joseph,
Master of Computer Applications (final year student),
School of Computer Science and Engineering,
Anna University,
Chennai (Madras),
India.

__________________________________________________
Do You Yahoo!?
Everything you’ll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com