SATA and NTFS

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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: SATA and NTFS

Post by Combuster »

nonono.

The difference between filesystems and drivers is that between language and pen-and-paper. Whatever quality and size paper you use, if you write gibberish or put down words in random places the result is impossible to read back. However you can write either english or french and still write down the same message.

The order in which things appear and the meaning given to the collections of ink is what gives meaning to a filled piece of paper, just as filesystems give a meaning to blocks of 1s and 0s. The device driver is just the accuracy of your hand and skill with the pen.

So yes, the filesystem determines where information is stored. The driver makes sure that it gets stored.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
diama13
Posts: 12
Joined: Tue Nov 08, 2011 4:12 am

Re: SATA and NTFS

Post by diama13 »

Ok i see. But how decides where to write? Master File Table helps?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: SATA and NTFS

Post by Solar »

Yes, it is how the NTFS handler figures out where to read / write the data.

It is just that the NTFS handler knows nothing about "SATA" or "SCSI". It just knows about "sectors", and talks to the device driver to have that access the actual hardware.

To return to your original question:
I would like to understand how the ntfs (file system) of a SATA hard disk drive collaborates with the sata protocol.
Not at all. It collaborates with the VFS and the device driver, ignorant of SATA details.
I mean that how the ntfs translates and eventually sends sata commands to the hardware of the drive.
Not at all. The device driver does that.

The purpose being, of course, to make the layers interchangeable. You can have NTFS on a non-SATA device, you can have a different filesystem on a SATA device. You don't want to implement drivers for NTFS-on-SATA, NTFS-on-SCSI, ext4-on-SATA etc. etc.
Every good solution is obvious once you've found it.
diama13
Posts: 12
Joined: Tue Nov 08, 2011 4:12 am

Re: SATA and NTFS

Post by diama13 »

It's more clear know. One last question. Let's say that there was a file that was eventually stored in sector 15, one at sector 16 and one at sectors 17,18. Assuming that the first file(sector 15) deleted and a new file has to be stored. But the new file needs two sectors. The ntfs will store the file at sectors 15 and 19 or at 19,20? It depends on the defragmentation? And something else. Whenever a new file has to be stored the ntfs will store it where it stopped the last time(the last free sector)? I hope you can understand what i mean. eg. Last file was stored at sectors 100,101,102. Next will be stored at sectors 103 etc? Assume that cluster size equals sector size.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: SATA and NTFS

Post by Brynet-Inc »

That information is filesystem dependant, as has been said multiple times.. NTFS is a proprietary filesystem, most implementations are reverse engineered or the developers signed an NDA with Microsoft.

Disk drives aren't aware of filesystems, it's just a convenient way of organizing information.

Nothing prevents you from arbitrarily writing to the disk in an unorganized fashion, but that's hardly productive. Especially if you want to read it back.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply