LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-06-2019, 08:25 AM   #1
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 342

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


[Log in to get rid of this advertisement]
Hello

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

Code:
$ sudo blockdev --getbsz /dev/vgh/root
512

$ 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?

Thanks
 
Old 12-08-2019, 04:13 AM   #2
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,728

Rep: Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777
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, 09:10 AM   #3
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,877

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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 https://en.wikipedia.org/wiki/Advanced_Format
 
1 members found this post helpful.

 


 

  


Reply



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 08:03 AM
[SOLVED] How can a file in XFS /var filesystem be larger than the filesystem? MensaWater Linux - Software 18 06-30-2018 04:05 AM
LXer: ZFS FileSystem vs XFS FileSystem. Which is Better? LXer Syndicated Linux News 0 05-03-2018 06:00 AM
Increase size for XFS filesystem Bonsai_XYZ Linux - Software 2 07-22-2006 11:49 AM
kdebase not recognizing XFree86-xfs package as xfs mikeyt_333 Linux - Software 1 08-17-2004 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:53 PM.

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