ZFS Linux: Corrupted Directory and Missing Files - Scrub Shows No Errors
A file server crashed a couple of days ago, and since then, critical files written to the access directory are reporting errors. The ls command shows files as missing or corrupted, but the ZFS scrub operation reports no errors. This article focuses on the ZFS file system, its self-healing properties, and troubleshooting techniques when facing corrupted directories and missing files.
ZFS File System Overview
ZFS is a combined file system and logical volume manager designed by Sun Microsystems. It is known for its data integrity, performance, and pooled storage features. ZFS employs checksums for data and metadata, which allows it to detect and correct errors automatically. This self-healing capability makes ZFS a reliable choice for critical data storage.
ZFS Scrub Operation
ZFS periodically performs a scrub operation to ensure data integrity. The scrub process reads all data and metadata, verifying their checksums and repairing any issues it finds. This operation helps maintain the overall health of the ZFS pool. However, a scrub operation might not detect all issues, such as those caused by a crashed file server.
Corrupted Directory and Missing Files
When a file server crashes, it can lead to directory corruption or missing files. Although ZFS scrub operations can detect and repair many issues, they might not identify problems caused by external factors like a server crash. In such cases, manual intervention is required.
Troubleshooting Techniques
When dealing with a corrupted directory or missing files in ZFS, consider the following troubleshooting techniques:
-
ZFS Recovery Mode: Boot the system in ZFS recovery mode to attempt a file system check and repair. This process can help identify and fix issues caused by the server crash.
-
Zpool Import/Export: Try importing and exporting the ZFS pool. This process can sometimes help resolve issues with corrupted directories or missing files.
-
Data Recovery Tools: Use data recovery tools like
zfsdumporzfsrecvto create backups of the affected data and attempt recovery. These tools can help recover data from corrupted directories or missing files.
References
-
Books:
-
Articles:
-
Online Resources: