Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mounting XFS image file for XFS_REPAIR

Featured Replies

Hi,

 

Looking for some advice, in case I do something stupid. I have an external drive, formatted as XFS that was being used for monthly backups.

It came up with a "structure needs cleaning" error message. I was able to still mount it, but there were some files that appeared to be corrupted.

 

I ran dd to make an image file of the disk and mounted that just fine. However, it eventually failed with the same error and now I can't mount it at all.

I ran 

Quote

xfs_repair -nf /pathto/xfs.img

 

It returned this;

 

Quote

root@Nexus:~# xfs_repair -fn /mnt/user/BackupNextcloudSync/NextcloudSyncRecover.img 
Cannot get host filesystem geometry.
Repair may fail if there is a sector size mismatch between
the image and the host filesystem.
Phase 1 - find and verify superblock...
Cannot get host filesystem geometry.
Repair may fail if there is a sector size mismatch between
the image and the host filesystem.
Phase 2 - using internal log
        - zero log...
ALERT: The filesystem has valuable metadata changes in a log which is being
ignored because the -n option was used.  Expect spurious inconsistencies
which may be resolved by first mounting the filesystem to replay the log.
        - scan filesystem freespace and inode maps...
sb_fdblocks 159900650, counted 161651371
        - found root inode chunk
Phase 3 - for each AG...
        - scan (but don't clear) agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 1
        - agno = 2

bad nblocks 63 for inode 1415390400, would reset to 4
bad nblocks 63 for inode 1415390401, would reset to 2
bad nblocks 63 for inode 1415390402, would reset to 4
bad nblocks 63 for inode 1415390403, would reset to 3
bad nblocks 63 for inode 1415390404, would reset to 2
bad nblocks 63 for inode 1415390405, would reset to 3
bad nblocks 63 for inode 1415390406, would reset to 3
bad nblocks 63 for inode 1415390407, would reset to 3
bad nblocks 63 for inode 1415390408, would reset to 2
bad nblocks 63 for inode 1415390409, would reset to 2
bad nblocks 63 for inode 1415390410, would reset to 2
bad nblocks 63 for inode 1415390411, would reset to 4
bad nblocks 63 for inode 1415390412, would reset to 2
data fork in ino 1415390413 claims free block 159043950
bad nblocks 63 for inode 1415390413, would reset to 1
data fork in ino 1415390414 claims free block 159053528
bad nblocks 63 for inode 1415390414, would reset to 76
data fork in ino 1415390415 claims free block 159053604
bad nblocks 63 for inode 1415390415, would reset to 56
data fork in ino 1415390416 claims free block 159053660
bad nblocks 63 for inode 1415390416, would reset to 212
data fork in ino 1415390417 claims free block 159053872
bad nblocks 63 for inode 1415390417, would reset to 57
data fork in ino 1415390418 claims free block 159053929

bad nblocks 63 for inode 1415390400, would reset to 4
bad nblocks 63 for inode 1415390401, would reset to 2
bad nblocks 63 for inode 1415390402, would reset to 4
bad nblocks 63 for inode 1415390403, would reset to 3
bad nblocks 63 for inode 1415390404, would reset to 2
bad nblocks 63 for inode 1415390405, would reset to 3
bad nblocks 63 for inode 1415390406, would reset to 3
bad nblocks 63 for inode 1415390407, would reset to 3
bad nblocks 63 for inode 1415390408, would reset to 2
bad nblocks 63 for inode 1415390409, would reset to 2
bad nblocks 63 for inode 1415390410, would reset to 2
bad nblocks 63 for inode 1415390411, would reset to 4
bad nblocks 63 for inode 1415390412, would reset to 2
data fork in ino 1415390413 claims free block 159043950
bad nblocks 63 for inode 1415390413, would reset to 1
data fork in ino 1415390414 claims free block 159053528
bad nblocks 63 for inode 1415390414, would reset to 76
data fork in ino 1415390415 claims free block 159053604
bad nblocks 63 for inode 1415390415, would reset to 56
data fork in ino 1415390416 claims free block 159053660
bad nblocks 63 for inode 1415390416, would reset to 212
data fork in ino 1415390417 claims free block 159053872
bad nblocks 63 for inode 1415390417, would reset to 57
data fork in ino 1415390418 claims free block 159053929

bad nblocks 63 for inode 1415390400, would reset to 4
bad nblocks 63 for inode 1415390401, would reset to 2
bad nblocks 63 for inode 1415390402, would reset to 4
bad nblocks 63 for inode 1415390403, would reset to 3
bad nblocks 63 for inode 1415390404, would reset to 2
bad nblocks 63 for inode 1415390405, would reset to 3
bad nblocks 63 for inode 1415390406, would reset to 3
bad nblocks 63 for inode 1415390407, would reset to 3
bad nblocks 63 for inode 1415390408, would reset to 2
bad nblocks 63 for inode 1415390409, would reset to 2
bad nblocks 63 for inode 1415390410, would reset to 2
bad nblocks 63 for inode 1415390411, would reset to 4
bad nblocks 63 for inode 1415390412, would reset to 2
bad nblocks 63 for inode 1415390413, would reset to 1
bad nblocks 63 for inode 1415390414, would reset to 76
bad nblocks 63 for inode 1415390415, would reset to 56
bad nblocks 63 for inode 1415390416, would reset to 212
bad nblocks 63 for inode 1415390417, would reset to 57
bad nblocks 63 for inode 1415390418, would reset to 49
bad nblocks 63 for inode 1415390419, would reset to 55
bad nblocks 63 for inode 1415390420, would reset to 215
bad nblocks 63 for inode 1415390421, would reset to 72
bad nblocks 63 for inode 1415390422, would reset to 36
bad nblocks 63 for inode 1415390423, would reset to 26
bad nblocks 63 for inode 1415390424, would reset to 23
bad nblocks 63 for inode 1415390425, would reset to 35
bad nblocks 63 for inode 1415390426, would reset to 65
bad nblocks 63 for inode 1415390427, would reset to 171
bad nblocks 63 for inode 1415390428, would reset to 76
inode 1415390429 - bad extent starting block number 2255105084723585, offset 703769136551052
correcting nextents for inode 1415390429
bad data fork in inode 1415390429
would have tried to rebuild inode 1415390429 data fork
would have cleared inode 1415390429
bad nblocks 63 for inode 1415390430, would reset to 25
bad nblocks 63 for inode 1415390431, would reset to 327

bad nblocks 63 for inode 1415390400, would reset to 4
bad nblocks 63 for inode 1415390401, would reset to 2
bad nblocks 63 for inode 1415390402, would reset to 4
bad nblocks 63 for inode 1415390403, would reset to 3
bad nblocks 63 for inode 1415390404, would reset to 2
bad nblocks 63 for inode 1415390405, would reset to 3
bad nblocks 63 for inode 1415390406, would reset to 3
bad nblocks 63 for inode 1415390407, would reset to 3
bad nblocks 63 for inode 1415390408, would reset to 2
bad nblocks 63 for inode 1415390409, would reset to 2
bad nblocks 63 for inode 1415390410, would reset to 2
bad nblocks 63 for inode 1415390411, would reset to 4
bad nblocks 63 for inode 1415390412, would reset to 2
bad nblocks 63 for inode 1415390413, would reset to 1
bad nblocks 63 for inode 1415390414, would reset to 76
bad nblocks 63 for inode 1415390415, would reset to 56
bad nblocks 63 for inode 1415390416, would reset to 212
bad nblocks 63 for inode 1415390417, would reset to 57
bad nblocks 63 for inode 1415390418, would reset to 49
bad nblocks 63 for inode 1415390419, would reset to 55
bad nblocks 63 for inode 1415390420, would reset to 215
bad nblocks 63 for inode 1415390421, would reset to 72
bad nblocks 63 for inode 1415390422, would reset to 36
bad nblocks 63 for inode 1415390423, would reset to 26
bad nblocks 63 for inode 1415390424, would reset to 23
bad nblocks 63 for inode 1415390425, would reset to 35
bad nblocks 63 for inode 1415390426, would reset to 65
bad nblocks 63 for inode 1415390427, would reset to 171
bad nblocks 63 for inode 1415390428, would reset to 76
inode 1415390429 - bad extent starting block number 2255105084723585, offset 703769136551052
correcting nextents for inode 1415390429
bad data fork in inode 1415390429
would have tried to rebuild inode 1415390429 data fork
would have cleared inode 1415390429
bad nblocks 63 for inode 1415390430, would reset to 25
bad nblocks 63 for inode 1415390431, would reset to 327

Missing reference count record for (2/24831218) len 4 count 2
Missing reference count record for (2/24835767) len 24 count 2
Missing reference count record for (2/24835792) len 8 count 2
Missing reference count record for (2/24836305) len 856 count 2
Missing reference count record for (2/31984586) len 215 count 2
setting reflink flag on inode 1272391648
setting reflink flag on inode 1272391649
setting reflink flag on inode 1272391650
setting reflink flag on inode 1272391651
setting reflink flag on inode 1272391652
setting reflink flag on inode 1272391653
setting reflink flag on inode 1272391654
setting reflink flag on inode 1272391655
setting reflink flag on inode 1272391656
setting reflink flag on inode 1272391657
setting reflink flag on inode 1272391658
setting reflink flag on inode 1272391659
setting reflink flag on inode 1272391660
setting reflink flag on inode 1272391668
setting reflink flag on inode 1272391669
setting reflink flag on inode 1272391670
setting reflink flag on inode 1272391671
setting reflink flag on inode 1272391672
setting reflink flag on inode 1272391673
setting reflink flag on inode 1272391674
setting reflink flag on inode 1272391675
setting reflink flag on inode 1272391676
setting reflink flag on inode 1272391678
setting reflink flag on inode 1272391679
setting reflink flag on inode 1415390400
setting reflink flag on inode 1415390401
setting reflink flag on inode 1415390402
setting reflink flag on inode 1415390403
setting reflink flag on inode 1415390404
setting reflink flag on inode 1415390405
setting reflink flag on inode 1415390406
setting reflink flag on inode 1415390407
setting reflink flag on inode 1415390408
setting reflink flag on inode 1415390409
setting reflink flag on inode 1415390410
setting reflink flag on inode 1415390411
setting reflink flag on inode 1415390412
setting reflink flag on inode 1415390420
setting reflink flag on inode 1415390421
setting reflink flag on inode 1415390422
setting reflink flag on inode 1415390423
setting reflink flag on inode 1415390424
setting reflink flag on inode 1415390425
setting reflink flag on inode 1415390426
setting reflink flag on inode 1415390427
setting reflink flag on inode 1415390428
setting reflink flag on inode 1415390430
setting reflink flag on inode 1415390431
No modify flag set, skipping phase 5
Phase 6 - check inode connectivity...
        - traversing filesystem ...
entry "config-router.clockworkmonocle.com-2025-03-03_01_31_01.xml" in directory inode 1222376706 points to free inode 1415390429, would junk entry
bad hash table for directory inode 1222376706 (no data entry): would rebuild
would rebuild directory inode 1222376706
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 - verify link counts...
No modify flag set, skipping filesystem flush and exiting.

 

So, my question is,

 

Can I run this command, to try and repair the image file?

Quote

xfs_repair -fv /mnt/user/BackupNextcloudSync/NextcloudSyncRecover.img 

I'd rather ask than regret it later. I don't want to run it and it somehow starts running against the XFS drive that its sitting on.

 

Your help appreciated it.

  • Community Expert

To attempt a repair, you must run it again without -n.

  • Author
1 hour ago, JorgeB said:

To attempt a repair, you must run it again without -n.

Thanks JorgeB, didn't work, I even tried it afterwards with the -L option. I reckon its toast. Not sure what happened there. I've reformatted the drive as BTRFS and it seems fine.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.