Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Difference between Local Disk aund Removable Disk


Reply
Fix Vista Errors
Thread Tools Display Modes

Difference between Local Disk aund Removable Disk

 
 
Alex
Guest
Posts: n/a

 
      02-28-2004
Hi,

I have read Mark Roddy's article on
http://www.wd-3.com/121503/luserland.htm.
He described as you can get the sector address (LBA) a file on a harddisk.

His sample code works for NTFS & FAT32 partions. With a small look in
the FAT spec and some adaptations the sample also works for FAT12/16.

The sample works on W2K & WXP for harddisks and all disks declared as
"Local Disk". For "Removable Disk" like a USB Mass Storage Device
this sample (API call DeviceIoControl/IOCTL_VOLUME_LOGICAL_TO_PHYSICAL)
does not work and system error 50 (not supported) does occur.
The same device declared as "Local Disk" everythink does work.

Is there are a workaround to get
DeviceIoControl/IOCTL_VOLUME_LOGICAL_TO_PHYSICAL
data also on "Removable Disks" or is there are another possibility to get
the
wanted information on another way?

All hints are very welcome.
TIA Alex





 
Reply With Quote
 
 
 
 
Mark Roddy
Guest
Posts: n/a

 
      02-28-2004
"Alex" <> wrote in message
news:uyXWeMf$...
> Hi,
>
> I have read Mark Roddy's article on
> http://www.wd-3.com/121503/luserland.htm.
> He described as you can get the sector address (LBA) a file on a harddisk.
>
> His sample code works for NTFS & FAT32 partions. With a small look in
> the FAT spec and some adaptations the sample also works for FAT12/16.
>
> The sample works on W2K & WXP for harddisks and all disks declared as
> "Local Disk". For "Removable Disk" like a USB Mass Storage Device
> this sample (API call DeviceIoControl/IOCTL_VOLUME_LOGICAL_TO_PHYSICAL)
> does not work and system error 50 (not supported) does occur.
> The same device declared as "Local Disk" everythink does work.
>
> Is there are a workaround to get
> DeviceIoControl/IOCTL_VOLUME_LOGICAL_TO_PHYSICAL
> data also on "Removable Disks" or is there are another possibility to get
> the
> wanted information on another way?
>


Curious. I'll look into it.

By the way, why would you run FAT.DOS on anything?

--

=====================
Mark Roddy
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com




 
Reply With Quote
 
Alex
Guest
Posts: n/a

 
      02-28-2004
>
> By the way, why would you run FAT.DOS on anything?
>

We are producing a USB Mass Storage device with an additional
chip to have additional features. We need to set the sector address
of a special file stored on the flash disc into the additonal chip.
Normally the "standard" file system of a USB Mass Storage is FAT,
so we have to support all possible file systems ;-(
(at the moment FAT12/16/32/NTFS).


 
Reply With Quote
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      02-28-2004
Surely. This IOCTL ends in FtDisk.sys, which is completely out of picture
for removable media devices.
Use IOCTL_DISK_GET_DRIVE_LAYOUT for them. Anyway a removable media can have
only 1 partition :-)

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation

http://www.storagecraft.com


"Alex" <> wrote in message
news:uyXWeMf$...
> Hi,
>
> I have read Mark Roddy's article on
> http://www.wd-3.com/121503/luserland.htm.
> He described as you can get the sector address (LBA) a file on a harddisk.
>
> His sample code works for NTFS & FAT32 partions. With a small look in
> the FAT spec and some adaptations the sample also works for FAT12/16.
>
> The sample works on W2K & WXP for harddisks and all disks declared as
> "Local Disk". For "Removable Disk" like a USB Mass Storage Device
> this sample (API call DeviceIoControl/IOCTL_VOLUME_LOGICAL_TO_PHYSICAL)
> does not work and system error 50 (not supported) does occur.
> The same device declared as "Local Disk" everythink does work.
>
> Is there are a workaround to get
> DeviceIoControl/IOCTL_VOLUME_LOGICAL_TO_PHYSICAL
> data also on "Removable Disks" or is there are another possibility to get
> the
> wanted information on another way?
>
> All hints are very welcome.
> TIA Alex
>
>
>
>
>



 
Reply With Quote
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      02-28-2004
> so we have to support all possible file systems ;-(
> (at the moment FAT12/16/32/NTFS).


Is it possible to have NTFS on removable media?

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation

http://www.storagecraft.com


 
Reply With Quote
 
George M. Garner Jr.
Guest
Posts: n/a

 
      02-29-2004
Alex,

Removable devices all have a single volume so you can calculate the physical
offset directly from the LCN:

physical offset = LCN * bytes_per_cluster + offset to start of first
cluster.

Hope this helps.

George.


 
Reply With Quote
 
George M. Garner Jr.
Guest
Posts: n/a

 
      02-29-2004
Maxim,

> Is it possible to have NTFS on removable media? <


Not for a floppy drive. The default properties for removable USB drives
(e.g. thumbdrives) do not allow you to format the drive to NTFS. However,
this behavior may be changed by editing the properties for the device in
device manager. The caveat is that you have to stop the drive using the
Safely Remove Hardware applet before the drive can be removed. I remember
seeing somewhere that XP supported formatting DVD-RAM disks to NTFS. I
don't know if this has ever been extended to DVD-RW drives but it needs to
be.

Regards,

George.

"Maxim S. Shatskih" <> wrote in message
news:u2itqsl$...
>> so we have to support all possible file systems ;-(
>> (at the moment FAT12/16/32/NTFS).

>
> Is it possible to have NTFS on removable media?
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
>
> http://www.storagecraft.com
>
>



 
Reply With Quote
 
Alex
Guest
Posts: n/a

 
      03-01-2004
Thanks to all. Problem is solved. The addtional information
are also very interessting.
Alex

"George M. Garner Jr." <> wrote in message
news:eReK4So$...
> Alex,
>
> Removable devices all have a single volume so you can calculate the

physical
> offset directly from the LCN:
>
> physical offset = LCN * bytes_per_cluster + offset to start of first
> cluster.
>
> Hope this helps.
>
> George.
>
>



 
Reply With Quote
 
Jeff Henkels
Guest
Posts: n/a

 
      03-01-2004

"George M. Garner Jr." <> wrote in message
news:uczdsXo$...
> Not for a floppy drive. The default properties for removable USB drives
> (e.g. thumbdrives) do not allow you to format the drive to NTFS. However,
> this behavior may be changed by editing the properties for the device in
> device manager. The caveat is that you have to stop the drive using the
> Safely Remove Hardware applet before the drive can be removed.


You sure about that? When I bought a 256MB thumb drive about 6 months back,
the first thing I did was reformat it to NTFS on my laptop (which at the
time was running 2K Advanced Server). I don't recall having to do anything
special to reformat it.

As for the "Safely Remove Hardware" applet, on XP you can change that
through the Policies tab in Device Manager; basically the policy setting
enables/disables write caching.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use local disk D mthaner Windows Vista General Discussion 5 05-10-2008 02:26 PM
RAID disk size difference Jason Windows Vista Installation 1 04-17-2008 12:23 PM
Removable Disk Earl Windows Vista General Discussion 3 04-16-2008 08:49 PM
Removable Disk Drives? bobg Windows Vista General Discussion 1 01-04-2008 03:13 AM
Delete or Format Hard Disk - What's the difference ? hash Windows Vista Performance 7 07-28-2007 06:33 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59