lnxnb
lnxnb

Reputation: 83

When does a device get a 512B request from the filesystem?

Am new to linux and have been doing a bit of reading. But am a little confused about the following. Can the device receive a request for a single 512B sector ? Under what conditions does this happen? From what I understand , while the sector size defines the smallest unit a device can be addressed by , the FS usually has a block size of 4K(smallest unit of access for the fs) . So this means most(all) commands are addressed by the FS on a 4k granularity.

  1. Can a file system generate traffic for <4K(1-7 512bytes) from application traffic?

  2. Is there some file system meta data that can cause this kind of traffic?

  3. If we align the partition to a 4k boundary, will the device always get commands aligned on 4k boundaries?

Upvotes: 2

Views: 281

Answers (1)

Anon
Anon

Reputation: 339

This can happen for a variety of reasons (assuming your disks expose a logical sector size of 512 bytes) because you send a direct request for 512 bytes correctly aligned outside of the filesystem:

Some cases when this can happen during general usage:

  • Reading an old style MBR partition table (which fits in 512 bytes at the start of the disk)
  • Rewriting the bootloader or because you told it to happen
  • Trying to read the smallest sized sector from a broken disk with 512 byte sectors

Upvotes: 1

Related Questions