Question about sectors

Started by
7 comments, last by Catafriggm 18 years, 10 months ago
What is the significance of storing files on 512 byte sectors? And what happens with unused data within the sector? Also, is it possible to notice that every file you create will cause 512 bytes from a sector to be allocated for file storage?
Advertisement
Yes. Files are stored in whole numbers of sectors (actually, whole number of clusters, which will be some power of two number of sectors). The extra space is wasted.
So, lets suppose i have a 2000 byte hard drive

If i save 5 1 bytes files I wont have any storage space left?
4 1-byte files. And that's assuming you have 2048 bytes available on the drive, and each cluster is one sector.
How would you know you are running out of space? If I save a 1 byte file it doesnt say that I lost 512 bytes of space.
For each file, the OS keeps track of two numbers -- the size of the file, and the amount of space it takes up on the disk.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Do you have a 2KB hard drive? I don't even have a diskette that is smaller than 360Kb (5.25" floppy, low density).
Quote:Original post by nprz
Do you have a 2KB hard drive? I don't even have a diskette that is smaller than 360Kb (5.25" floppy, low density).


Quote:So, lets suppose i have a 2000 byte hard drive


Learn to read

my files say they take up 4096 bytes each
Then 4096 bytes is your cluster size (8 sectors). I should note that a sector is the basic unit of disk access. Your hard drive can only read and write sectors, it can't read/write individual bytes. Clusters are an operating system/file system invention.

This topic is closed to new replies.

Advertisement