Difference between Local Disk aund Removable Disk

Discussion in 'Windows Vista Drivers' started by Alex, Feb 28, 2004.

  1. Alex

    Alex Guest

    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
     
    Alex, Feb 28, 2004
    #1
    1. Advertisements

  2. Alex

    Mark Roddy Guest

    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
     
    Mark Roddy, Feb 28, 2004
    #2
    1. Advertisements

  3. Alex

    Alex Guest

    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).
     
    Alex, Feb 28, 2004
    #3
  4. 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 S. Shatskih, Feb 29, 2004
    #4
  5. so we have to support all possible file systems ;-(
    Is it possible to have NTFS on removable media?
     
    Maxim S. Shatskih, Feb 29, 2004
    #5
  6. 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.
     
    George M. Garner Jr., Feb 29, 2004
    #6
  7. Maxim,
    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.
     
    George M. Garner Jr., Feb 29, 2004
    #7
  8. Alex

    Alex Guest

    Thanks to all. Problem is solved. The addtional information
    are also very interessting.
    Alex
     
    Alex, Mar 1, 2004
    #8
  9. Alex

    Jeff Henkels Guest

    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.
     
    Jeff Henkels, Mar 1, 2004
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.