Maintain Xsan SAN volumes in macOS Server
There are several volume maintenance tasks you can perform on SAN volumes.
Rename a volume
You can use the Xsan pane of the Server app to change the name of a volume. You can’t rename an Xsan volume using the Finder.
Important: During renaming, the volume is unmounted and restarted, and therefore unavailable to clients.
In the Server app sidebar, select Xsan from the list of advanced services.
Select the volume you want to rename.
Click and choose Edit Volume.
Select the volume name, then edit it.
Click OK.
Destroy a volume
You can destroy a volume, and reuse its LUNs to create new volumes.
WARNING: After you destroy a volume, data stored on it is no longer available.
In the Server app sidebar, select Xsan from the list of advanced services, select the volume in the list, then click .
Check volume fragmentation
When you create a file, Xsan divides the file into pieces and distributes these pieces efficiently over the LUNs that make up one of the volume’s storage pools. Over time, as the file is modified, its pieces become fragmented in less efficient arrangements.
You can use the snfsdefrag
command-line tool to check the amount of file fragmentation, or use the cvfsck
command-line tool to check the amount of free space fragmentation.
Open Terminal (in the /Applications/Utilities/ folder) on any SAN computer.
If you aren’t working at a SAN computer, use SSH to log in to a SAN computer remotely:
$ ssh user@computer
Replace user with the name of an administrator user on the SAN computer and computer with the SAN computer’s name or IP address.
If you have trouble making an SSH connection, check the Sharing pane of System Preferences on the SAN computer to make sure Remote Login service is turned on.
See the
cvfsck
orsnfsdefrag
man page.
Defragment a volume
You can use the snfsdefrag
command-line tool to defragment a file, a folder, or an entire volume.
Defragmenting a file reassembles its pieces into the most efficient arrangement.
Open Terminal (in the /Applications/Utilities/ folder) on any SAN computer.
If you aren’t working at a SAN computer, use SSH to log in to a SAN computer remotely:
$ ssh user@computer
Replace user with the name of an administrator user on the SAN computer and computer with the SAN computer’s name or IP address.
If you have trouble making an SSH connection, check the Sharing pane of System Preferences on the SAN computer to make sure Remote Login service is turned on.
See the
snsfdefrag
man page.Run the
snfsdefrag
command-line tool.To defragment individual files:
$ sudo snfsdefrag -v filename [filename... ]
To defragment a folder:
$ sudo snfsdefrag -vr folder
To defragment a volume, set folder to the volume name.
Check the integrity of a volume
If SAN users have trouble accessing files, use the cvfsck
command-line tool to check the integrity of a volume, its metadata, and its files.
Open Terminal (in the /Applications/Utilities/ folder) on any SAN computer.
If you aren’t working at a SAN computer, use SSH to log in to a SAN computer remotely:
$ ssh user@computer
Replace user with the name of an administrator user on the SAN computer and computer with the SAN computer’s name or IP address.
If you have trouble making an SSH connection, check the Sharing pane of System Preferences on the SAN computer to make sure Remote Login service is turned on.
Run the
cvfsck
command-line tool (in /System/Library/Filesystems/acfs.fs/Contents/bin/) to check the volume without making repairs:$ sudo cvfsck -vn volume
You’ll see a warning that the journal is active; this is normal.
See the cvfsck
man page.
Repair a volume
If the cvfsck
tool reveals problems with a volume, you can use the cvfsck
command-line tool to repair the volume.
In the Server app sidebar, select Xsan from the list of advanced services.
Stop the volume.
Select the volume. Then click and choose Stop Volume. The volume will be unmounted on all SAN computers.
Open Terminal (in the /Applications/Utilities/ folder) on any SAN computer.
If you aren’t working at a SAN computer, use SSH to log in to a SAN computer remotely:
$ ssh user@computer
Replace user with the name of an administrator user on the SAN computer and computer with the SAN computer’s name or IP address.
If you have trouble making an SSH connection, check the Sharing pane of System Preferences on the SAN computer to make sure Remote Login service is turned on.
See the
cvfsck
man page.Run the
cvfsck
command-line tool (in /System/Library/Filesystems/acfs.fs/Contents/bin/) to replay the events that are recorded in the file system journal:$ sudo cvfsck -j volume
Check the volume to see if repairs are required:
$ sudo cvfsck -vn volume
If the report generated in the previous step lists problems, enter the following command to perform a full check and repair of the volume:
$ sudo cvfsck -vw volume
Take the volume online.
In the Xsan pane of the Server app, select the volume. Then click and choose Take Volume Online in.