The following example illustrates how to encapsulate a volume.
VOLUME INDEX LENGTH STATE CONTEXT
The volume set has two volumes.
# dd if=/etc/passwd of=/dev/vx/rdsk/rootdg/dbvol count=1
The third volume will be used to demonstrate how the volume can be accessed as a file, as shown later.
# mkfs -t vxfs /dev/vx/rdsk/rootdg/myvset
204800 sectors, 102400 blocks of size 1024,
# mount -t vxfs /dev/vx/dsk/rootdg/myvset /mnt1
# fsvoladm encapsulate /mnt1/dbfile dbvol 100m
-rw------- 1 root other 104857600 May 22 11:30 /mnt1/dbfile
root:x:0:1:Super-User:/:/sbin/sh
The passwd
file that was written to the raw volume is now visible in the new file.
Note If the encapsulated file is changed in any way, such as if the file is extended, truncated, or moved with an allocation policy or resized volume, or the volume is encapsulated with a bias, the file cannot be de-encapsulated.