You can use the snfsdefrag command to defragment a file by reallocating its data in a single extent. If the snfsdefrag command fails on a client or controller running Xsan on Panther or Tiger, restart the computer. After restart, snfsdefrag should succeed, but if it doesn't, try stopping and restarting the volume using Xsan Admin.
Here is an example of a failed snfsdefrag command when run in verbose mode:
ServerName:/Volumes/MyVolumeName root# snfsdefrag -v Tiger_8A428_ServerDVD_0Z693-5618-185.dmg Tiger_8A428_ServerDVD_0Z693-5618-185.dmg: 4 extents: new extent count 1, CvApi_SwapExtents failed for cookie 0x12b29133, skipping. 1 file visited: 0 defragged, 1 skipped
Here is an example of a successful snfsdefrag command when run in verbose mode:
ServerName:/Volumes/MyVolumeName root# snfsdefrag -v Tiger_8A428_ServerDVD_0Z693-5618-185.dmg Tiger_8A428_ServerDVD_0Z693-5618-185.dmg: 4 extents: new extent count 1, done. 1 file visited: 1 defragged, 0 skippedFor more information on snfsdefrag and other commands, see the Xsan Administrator's Guide.