Veritas™ File System 5.0.1 Programmer's Reference Guide

To encapsulate a raw volume as a file
1
Add the volume to the volume set.
2
To encapsulate a raw volume vol-03 as a file named encapsulate_name in
the file system /mnt, create code similar to the following:
/* Take the raw volume vol-03 and encapsulate it. The
volume’s contents will be accessible through the given
path name. */
vxfs_vol_encapsulate("/mnt/encapsulate_name", "vol-03",
infop->dev_size);
/* Access to the volume is through writes and reads of file
"/mnt/encapsulate_name" */
encap_fd = open("/mnt/encapsulate_name");
write(encap_fd, buf, 1024);
To de-encapsulate a raw volume
To de-encapsulate the raw volume vol-03 named encapsulate_name in the
file system /mnt, create code similar to the following:
/* Use de-ecapsulate to remove raw volume. After
de-encapsulation, vol-03 is still part of volset, but is
not an active part of the file system. */
vxfs_vol_deencapsulate("/mnt/encapsulate_name");
61Multi-volume support
Using policies and application programming interfaces