Monday, April 29, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1583  / 2 Years ago, wed, may 25, 2022, 11:00:36

Is there any command that will output the beginning and ending hard disk blocks of a file ?
(Solution marked accepted)






Update:



The answers below solve the initial query. I thank 'em all. But I'm a bit confused with LBA not fitting in the block range shown by fdisk. (however, halving the number aggreees with range; so does that imply LBA blocksize of 2048 ?!?)


More From » command-line

 Answers
5

Use hdparm:



sudo hdparm --fibmap FILENAME


where FILENAME is the path to your file.



Regarding your calculations:



97504*512/1024^2=47,6 that's how you do this.



Regarding the not fitting in the block range:



You circled the NTFS drive in the fdisk output, which ends at LBA 251863039, the hdparm output reports, that the file system on which the tested file resides begins at LBA 251863040. So you are looking at the wrong file system in the fdisk output, because your file is on sda2 not on sda1.




[#27793] Friday, May 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
inglehare

Total Points: 330
Total Questions: 111
Total Answers: 95

Location: Sint Maarten
Member since Tue, Mar 29, 2022
2 Years ago
;