blk_queue_hardsect_size 520-byte sector
Hi,
Can I call blk_queue_hardsect_size in a driver and set it to 520-byte as hardware sector size.
How does the kernel and block layers take the request, will it be in multiples of 520-bytes aligned or 512 bytes aligned?
Thanks for your help in advance.
with regards,
Anil
Quoted 6 lines · Anil kumar
Hi,
Can I call
blk_queue_hardsect_sizein a driver and set it to 520-byte as hardware sector size. How does the kernel and block layers take the request, will it be in multiples of 520-bytes aligned or 512 bytes aligned?
No, Linux only supports power-of-2 hardware block sizes I'm afraid.
Signature · 1 line
Jens Axboe
Quoted 9 lines · On Fri, 6 Jun 2008 09:54:33 +0200 Jens Axboe <[email protected]> wrote:
Quoted 6 lines · Anil kumar
Hi,
Can I call
blk_queue_hardsect_sizein a driver and set it to 520-byte as hardware sector size. How does the kernel and block layers take the request, will it be in multiples of 520-bytes aligned or 512 bytes aligned?No, Linux only supports power-of-2 hardware block sizes I'm afraid.
And only some of those - which is why we can't support CP/M disks and also early smartmedia stuff (128/256 byte/sector)
If you are trying to deal with 520 byte blocks that are 512 bytes file system data + 8 bytes of meta data then use 512 byte block sizes and put the meta-data somewhere else or provide a different way to access it - eg ATA uses 512 byte sectors for normal ATA but the sg_io() ioctl path allows the issuing of commands like READ_LONG for specific cases where the additional meta data is needed.
Alan
Quoted 11 lines · Alan Cox
Quoted 8 lines · On Fri, 6 Jun 2008 09:54:33 +0200 Jens Axboe <[email protected]> wrote:
Quoted 6 lines · Anil kumar
Hi,
Can I call
blk_queue_hardsect_sizein a driver and set it to 520-byte as hardware sector size. How does the kernel and block layers take the request, will it be in multiples of 520-bytes aligned or 512 bytes aligned?
Quoted 4 lines
Quoted 1 line
No, Linux only supports power-of-2 hardware block sizes I'm afraid.
And only some of those - which is why we can't support CP/M disks and also early smartmedia stuff (128/256 byte/sector)
Right, should've made that clearer - Linux only really supports power-of-2 hw block sizes, where the size is >= 512 and <= PAGE_CACHE_SIZE.
Signature · 1 line
Jens Axboe