Please enter search query.
Search <book_title>...
Veritas™ File System Programmer's Reference Guide - Solaris
Last Published:
2018-08-24
Product(s):
InfoScale & Storage Foundation (7.2)
Platform: Solaris
- Veritas File System software developer's kit
- File Change Log
- About the File Change Log file
- Record types
- File Change Log tunables
- Application programming interface for File Change Log
- API functions
- File Change Log record
- Copying File Change Log records
- Veritas File System and File Change Log upgrade and downgrade
- Reverse path name lookup
- Multi-volume support
- Named data streams
- Veritas File System I/O
- Caching advisories
- Extents
- Thin Reclamation
Using volume application programming interfaces
The following pseudocode provides an example of using the volume APIs.
To shrink or grow a volume within a file system
- Use the vxresize command to grow the physical volume.
- To use the vxfs_vol_resize() call to shrink or grow the file system, create codes similar to the following:
/* stat volume "vol-03" to get the size information */ fd = open("/mnt"); vxfs_vol_stat(fd, "vol-03", infop); /* resize (shrink/grow) accordingly. This example shrinks the volume by half */ vxfs_vol_resize(fd, "vol-03", infop->dev_size / 2);
To encapsulate a raw volume as a file
- Add the volume to the volume set.
- 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");