Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Modern disks use much bigger sectors. See https://en.wikipedia.org/wiki/Advanced_Format


The issue is non power of 2 sector sizes. The kernel computes sectors with shifts not division (which would be slow).


I do not see how you would need to use divisions in that case.

But even if that was the case, you could just pretend to the OS that you have 7 sectors of 512 bytes each rather than a single sector of 4032 bytes. (or if that was not possible you could just take the hit)


You need division to go from a file offset in bytes to a sector number, hence the need for power of 2 sizes to make this fast. The kernel assumes in multiple places sectors are a power for 2 for this reason - it doesn't rely on the compiler to optimize it (which may not even be possible for some of the compilers it works on).

If you are talking about using reserved sectors for book keeping at the end of the disk that is possible and commonly done.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: