Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to change disk block size in Redhat linux server

Posted on 2014-04-10
5
Medium Priority
?
6,420 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 62

Accepted Solution

by:
gheist earned 1000 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 1000 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 62

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

721 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