How to check whether xfs superblock is valid or not ?

In this article I am going to show that how can we validate the consistency of superblock in XFS.

* I have below xfs filesystem with label testxfs1 

[root@client2 ~]# mkfs.xfs -fL testxfs1 /dev/sdc
meta-data=/dev/sdc               isize=256    agcount=4, agsize=65536 blks
=                       sectsz=512   attr=2, projid32bit=1
=                       crc=0
data     =                       bsize=4096   blocks=262144, imaxpct=25
=                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=12800, version=2
=                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

* To check the primary superblock consistency we can run the below command. If its showing the output like XFSB and the label name then our primary superblock is valid one.

[root@client2 ~]# dd if=/dev/sdc bs=512 count=1 | strings
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000555835 s, 921 kB/s


* If in case, we are not able to see the output like above then we have to go with alternate superblock option for repair.

xfs_repair -vL /dev/sdc

Tip : I have see the scenario in which Cu was supposed to run the repair of 175TB filesystem it took 8 hours to complete the repair on local disks.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s