Solved

How to change disk block size in Redhat linux server

Posted on 2014-04-10
5
5,006 Views
Last Modified: 2014-04-19
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.

Thanks
0
Comment
Question by:sams20
  • 2
5 Comments
 
LVL 61

Accepted Solution

by:
gheist earned 250 total points
ID: 39993127
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
0
 
LVL 6

Assisted Solution

by:xeroxzerox
xeroxzerox earned 250 total points
ID: 39993378
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
https://access.redhat.com/site/documentation/en-US/
0
 

Author Comment

by:sams20
ID: 39994889
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" .
0
 
LVL 61

Expert Comment

by:gheist
ID: 39994904
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"
OPTIONS
       -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.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now