• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7068
  • Last Modified:

How to change disk block size in Redhat linux server

I was trying to change disk block size in linux server but it does not work for me,

blockdev -setbsz 8192 /dev/sdb

Can someone let me know, what should be the proper procedure to change block size for disk on linux.

  • 2
2 Solutions
To change disk blocksize to 8K you need to go to blacksmith... It is not a software option.

cat /sys/block/sda/queue/*_block_size
basically any mention of 4096 says you have AF drive and 4k block is optimal (you can still try to set such drive to 512 byte blocks to reduce performance 8x and rise disk wear 8x
In ext3, an 8K block size on the fs is only possible if you use Itanium and other 8K architectures. If your architecture is x86, x86_64, it is not possible to have a block size greater than 4k. If you try to make an ext3 fs you will fail with an error message similar to this:

mkfs.ext3: 8192-byte blocks too big for system (max 4096)

So,if your server architecture can take it, you can
use parted post installation to make the partition and then type the following example

mkfs -t ext3 -b 8192 /dev/sda

For more information you should go redhat site
sams20Author Commented:
What about ext4, In my system most of file systems type is ext4. In this case, what about this command  " mkfs -t ext4 -b 8192 /dev/sda" .
Did you check physical disk block size?
"cat /sys/block/sda/queue/*_block_size"
If it is 4K in either number - 4K is your only choice
If it is both 512 you have choices of 1K 2K 4K (but other than 4K will not work for /boot)

your command will not work:
"man 2 mke2fs"
       -b block-size
              Specify the size of blocks in bytes.  Valid block-size values are 1024, 2048 and 4096 bytes per block.  If omitted, block-size is heuristically determined by the filesystem size and the expected usage of the filesystem (see the  -T
              option).   If  block-size is preceded by a negative sign ('-'), then mke2fs will use heuristics to determine the appropriate block size, with the constraint that the block size will be at least block-size bytes.  This is useful for
              certain hardware devices which require that the blocksize be a multiple of 2k.

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now