Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-06-2019, 09:25 AM   #1
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 217

Rep: Reputation: 40
Get block size of XFS filesystem.


I want to know the block size of my XFS partition. Two different commands give two different values.

$ sudo blockdev --getbsz /dev/vgh/root

$ sudo xfs_info /dev/vgh/root
meta-data=/dev/mapper/vgh-root   isize=512    agcount=4, agsize=13107200 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=52428800, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=25600, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
One says its 512 bytes and another says 4096 bytes. Which one is true?

Old 12-08-2019, 05:13 AM   #2
Senior Member
Registered: Dec 2011
Location: Simplicity
Posts: 1,285

Rep: Reputation: 589Reputation: 589Reputation: 589Reputation: 589Reputation: 589Reputation: 589
No real knowledge but an idea:
The block device driver works with a block size of 512 for compatibility reason.
So addressing a certain block is independent of the file system. (See block size in the dd command, "man dd").
The xfs_info command knows more about the file system. The xfs bsize might be tunable, the device block size will remain.
1 members found this post helpful.
Old 12-08-2019, 10:10 AM   #3
Senior Member
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,643

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
It depends how the disk(?) was set up.
If your disk sectors are set up as 512 bytes then on a physical disk this is not optimal - even though important software may make assumptions that this is the case.

It is much more efficient to use larger sectors - typically 4K bytes and these disks became available some years ago.

To avoid problematic changeovers, these included a compatibility layer to allow these disks to be seen as 512 byte devices.
This can cause performance problems.
Don't know if this affected Linux.

According to the man fdisk page, the sector size parameter is deprecated in favour of the blockdev command.

But perhaps XFS is clever enough to override 512 bytes?
A lengthy discussion can be found at
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos 7 / xfs : is there a reserved space setting for xfs like there is in ext4? chrism01 Linux - Server 5 09-13-2019 09:03 AM
[SOLVED] How can a file in XFS /var filesystem be larger than the filesystem? MensaWater Linux - Software 18 06-30-2018 05:05 AM
LXer: ZFS FileSystem vs XFS FileSystem. Which is Better? LXer Syndicated Linux News 0 05-03-2018 07:00 AM
Increase size for XFS filesystem Bonsai_XYZ Linux - Software 2 07-22-2006 12:49 PM
kdebase not recognizing XFree86-xfs package as xfs mikeyt_333 Linux - Software 1 08-17-2004 02:50 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration