Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Usually, you would only run this command on the device file of an unmounted file system that you believe has a problem. If xfs_check displays any output when you do not run it in
verbose mode, the file system has an inconsistency.
# xfs_check device
Or use
# xfs_repair -n device
Note: Unlike fsck, neither xfs_check nor xfs_repair are invoked automatically on system startup. They should be used only if you suspect a file system consistency
problem.
# xfs_repair device
If the journal log has become corrupted, you can reset the log by specifying the -L option to xfs_repair.
Note: Resetting the log can leave the file system in an inconsistent state, resulting in data loss and data corruption. Unless you are experienced in debugging and repairing XFS file
systems using xfs_db, it is recommended that you instead recreate the file system and restore its contents from a backup.
If you cannot mount the file system or you do not have a suitable backup, running xfs_repair is the only viable option unless you are experienced in using xfs_db.
xfs_db provides an internal command set that allows you to debug and repair an XFS file system manually. The commands allow you to perform scans on the file system, and to
navigate and display its data structures. If you specify the -x option to enable expert mode, you can modify the data structures.
For more information, see the xfs_check(8) , xfs_db(8) and xfs_repair(8) manual pages, and the help command within xfs_db.
Disconnected inode 242002, xfs_repair found an inode that is in use, but is not
moving to lost+found
connected to the file system. The inode is moved to the
file system's lost+found directory. Its name is its inode
Error Messages When Files Are
number, in this example 242002. If the disconnected in lost+found
inode is a directory, the directory's subtree is preserved—
xfs_repair has put files and directories in a file
all its child inodes are automatically moved with it, so the
system's lost+found directory and you do not remove
entire directory subtree moves to lost+found.
them, the next time you run xfs_repair it temporarily
disconnects the inodes for those files and directories.
imap claims in-use inode 2444941 The inode allocation map in the file system behaves as if They are reconnected before xfs_repair terminates.
inode 2444941 is free, but the inode itself looks like it is As a result of the disconnected inodes in lost+found,
is free, correcting imap you see output like this:
still in use. xfs_repair corrects the inode map to say
that the inode is in use.
Resetting inode 241996 nlinks xfs_repair detected a mismatch between the number
of directory entries pointing to the inode (links) and the
from 5 to 3
number of links recorded in the inode. It corrected the
number (from 5 to 3 in this case).
Cleared inode 2444926 There was something wrong with the inode that was not
correctable, so xfs_repair turned it into a zero-length
free inode. This usually happens because the inode
claims blocks that are used by something else or the
inode itself is badly corrupted. Typically, the cleared
inode message is preceded by one or more messages
indicating why the inode needs to be cleared.
In this example, inode 242000 was an inode that was moved to lost+found during a previous xfs_repair run. This run of xfs_repair found that the file system is consistent. If
the lost+found directory had been empty, in phase 4 only the messages about clearing and deleting the lost+found directory would have appeared. The left-justified imap
claims and disconnected inode messages appear (one pair of messages per inode) if there are inodes in the lost+found directory.
If xfs_repair failed in phase 1, you must restore lost files from backups.
If xfs_repair failed in phase 2 or later, you may be able to restore files from the disk by backing up and restoring the files on the file system.
3. Use mkfs to a make new file system on the same disk partition or XLV logical volume.
When you mount the file system in no-recovery mode when it was not unmounted cleanly, the file system is likely to be inconsistent, and you will be unable to read all of its data.
However, you may be able to recover data that you can cannot otherwise access.
Details
Category: Storage (/storage)
C Published: 22 December 2016
C Last Updated: 11 May 2017
< Hits: 7306
Leave a comment
You are here: Home (/) Storage (/storage) How to repair a xfs filesystem
Search ...
See also:
xfs_copy command examples (/storage/668-xfs-copy-command-examples)
xfsdump vs xfs_copy (/storage/670-xfsdump-vs-xfs-copy)
XFS File System backup and restoration (/storage/547-xfs-file-system-backup-and-restoration)
xfsdump and xfsrestore examples (/storage/693-xfsdump-and-xfsrestore-examples)
iozone examples for file system benchmark on linux (/storage/47-iozone-examples-for-file-system-benchmark-on-linux)
XFS optimisation on large array (/storage/63-xfs-optimisation-on-large-array)
Create filesystem on filesystem/partition existing disk (/storage/250-create-filesystem-on-filesystem-partition-existing-disk)
Creating an XFS File system on Linux (/storage/540-creating-an-xfs-file-system-on-linux)
How to avoid file system corruption (/storage/674-how-to-avoid-file-system-corruption)
How to defragment an XFS filesystem (/storage/673-how-to-defragment-an-xfs-filesystem)
How to repairing an XFS File system (/storage/542-how-to-repairing-an-xfs-file-system)
How to run xfs_repair to root filesystem (/storage/669-how-to-run-xfs-repair-to-root-filesystem)
How to suspend an XFS File System (/storage/543-how-to-suspend-an-xfs-file-system)
Increasing the Size of an XFS File System (/storage/541-increasing-the-size-of-an-xfs-file-system)
Migrating from ext4 to XFS File System (/storage/545-migrating-from-ext4-to-xfs-file-system)
Practicle tips when repairing xfs filesystem (/storage/692-practicle-tips-when-repairing-xfs-filesystem)
What's Barriers, how to enable/disable it on Linux (/storage/565-what-s-barriers-how-to-enable-disable-it-on-linux)
XFS quota management (/storage/546-xfs-quota-management)
XFS useful utilities (/storage/544-xfs-useful-utilities)
xfs_admin command examples (/storage/698-xfs-admin-command-examples)
New posts
what's LTO and it's road map (/storage/721-what-s-lto-and-it-s-road-map)
LTO8 capacity (/storage/720-lto8-capacity)
LTO8 features and benefit glance (/storage/719-lto8-features-and-benefit-glance)
LTO generation 7 initialized LTO-8 Type M media (/storage/718-lto-generation-7-initialized-lto-8-type-m-media)
Storcli Logging Commands examplles (/storage/717-storcli-logging-commands-examplles)
Most liked:
Check HBA card and its driver's info on linux(RHEL6) (/storage/9-check-hba-card-and-its-driver-s-info-in-linux-rhel6)
How to setup ssh tunnel ( ssh forwarding) (/sysadmin/186-how-to-setup-ssh-tunnel-ssh-forwarding)
CVS mostly used command examples (/scripting/260-cvs-mostly-used-command-examples)
How to keep idle ssh connection alive (/sysadmin/172-how-to-keep-idle-ssh-connection-alive)
rexec configuration on linux (/sysadmin/149-rexec-configuration-on-linux)
Rlogin configuration on linux (/sysadmin/148-rlogin-configuration-on-linux)
Linux sysfs Filesystem (/sysadmin/495-linux-sysfs-filesystem)
rsync server setup on RHEL (/sysadmin/85-rsync-server-setup-on-rhel)
udevadm command examples (/sysadmin/93-udevadm-command-examples)
Check and list luns attached to HBA in RHEL6 (/storage/8-check-and-list-luns-attached-to-hba-in-rhel6)
LSI MegaRAID Patrol read and consistency check (/storage/175-lsi-megaraid-patrol-read-and-consistency-check)
Rsh configuration on linux (/sysadmin/115-rsh-configuration-on-linux)
How to setup ssh login without password (/sysadmin/163-how-to-setup-ssh-login-without-password)
List of Brocade SAN switch CLI command (/storage/227-list-of-brocade-san-switch-cli-command)
How to tell if CPU hyperthreading enabled on Linux (/sysadmin/155-how-to-tell-if-cpu-hyperthreading-enabled-on-linux)
How to check HBA driver, firmware and boot image info on Linux (/storage/62-ways-to-check-hba-driver-firmware-and-boot-image-info-on-linux)
Arcconf command examples ( Adaptec ARRAY Controller ) (/storage/3-arcconf-command-examples-adaptec-array-controller)
How to identify defective DIMM from EDAC error on Linux (/sysadmin/240-how-to-identify-defective-dimm-from-edac-error-on-linux-2)
ZFS ARC on Linux, how to set and monitor on Linux? (/storage/169-zfs-arc-on-linux-how-to-set-and-monitor-on-linux)
ZFS on Linux performance tuning (/storage/171-zfs-on-linux-performance-tuning)
lspci useful examples (/sysadmin/75-lspci-useful-examples)
Cli(Command Line interface ) for IBM DS Storage Manager examples (/storage/151-cli-command-line-interface-for-ibm-ds-storage-manager-examples)
Curl http commands with WebDAV (/storage/117-curl-http-commands-with-webdav)
MegaCli useful commands with examples (/storage/145-megacli-useful-commands-with-examples)
IPMITOOL useful examples . (/sysadmin/71-ipmitool-useful-examples)
lsblk command examples (/storage/53-lsblk-command-examples)
Ways to kill parent and child processes in one command (/sysadmin/237-ways-to-kill-parent-and-child-processes-in-one-command)
memory test tools on Centos/RHEL and other linux (/sysadmin/78-memory-test-tools-on-centos-rhel-and-other-linux)
Linux lsscsi - list SCSI devices (or hosts) and their attributes (/storage/51-linux-lsscsi-list-scsi-devices-or-hosts-and-their-attributes)
Hot add, remove, rescan of SCSI devices on Linux (/storage/279-hot-add-remove-rescan-of-scsi-devices-on-linux)