Logical Sectors of HDD

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Omega
Member
Member
Posts: 250
Joined: Sun May 25, 2008 2:04 am
Location: United States
Contact:

Logical Sectors of HDD

Post by Omega »

If I have the logical sector where a file is located on Hard Disk (0x8335438-0x8335447), is it possible using that range to jump to that area and manipulate the data within those sectors or do I need more information first? thanks
Free energy is indeed evil for it absorbs the light.
User avatar
Adek336
Member
Member
Posts: 129
Joined: Thu May 12, 2005 11:00 pm
Location: Kabaty, Warszawa
Contact:

Re: Logical Sectors of HDD

Post by Adek336 »

A quick look at my ata code confirms that the drive index and the sector number is just enough.
User avatar
Omega
Member
Member
Posts: 250
Joined: Sun May 25, 2008 2:04 am
Location: United States
Contact:

Re: Logical Sectors of HDD

Post by Omega »

I am sorry, I guess I should just admit I am clueless about the HDD right now. If you think I should just do my own research then say so, but is the logical sector the exact sector or just a virtual one? I studied it a little last night but the material I found was incomplete or lacking in detail. I just want to know if the logical sector can be used to find the placement of a file on HDD without needing to convert to something else. thanks
Free energy is indeed evil for it absorbs the light.
User avatar
Adek336
Member
Member
Posts: 129
Joined: Thu May 12, 2005 11:00 pm
Location: Kabaty, Warszawa
Contact:

Re: Logical Sectors of HDD

Post by Adek336 »

Feel free to ask 8) However, I don't know much about LBA either.
User avatar
Omega
Member
Member
Posts: 250
Joined: Sun May 25, 2008 2:04 am
Location: United States
Contact:

Re: Logical Sectors of HDD

Post by Omega »

Its cool, I'll post back once I find out more. thanks
Free energy is indeed evil for it absorbs the light.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Logical Sectors of HDD

Post by bewing »

The problem is that the term "logical sector" does not have any meaning outside of some particular program that gave you that number. If what you have is an LBA value, that would equate to what you seem to be calling an "absolute sector". If the term "logical sector" means "the sector offset from the beginning of the partition" -- then no, it is best to also know the LBA value of the beginning of the partition. That number can be found in the partition table of the drive, on LBA 0. The number you really need is the LBA. Some programs will, however, work on the basis of a "logical disk" with a "logical sector number" -- and if you are lucky, their definitions of those things will agree with yours. (Those programs work by adding the partition's LBA to the "logical sector number", themselves.)

If you want to find/modify the sectors manually, then you need to use a disk editing tool. You will find many suggestions around here -- I like Norton Diskedit, myself.
User avatar
Omega
Member
Member
Posts: 250
Joined: Sun May 25, 2008 2:04 am
Location: United States
Contact:

Re: Logical Sectors of HDD

Post by Omega »

Hi. Thanks a lot for that explanation. I had a feeling that I needed the physical sector. I was looking at the NTFS META Files last night using nfi and it gives you the logical sector. I wonder if there is a way to translate that address to the physical sector in Windows, any ideas? Also, I started work on my HDD driver and I have my NTFS struct, so i am just about ready to begin experimenting with read access and I was wondering if anyone knows anything about reading the META files on NTFS so that I can locate a file on disk by name. thanks

EDIT: OK, I think I have this down. I just finished writing my HDD driver with LBA, I have my NTFS struct and I hope to fill it soon to prove I am reading the HDD which is NTFS formatted. Then I will experiment with reading and hopefully before too long I will have this reading NTFS. Wish me luck! My 100th post will be my success story. :)
Free energy is indeed evil for it absorbs the light.
Post Reply