beautypg.com

Apple Xsan 1.0 User Manual

Page 94

background image

94

Appendix B

Using the Command Line

Examples

Count the extents in file

datafile

:

$ snfsdefrag -c datafile

List the extents:

$ snfsdefrag -e datafile

Defragment the file

datafile

:

$ snfsdefrag datafile

Defragment the file datafile only if it has more than two extents:

$ snfsdefrag -m 2 datafile

Defragment every file in the directory

/datafolder

(or any directory within

/datafolder

) that has more than one extent:

$ snfsdefrag -r datafolder

Recover unused pre-allocated disk space assigned to every file in directory

/datafolder

:

$ snfsdefrag -rp datafolder

-K affinity

Only operate on files with the specified storage pool affinity.

affinity

– the affinity key (in Xsan, the affinity key is the same

as the name of the storage pool)

You can use the cvadmin show long command to see a
storage pool’s affinity key.

-k affinity

Allocate new extents on the storage pool with this affinity.

-l

List files that might benefit from defragmentation.

-m count

Only operate on files with more than count extents.

-p

Prune instead of defragment.

-q

Suppress messages.

-r [target]

Operate recursively to defragment all files in all directories within
the specified target directory.

-s

Allocate new extents on block boundaries.

-v

Display all available information and status during
defragmentation.

Parameter

Description

LL0192.book Page 94 Thursday, July 29, 2004 5:20 PM