beautypg.com

Create and preallocate a file (cvmkfile), Initialize a volume (cvmkfs) – Apple Xsan 2 User Manual

Page 153

background image

Appendix C

Use command-line tools

153

Create and preallocate a file (cvmkfile)

Use the

cvmkfile

command to allocate space for a file on an Xsan volume.

$ cvmkfile [-k affinity] [-p] [-s] [-w] [-z] size(k|m|g) filename

Parameter

Description

-k affinity

Allocate space for the file on one of the storage
pools with the specified affinity tag.

affinity

– the affinity tag that’s assigned to

the storage pools where you want the folder’s
contents to be stored
You can use the

show long

command of the

cvadmin

tool to see a storage pool’s affinity tag.

-p

Force future extensions of the file to be aligned
on block boundaries.

-s

Force the file allocation to align with block
boundaries.

-w

Set file size as indicated by

size.

-z

Set the contents of the file to zeros.

size

(k|m|g)

A number specifying the amount of space to
allocate to the file.

size

– a number

k

– kilobytes

m

– megabytes

g

– gigabytes

filename

The path to and name of the file to allocate.

Example

Allocate 2 GB of space for the file “data1” on the storage pool “datasets”:

$ cvmkfile -k datasets 2g data1

Initialize a volume (cvmkfs)

Use the

cvmkfs

command to initialize an Xsan volume based on the information in the

volume’s configuration (in /Library/Preferences/Xsan/volume.cfg).

WARNING:

Initializing a volume destroys all existing data on the volume.

$ sudo cvmkfs [-G] [-F] [volume]