Disk Geometry and Partition info.

Hi,

Does anybody knows how NT retrieves the kind of partition during a
chkdsk/format operation?
In my driver, I handle IOCTL_DISK_GET_MEDIA_TYPES and
IOCTL_DISK_GET_DRIVE_GEOMETRY by filling a DISK_GEOMETRY structure wit=
h
the following :
(those are currently hard coded in the driver, based on a ~ 23 Gb disk=
).

outputBuffer->MediaType =3D FixedMedia;
outputBuffer->Cylinders.QuadPart =3D 784;
outputBuffer->TracksPerCylinder =3D 255;
outputBuffer->SectorsPerTrack =3D 63;
outputBuffer->BytesPerSector =3D 512;
Irp->IoStatus.Status =3D STATUS_SUCCESS;
Irp->IoStatus.Information =3D sizeof (DISK_GEOMETRY);

and the PARTITION_INFO (with IOCTL_DISK_GET_PARTITION_INFO):

outputBuffer->PartitionNumber =3D 1;
outputBuffer->PartitionType =3D 4; // FAT 16, CHS, < 32Mb
outputBuffer->BootIndicator =3D FALSE;
outputBuffer->RecognizedPartition =3D TRUE;
outputBuffer->RewritePartition =3D FALSE;
outputBuffer->StartingOffset =3D RtlConvertUlongToLargeInteger (=
0);
outputBuffer->PartitionLength.QuadPart =3D 24643584;
outputBuffer->HiddenSectors =3D 0L;
Irp->IoStatus.Status =3D STATUS_SUCCESS;
Irp->IoStatus.Information =3D sizeof (PARTITION_INFORMATION);

but, everytime I try to chkdsk/format this disk, NT tells me that the
partition is RAW. And, even if I force the format to execute (format
/FS:FAT), the disk is verified (IOCTL_DISK_VERIFY), but the boot sector=
is
then filled with 0’s.

Though it’s quite different under 9x/ME, those tools work fine. I have=

this problem with Nt / 2K only.

Thanks a lot for your precious help,

Rejean


R=E9jean Caron - xxxxx@motus.com
Motus Technologies inc.

=


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

IIRC NT/w2k does not use the partition kind fields in the partition table.
It checks the FS type by trying to mount all filesystems to this disk.

Max

----- Original Message -----
From:
To: “File Systems Developers”
Sent: Thursday, January 17, 2002 9:20 PM
Subject: [ntfsd] Disk Geometry and Partition info.

Hi,

Does anybody knows how NT retrieves the kind of partition during a
chkdsk/format operation?
In my driver, I handle IOCTL_DISK_GET_MEDIA_TYPES and
IOCTL_DISK_GET_DRIVE_GEOMETRY by filling a DISK_GEOMETRY structure with
the following :
(those are currently hard coded in the driver, based on a ~ 23 Gb disk).

outputBuffer->MediaType = FixedMedia;
outputBuffer->Cylinders.QuadPart = 784;
outputBuffer->TracksPerCylinder = 255;
outputBuffer->SectorsPerTrack = 63;
outputBuffer->BytesPerSector = 512;
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = sizeof (DISK_GEOMETRY);

and the PARTITION_INFO (with IOCTL_DISK_GET_PARTITION_INFO):

outputBuffer->PartitionNumber = 1;
outputBuffer->PartitionType = 4; // FAT 16, CHS, < 32Mb
outputBuffer->BootIndicator = FALSE;
outputBuffer->RecognizedPartition = TRUE;
outputBuffer->RewritePartition = FALSE;
outputBuffer->StartingOffset = RtlConvertUlongToLargeInteger (0);
outputBuffer->PartitionLength.QuadPart = 24643584;
outputBuffer->HiddenSectors = 0L;
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = sizeof (PARTITION_INFORMATION);

but, everytime I try to chkdsk/format this disk, NT tells me that the
partition is RAW. And, even if I force the format to execute (format
/FS:FAT), the disk is verified (IOCTL_DISK_VERIFY), but the boot sector is
then filled with 0’s.

Though it’s quite different under 9x/ME, those tools work fine. I have
this problem with Nt / 2K only.

Thanks a lot for your precious help,

Rejean

-------------------------------------------------------
Réjean Caron - xxxxx@motus.com
Motus Technologies inc.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.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