Jump to content











Photo
- - - - -

Extents

file copy in use

  • Please log in to reply
104 replies to this topic

#101 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2991 posts
  • Location:Nantes - France
  •  
    France

Posted 3 weeks ago

Hi Wonko,

 

About the calcultation for LBA FAT32 (as opposed to LBA NTFS where I use the windows IOCTL IOCTL_VOLUME_LOGICAL_TO_PHYSICAL) :

-You suggested (in another post) : Sectors_Before+Reserved_Sectors+Number_of_FATs(normally 2) * Sectors_per_FAT+LCN * Cluster_size+(possibly) Cluster_bias

-I initially suggested : physical offset = (LCN * bytes_per_cluster) + offset to start of first cluster (i meant sectors before)

-It proved that you were right (as always) and I finally ended with your formula (fetching all datas from the FAT32 partition boot sector) : sectors before, reserved sectors, number of FATs * sectors per FAT ...

 

As for the LCN, I am using (independentely of the filesystem) the windows IOCTL FSCTL_GET_RETRIEVAL_POINTERS.

 

As for the root directory, case 2 and 3 (fat32 and ntfs) are correctly dealt now, (reading the last part of your previous post).

Case 1 (fat12/16) may be incorrectly dealt with for now as I am not accounting root directory.

 

Cheers,

Erwan



#102 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15971 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 3 weeks ago

Good :)

 

You could also compare (from 7 up) with the result of:

https://docs.microso...al_pointer_base

 

The other "issue" will (could) be with logical volume inside extended partition.

 

In that case the "Sectors Before" are not absolute number of sectors starting from MBR (aka LBA 0) but rather sectors from the EMBR/EPBR, so one would need to travel the chain of EMBR/EPBR's, which may prove to be complex.

 

Basically you need to check the sector where the EMBR/EPBR is, verify that one of the two partition entries is 0B or 0C (for FAT32) has an entry with Start LBA=Sectors Before and 

add to the Sectors Before (in the PBR) the offset to the EMBR/EPBR. (BTW the grub4dos partnew command does this correction in the PBR of the volume).

 

Since there are no known side effects of doing this (compare with the reknown Gooddell's pages: http://www.goodells....ot/ptable.shtml), it is not a bad idea to always correct these sector offset when making a logical volume inside extended.

 

Besides that, a good idea for a quick check is to check that the LBA of the PBR (VBR) is actually the same of the "Sectors Before", but it depends on how you can check the LBA of the PBR, for primaries, it is the Sectors Before in the MBR partiton table, for logical volumes you need to start from the entry in the partition table with type 05 or  0F, then travel the chain of EMBR's/EPBR/s until you find the "partition at hand".

 

Most probably there is one of the io_ctl that can (again I believe Win 7 up) return the offset to the bootsector, poossibly:

https://docs.microso..._boot_area_info

 

:duff:

Wonko



#103 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 536 posts
  •  
    India

Posted 6 days ago

Is there any progress in support of FAT32 volume in Extents ?



#104 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2991 posts
  • Location:Nantes - France
  •  
    France

Posted 6 days ago

Is there any progress in support of FAT32 volume in Extents ?

 

Absolutely, as announced in post #99.

 

Cheers,

Erwan



#105 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 536 posts
  •  
    India

Posted 5 days ago

I may report LBA in both sectors and bytes in a next update, following Devdevadev feedback to ease batching.2 Lba:528376

 

I need both StartLBA and SectorsLBA of file in Sectors. Will be nice if we can get LBA and Sectors as provided by old version and you can also provide Clusters if want to... and LBA and Size in Bytes also if possible ? So we can get reuqired values easily using batch file with less calculations. 

 

Regards..






6 user(s) are reading this topic

0 members, 6 guests, 0 anonymous users