Forums

Can a disk sector span multiple partitions?

Started by irotas March 24, 2009
Is it always, infallibly, 100% true that a disk sector is entirely
contained within a single partition?

If it matters, I'm concerned about ext3 partitions on a CompactFlash
card.

Thanks,
Adam
On Mar 24, 8:22=A0am, irotas <goo...@irotas.net> wrote:
> Is it always, infallibly, 100% true that a disk sector is entirely > contained within a single partition?
Since the size of a partition is defined by a field indicating an integral number of sectors, and given the lemma that "for all x, y in J, x * y is also in J", then yes it is infallibly true that a disk sector always falls entirely within one partition, since there is no way of defining a partition in any size that would allow the boundary to fall within the sector. Did you mean to use some word other than sector?
On Mar 24, 8:27=A0am, zwsdot...@gmail.com wrote:
> Did you mean to use some word other than sector?
You're right, I probably meant to say 'block'. Let me ask the question in a different way: Consider two disk partitions 'A' and 'B' (again, on CompactFlash). Partition 'B' is being written to when power is abruptly lost. It is understood that some data on partition 'B' may be corrupted. In fact, from my understanding of Nand Flash, 128KB is erased before a new 2KB can be programmed, which means that files in partition 'B' that weren't even being written to may be corrupted as well, if they so happen to be in that same 128KB block. The question is, can that 128KB block span multiple partitions, such that files in partition 'A' could be corrupted as well? CompactFlash's built-in wear leveling makes me concerned that such corruption could span multiple partitions.
On Mar 24, 9:05=A0am, irotas <goo...@irotas.net> wrote:

> You're right, I probably meant to say 'block'.
Ah, so you are referring to flash sectors. There is absolutely no way to know what the mapping is in these storage devices, and the high- level software-defined mapping of partitions and filesystems is absolutely unconnected to the internal physical mapping, which is invisible from outside the card. One would hope that the write algorithm in the CF's micro is failsafe (erase new block, write new block, mark old block as stale), but there is no way to know. Power fail during write is NOT guaranteed to be survivable for CompactFlash; not just a corrupt card, but actually an unusable card (not universally true, but has historically been true).