Xsan 2 Administrator Guide - Creating and Preallocating a File (cvmkfile)

background image

Creating and Preallocating 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

background image

Appendix B

Using the Command Line

119