Xsan: How to repair the filesystem
Summary
Xsan volumes are designed in such a way that filesystems are unlikely to become damaged ("corrupted"), but you should be aware of what you can do if filesystem repair becomes necessary. Follow the recommendations in this article in order to reduce the chances of an Xsan filesystem developing issues.
Products Affected
Xsan
To repair the filesystem and volume, follow the steps below which correspond to the version of Xsan that you have.
Note that analyzing and repairing an Xsan filesystem requires that the volume be unmounted and stopped.
Do not run cvfsck against filesystems that are mounted, as doing so may result in incorrect indications that the filesystem is corrupted.
How to determine if an Xsan filesystem is damaged
Use these commands in Terminal, which work for all versions of Xsan:
cd /Library/Filesystems/Xsan/bin sudo ./cvfsck -j <Volume_Name> sudo ./cvfsck -nv
Replace <Volume_Name> with the actual name of the target Xsan Volume.
While cvfsck is running, it will produce verbose statistics about the state of the filesystem. Following the statistics, there may be an alert that the filesystem has been modified. Such an alert does not mean that the filesystem has been repaired, but rather that it will need to be repaired, in which case you should continue with the next set of steps, in accordance with the version of Xsan you're using.
If you are concerned that the file system status is reported as "Clean" or "Dirty" please see this article.
How to repair a damaged Xsan filesystem
Note: In the steps below, replace "<Volume_Name>" with the actual name of the target Xsan volume.
For Xsan 1.1 and earlier
- Use Xsan Admin to unmount the volume from the Metadata Controllers and from the Xsan client units.
- In Xsan Admin, stop the Xsan volume.
- On a Metadata Controller, open Terminal.
- Execute the following commands one at a time, and authenticate when prompted:
cd /Library/Filesystems/Xsan/bin
sudo ./cvfsck -j <Volume_Name>
sudo ./cvfsck <Volume_Name>
When cvfsck exits, it will report that the filesystem was modified.
- Run the following command to ensure that the repair process was complete:
sudo cvfsck -nv <Volume_Name>
At this point, if cvfsck reports that the filesystem was modified or would have been modified, you should contact Apple technical support.
For Xsan 1.2
- Use Xsan Admin to unmount the volume from the Metadata Controllers and from the Xsan client units.
- In Xsan Admin, stop the Xsan volume.
- On a Metadata Controller, open Terminal.
- Execute this command, and authenticate when prompted:
sudo cvfsck
When cvfsck exits, it will report that the filesystem was modified.
- Run the following command to ensure that the repair process was complete:
sudo cvfsck -nv <Volume_Name>
At this point, if cvfsck reports that the filesystem was modified or would have been modified, you should contact Apple technical support.
For Xsan 1.3 or later
- Use Xsan Admin to unmount the volume from the Metadata Controllers and from the Xsan client units.
- In Xsan Admin, stop the Xsan volume.
- On a Metadata Controller, open Terminal.
- Execute the following commands one at a time, and authenticate when prompted:
sudo cvfsck -wv
When cvfsck exits, it will report that the filesystem was modified. - Run the following command to ensure that the repair process was complete:
sudo cvfsck -nv <Volume_Name>
At this point, if cvfsck reports that the filesystem was modified or would have been modified, you should contact Apple technical support.