beautypg.com

Checking volume fragmentation, Defragmenting a volume – Apple Xsan 2 (Third Edition) User Manual

Page 64

background image

Checking 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 scattered in less efficient arrangements. You can
use the

cvfsck

utility to check the state of file fragmentation on your volumes.

To check volume fragmentation:

1

Open Terminal (in /Applications/Utilities/).

2

If you aren’t working at the SAN controller computer, use SSH to log in to the controller

remotely:

$ ssh user@computer

Replace

user

with the name of an administrator user on the controller computer and

computer

with the controller’s name or IP address.

3

Run the

cvfsck

command-line utility with the

-f

option:

$ sudo cvfsck -f volume

For more information, see the

cvfsck

man page.

Defragmenting a Volume

Defragmenting a file reassembles its pieces into the most efficient arrangement. You
can use the

snfsdefrag

command to defragment a file, a folder, or an entire volume.

To defragment a file, folder, or volume:

1

Open Terminal (in /Applications/Utilities/).

2

If you aren’t working at the SAN controller computer, use SSH to log in to the controller

remotely:

$ ssh user@computer

Replace

user

with the name of an administrator user on the controller computer and

computer

with the controller’s name or IP address.

3

Run the

snfsdefrag

command.

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.

For more information, see the

snfsdefrag

man page or “Defragmenting a File, Folder,

or Volume (snfsdefrag)” on page 119.

64

Chapter 4

Managing SAN Storage