RamDisk in FAT32/NTFS/NTFS Compressed Format

I am going to develop a Ramdisk Driver, which can create a ram partition with the specified format(FAT32,NTFS or NTFS Compressed).

In the website of microsoft, I found the “Ramdisk.sys sample driver in Windows2000”,but only FAT format is supported in this driver.

I have made a search in this forum and found that the specifications of FAT32 and NTFS structures are necessary,but I can’t find the detail information.

Has anyone seen any examples source or reference materials about the development of the driver I needed?

Best Regards,
Yi Shen

You do not need to know the format of FAT or NTFS.

As I recall, the original (or an earlier one) ramdisk sample automatically
pre-formatted the volume as a FAT volume. In addition, I think that it
failed to implement some IOCTLs that would allow the disk to be formatted
normally. I made a few modifications to the sample that allowed me to
format the ramdisk as NTFS. I’m pretty sure it was just implementing some
IOCTLs.

This was probably around 9 years ago, so my memory is a little fuzzy on the
exact details.

  • Danilo

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@psh.com.cn
Sent: Monday, September 18, 2006 10:59 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] RamDisk in FAT32/NTFS/NTFS Compressed Format

I am going to develop a Ramdisk Driver, which can create a ram partition
with the specified format(FAT32,NTFS or NTFS Compressed).

In the website of microsoft, I found the “Ramdisk.sys sample driver in
Windows2000”,but only FAT format is supported in this driver.

I have made a search in this forum and found that the specifications of
FAT32 and NTFS structures are necessary,but I can’t find the detail
information.

Has anyone seen any examples source or reference materials about the
development of the driver I needed?

Best Regards,
Yi Shen

> format the ramdisk as NTFS. I’m pretty sure it was just implementing some

IOCTLs.

IOCTL_DISK_GET_PARTITION_INFO(_EX) and - on XP and later -
IOCTL_DISK_GET_LENGTH_INFO.

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

>> format the ramdisk as NTFS. I’m pretty sure it was just implementing some

> IOCTLs.

IOCTL_DISK_GET_PARTITION_INFO(_EX) and - on XP and later -
IOCTL_DISK_GET_LENGTH_INFO.

Maxim, the meaning is, If the above IOCTLs are impemented,user can convert the volumn format to FAT32,NTFS or NTFS Compress after the Ramdisk was created,isn’t it?

The fuctions that I have to implement is two fuctions below
1)The Ramdisk can be dynamicly created and When the Ramdisk is created,driver automatically pre- format the volume as a FAT32,NTFS or NTFS Compress volume.
2)After the Ramdisk was created,user can convert the volumn format to FAT32,NTFS or NTFS Compress.

On Sep 19, 2006, at 9:30 PM, xxxxx@psh.com.cn wrote:

The fuctions that I have to implement is two fuctions below
1)The Ramdisk can be dynamicly created and When the Ramdisk is
created,driver automatically pre- format the volume as a
FAT32,NTFS or NTFS Compress volume.
2)After the Ramdisk was created,user can convert the volumn format
to FAT32,NTFS or NTFS Compress.

You should not try to implement your own formatting or conversion
code, if that’s what you had in mind. Just call the normal format and
convert programs. That way you don’t risk compatibility problems.

-sd

If you implement the relevant IOCTLs (see Maxim’s e-mail), you can use the
regular system utilities (Windows Explorer, Disk Manager, format.exe, etc)
to format the disks however you want.

I would not try to create a pre-formatted disk by creating the on-disk
layout yourself (as is done in the original ramdisk sample). If you need to
format the disk initially, perhaps there is some (user mode) API to do that.
(I don’t have time to look now.) However, in the worst case, you could
invoke format.exe. (Though you should look for an API solution.)

  • Danilo

The OP may take a look at http://www.sysinternals.com/SourceCode/fmifs.html for
such formatting API.

Christiaan

----- Original Message -----
From: “Danilo Almeida”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, September 20, 2006 9:49 AM
Subject: RE: [ntdev] RamDisk in FAT32/NTFS/NTFS Compressed Format

> If you implement the relevant IOCTLs (see Maxim’s e-mail), you can use the
> regular system utilities (Windows Explorer, Disk Manager, format.exe, etc)
> to format the disks however you want.
>
> I would not try to create a pre-formatted disk by creating the on-disk
> layout yourself (as is done in the original ramdisk sample). If you need to
> format the disk initially, perhaps there is some (user mode) API to do that.
> (I don’t have time to look now.) However, in the worst case, you could
> invoke format.exe. (Though you should look for an API solution.)
>
> - Danilo
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer