When I use mkfs.xfs it is not enabling NLINK.

I have another drive in the machine that is set up the exact what I need this drive setup and the only difference is NLINK on one and not on the other. Is there anyway to use Mkfs.xfs with an option to tell it that I want NLINK enabled?

xfs_db> version (What I need)

[0x20a4+0x0] = V4,NLINK,ALIGN,DIRV2

xfs_db> version (What it is)

[0x2084+0x0] = V4,ALIGN,DIRV2

Is there anyway to get them to match up?

  • Any difference between drives and type of content you are storing? – asktyagi Jun 1 '19 at 3:11
  • No, so I have an a DD of one drive to the other and it works perfectly, but then I cannot remove the corrupted data. It works if I do that. Unless there is a good way to format it after doing that? and just remove the data without changing the partition. rm -rf does not work on the corrupted data and its taking up 2GB on a 9 GB harddrive partition. – Case Jun 1 '19 at 3:47
  • What is the exact command you are using to create the filesystem that doesn't ha ve the NLINK bit set? Is this faulty filesystem created by dd? If I understand this correctly, from the docs, XFS_SB_VERSION_NLINKBIT is set if any inodes use 32-bit di_nlink values. For NLINK to not be set, no inodes would use a 32-bit di_nlink value, which would mean the filesystem is using v1 inodes. Instead of using dd to copy the drive, you may want to look into xfs_copy. For corrupted data, xfs_repair may be of use. Which version of mkfs.xfs are you using? "mkfs.xfs -V" – Morgan Jun 7 '19 at 4:26
  • mkfs.xfs -f /dev/sda5 – Case Jun 7 '19 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.