sectors and clusters question

ElDonAntonio

Senior member
Aug 4, 2001
967
0
0
Hey guys,

I had an OS exam and their was a question regarding disk space allocation...not sure if I'll be able to translate it perfectly though but I'll do my best :)

The question stated at one point that we had between 1-128 clusters per sector on a hard disk (it then went on with virtual memory allocation and minimum number of bits to reference every byte on the HD etc but that's not the point).

I did all of my calculations taking 128 clusters per sector. Is it possible to have variable size sectors?!?!?! makes no sense to me, I guess it would make finding information on the HD impossible. Why then did the question specify we could have between 1 and 128 clusters per sector?

Thanks guys!
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
As far as I know, a single piece of media has 1 size sectors througout. That's not to say two pieces of media can't have seperate sector sizes, but you won't find a drive with variable sectors.

Clusters are different than sectors, the sectors on a hard disk are physical on a disk (and usually 512 bytes on hard disks) while the clusters are specific to the filesystem being used and while it would be possible to have them be variable size it would be a decent amount of overhead that I can't see as being justifiable.

You realize you did all your calculations with 64K clusters, which aren't very common, right?
 

ElDonAntonio

Senior member
Aug 4, 2001
967
0
0
Hi NothinMan,

thanks for the input!
Why do you say I used 64K clusters? I considered 128 clusters per sector, and the question stated that one cluster was like 4K. The only thing that bugs me is why state 1-128 per sector??
It was asked to find the mimimum number of bits required to adress every byte on the HD. A friend told me he used 1 cluster per sector "because it's the worst case". He indeed found he needed more bits than I did, but I don't agree at all with that...

What do you think?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Why do you say I used 64K clusters? I considered 128 clusters per sector, and the question stated that one cluster was like 4K.

On nearly all media you will find 1 sector == 512 bytes, so 128 sectors per cluster means 64K clusters. I hope you made a type-o when you typed clusters per sector, because I don't think that's possible because I think you can only read in sector sized chunks from a disk. If 1 cluster is 4K it's addressing 8 sectors.

A friend told me he used 1 cluster per sector "because it's the worst case". He indeed found he needed more bits than I did, but I don't agree at all with that...

It is the worst case, unless you can find a way to address smaller than a single sector on a drive. If I use 1 cluster per sector and you use 2 clusters per sector, I have 512 byte clusters and you have 1K clusters. I will need 2x as many bits to address them as you because I have 2x as many clusters.
 

ElDonAntonio

Senior member
Aug 4, 2001
967
0
0
Whoah, my bad, I think there's a translation problem somewhere...you're totally right, I'll check and get back to you!!

Thanks again!