Warning: |
Encapsulating a disk requires that the system be rebooted several times. Schedule performance of this procedure for a time when this does not inconvenience users. |
This section describes how to encapsulate a disk for use in VxVM. Encapsulation preserves any existing data on the disk when the disk is placed under VxVM control.
A root disk can be encapsulated and brought under VxVM control. However, there are restrictions on the layout and configuration of root disks that can be encapsulated.
Use the format or fdisk commands to obtain a printout of the root disk partition table before you encapsulate a root disk. For more information, see the appropriate manual pages. You may need this information should you subsequently need to recreate the original root disk.
You cannot grow or shrink any volume (rootvol, usrvol, varvol, optvol, swapvol, and so on) that is associated with an encapsulated root disk. This is because these volumes map to physical partitions on the disk, and these partitions must be contiguous.
Disks with msdos disk labels can be encapsulated as auto:sliced disks provided that they have at least one spare primary partition that can be allocated to the public region, and one spare primary or logical partition that can be allocated to the private region.
Disks with sun disk labels can be encapsulated as auto:sliced disks provided that they have at least two spare slices that can be allocated to the public and private regions.
Extensible Firmware Interface (EFI) disks with gpt (GUID Partition Table) labels can be encapsulated as auto:sliced disks provided that they have at least two spare slices that can be allocated to the public and private regions.
The entry in the partition table for the public region does not require any additional space on the disk. Instead it is used to represent (or encapsulate) the disk space that is used by the existing partitions.
Unlike the public region, the partition for the private region requires a small amount of space at the beginning or end of the disk that does not belong to any existing partition or slice. By default, the space required for the private region is 32MB, which is rounded up to the nearest whole number of cylinders. On most modern disks, one cylinder is usually sufficient.
To encapsulate a disk for use in VxVM
# vxddladm set namingscheme={osn|ebn} persistence=yes
For example, to use persistent naming with enclosure-based naming:
# vxddladm set namingscheme=ebn persistence=yes
Your system may use device names that differ from the examples shown here.
At the following prompt, enter the disk device name for the disks to be encapsulated:
Select disk devices to encapsulate: [<pattern-list>,all,list,q,?] device name
The pattern-list can be a single disk, or a series of disks. If pattern-list consists of multiple items, those items must be separated by white space.
If you do not know the address (device name) of the disk to be encapsulated, enter l or list at the prompt for a complete listing of available disks.
Here is the disk selected. Output format: [Device] device name Continue operation? [y,n,q,?] (default: y) y
You can choose to add this disk to an existing disk group or to a new disk group. To create a new disk group, select a disk group name that does not yet exist. Which disk group [<group>,list,q,?]
Use a default disk name for the disk? [y,n,q,?] (default: y)
The selected disks will be encapsulated and added to the disk group name disk group with default disk names. device name Continue with operation? [y,n,q,?] (default: y) y
The following disk has been selected for encapsulation. Output format: [Device] device name Continue with encapsulation? [y,n,q,?] (default: y) y
A message similar to the following confirms that the disk is being encapsulated for use in VxVM and tells you that a reboot is needed:
The disk device device name will be encapsulated and added to the disk group diskgroup with the disk name diskgroup01.
Enter the desired format [cdsdisk,sliced,simple,q,?] (default: cdsdisk)
Enter the format that is appropriate for your needs. In most cases, this is the default format, cdsdisk. Note that only the sliced format is suitable for use with root, boot or swap disks.
Enter desired private region length [<privlen>,q,?] (default: 65536)
Do you want to use sliced as the format should cdsdisk fail? [y,n,q,?] (default: y)
If you enter y, and it is not possible to encapsulate the disk as a CDS disk, it is encapsulated as a sliced disk. Otherwise, the encapsulation fails.
# shutdown -r now
The /etc/fstab
file is updated to include the volume devices that are used to mount any encapsulated file systems. You may need to update any other references in backup scripts, databases, or manually created swap devices. The original /etc/fstab
file is saved as /etc/fstab.b4vxvm
Encapsulate other disks? [y,n,q,?] (default: n) n
The default layout that is used to encapsulate disks can be changed.