Jump to content











Photo
* * * * * 3 votes

Easy2Boot Development Discussion

grub4dos multiboot multipass usb boot iso

  • Please log in to reply
1158 replies to this topic

#1151 steve6375

steve6375

    Platinum Member

  • Developer
  • 6350 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted A week ago

Thanks.

The Offset for a certain file (NTFS) returns as 38256726016

The value returned by GetFileExtents returns 1675782 which is the LBA address of the start of the file.

How do I get the LBA start value from what is returned by your app?

Also, GetFileExtents does seem to work on FAT32 drives (I was mistaken). I think the problem with non-NTFS drives was not to do with GetFileExtents...



#1152 nguyentu

nguyentu

    Member

  • Members
  • 31 posts
  •  
    Vietnam

Posted A week ago

Offset / Bytes per Sector = LBA

 

@Wonko

In bytes, maybe it will help to set the length of partition without using other commands. I will update it later.



#1153 steve6375

steve6375

    Platinum Member

  • Developer
  • 6350 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted A week ago

But 38256726016 / 512  does not equal 1675782  ??

 

Compare with GetFileExtents.exe (unzip SWITCH_E2B.exe to obtain the file).


Edited by steve6375, A week ago.


#1154 nguyentu

nguyentu

    Member

  • Members
  • 31 posts
  •  
    Vietnam

Posted A week ago

Its number of sector in Integer, not Hex

 

7a59fa0360d54c968511def0e0fbeca0.png

 

getFileExtents.exe D:\2017-01-08_165052.png

File offset 0 LBA: 78d9a60 Sectors: 8
File offset 1000 LBA: 81e65a0 Sectors: 10
File offset 3000 LBA: 8530630 Sectors: 28
File offset 8000 LBA: 87fd770 Sectors: 10

 

GetFileExtents has returned multiple results, but only one of which is correct.

 

--------------

 

 

C:\Windows\system32>"C:\Users\Whoami\Downloads\Compressed\Easy2Boot v1.87\_ISO\docs\E2B Utilities\MOVE_IMGPTN\getFileExtents.exe" D:\2017-01-08_165052.png

File offset 0 LBA: 788c910 Sectors: 50
 
C:\Windows\system32>C:\Users\Whoami\Downloads\Video\GetFileOffset.exe D:\2017-01-08_165052.png
 
Offset On Disk 0        : 64719298560
Offset On Drive D:      : 1106386944
Disk ID                 : 0
Disk Style              : GPT
Bytes Per Sector        : 512
File Size               : 38693

 

64719298560 / 512 = 788c910 (Hex) -> 126404880 (Decimal)


Edited by nguyentu, A week ago.


#1155 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted A week ago

nguyentu,
with all due respect :), these are the data needed, I believe your tool can easily output them, why - since you have the possibility to provide them - you provide different units?

1) if the file is fragmented, output "File is fragmented" or a similar error message
2) the offset (from LBA 0, i.e.\\.\Physicaldriven) to the beginning of the file epressed in sectors
3) the extent (from the offset above) i.e. the size of the file expressed in sectors
4) optionally the offset from the beginning of the partition/volume (not really needed)
5) anything else is not really needed, maybe it could be output only if a -v (verbose) parameter is given.

Try using grub4dos and use its blocklist command, that is what would be useful.

For the record, there is a tool similar to getfileextents (that actually works "better" in my experience) , myfragmenter.exe part of the mydefrag tool, that outputs data in Vcn's (or clusters) on NTFS, example:

MyFragmenter.exe -i D:\Win7PE\log.html
MyFragmenter v1.2, 2008 J.C. Kessels

Commandline argument '-i' accepted.

Processing: D:\Win7PE\log.html
Fragment list:
  Extent 1: Lcn=27119138, Vcn=0, NextVcn=1367
  1367 clusters, 1 fragments.

Finished, 1 files processed.

but - since you are writing it - why not saving us the need to make calculations/conversions?


:duff:
Wonko


  • nguyentu likes this

#1156 steve6375

steve6375

    Platinum Member

  • Developer
  • 6350 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted A week ago

doh! Sorry, I was referring to the wrong number in my notes! I am working on fixing a small bug in Switch_E2B.exe and got confused (it happens at my age!).

Yes, it does return the correct offset! Thanks :-)



#1157 steve6375

steve6375

    Platinum Member

  • Developer
  • 6350 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted A week ago

Note: The grub4dos blocklist command uses the relative sector offset,

You need to add the Reserved Sectors to whatever it returns as the start block of the file.



#1158 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted A week ago

Note: The grub4dos blocklist command uses the relative sector offset,

You need to add the Reserved Sectors to whatever it returns as the start block of the file.

Sure :) which is another (perfectly understandable and simple) operation that needs to be done "outside", that piece of data corresponds to having the #4 in my above list, but what is actually needed for a "partnew" entry is obviously the sector number from LBA0, and there is no reason why a newly written tool should not provide that (#2 in my above list) directly avoiding an external operation.

 

:duff:

Wonko 


  • nguyentu likes this

#1159 nguyentu

nguyentu

    Member

  • Members
  • 31 posts
  •  
    Vietnam

Posted A week ago

 

Also, GetFileExtents does seem to work on FAT32 drives (I was mistaken). I think the problem with non-NTFS drives was not to do with GetFileExtents...

 

Oh sorry, getfileextents supports FAT32 :lol: 

 

@Wonko Thanks for useful info  :P


Edited by nguyentu, A week ago.






Also tagged with one or more of these keywords: grub4dos, multiboot, multipass, usb boot, iso

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users