This procedure shows the necessary steps to encapsulate and mirror your root disk if you choose to do it after vxinstall has already been run. The options in vxdiskadm may vary slightly between Volume Manager versions, however the procedure should be the virtually the same in all currently supported 2.x and 3.x Sun Enterprise Volume Manager[TM] (SEVM) and Veritas Volume Manager (VxVM) versions. The examples below assume that the primary rootdisk is c0t0d0 and the mirror of root is c0t1d0. It also assumes that we choose to name c0t0d0 rootdisk and c0t1d0 rootmir. Other names can be selected if desired. SOLUTION SUMMARY: STEP 1---------------------------------------- Need patch: 111413-08 111904-05 111909-06 (2,8,6,4,5,3,7,1) Run the following commands if the file doesn't exist under /etc/vx/slib: # cp /usr/lib/liba5k.so.2 /etc/vx/slib # cp /usr/lib/libdevice.so.1 /etc/vx/slib # cp /usr/lib/libsocket.so.1 /etc/vx/slib # cp /usr/lib/libdevinfo.so.1 /etc/vx/slib # cp /usr/lib/libmp.so /etc/vx/slib # cp /usr/lib/libthread.so.1 /etc/vx/slib # cp /usr/lib/libc.so.1 /etc/vx/slib # cp /usr/lib/libg_fc.so.2 /etc/vx/slib # cp /usr/lib/libnsl.so.1 /etc/vx/slib # cp /usr/lib/libnvpair.so.1 /etc/vx/slib # cp /usr/lib/libdevid.so.1 /etc/vx/slib # vxinstall VxVM uses license keys to control access. If you have a SPARCstorage Array (SSA) controller or a Sun Enterprise Network Array (SENA) controller Are you prepared to enter a license key [y,n,q,?] (default: y) y Please enter your key: 1234 5678 …. Do you wish to enter another license key [y,n,q,?] (default: n) n Do you want to use enclosure based names for all disks ? [y,n,q,?] (default: n) n Hit RETURN to continue. 1 Quick Installation 2 Custom Installation 3 Prevent multipathing/Suppress devices from VxVM's view ? Display help about menu ?? Display help about the menuing system q Exit from menus Select an operation to perform: 1 Encapsulate Boot Disk [y,n,q,?] (default: n) y Enter disk name for [<name>,q,?] (default: rootdisk) rootdisk Hit RETURN to continue. The following is a summary of your choices. C0t0d0 Encapsulate c0t1d0 New Disk Is this correct [y,n,q,?] (default: y) y The system now must be shut down and rebooted in order to continue the reconfiguration. Shutdown and reboot now [y,n,q,?] (default: n) y We will encapsulate the primary root disk using vxdiskadm. # vxdiskadm
Volume Manager Support Operations Menu: VolumeManager/Disk 1 Add or initialize one or more disks 2 Encapsulate one or more disks 3 Remove a disk 4 Remove a disk for replacement 5 Replace a failed or removed disk 6 Mirror volumes on a disk 7 Move volumes from a disk 8 Enable access to (import) a disk group 9 Remove access to (deport) a disk group 10 Enable (online) a disk device 11 Disable (offline) a disk device 12 Mark a disk as a hot-spare for a disk group 13 Turn off the hot-spare flag on a disk list List disk information ? Display help about menu ?? Display help about the menuing system q Exit from menus Select an operation to perform: 2 Encapsulate one or more disks Menu: VolumeManager/Disk/Encapsulate Use this operation to convert one or more disks to use the Volume Manager. This adds the disks to a disk group and replaces existing partitions with volumes. Disk encapsulation requires a reboot for the changes to take effect. More than one disk or pattern cab be entered at the prompt. Here are some disk selection examples: all: all disks c3 c4t2: all disks on both controller 3 and controller 4, target 2 c3t4d2: a single disk Select disk devices to encapsulate: [<pattern-list>,all,list,q,?] c0t0d0 Here is the disk selected. Output format: [Device_Name] c0t0d0 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 name that does not yet exist. Which disk group [<group>,list,q,?] (default: rootdg) rootdg Use a default disk name for the disk? [y,n,q,?] (default: y) n NOTE: Make sure you select "n"; we need to call the drive rootdisk. The selected disks will be encapsulated and added to the rootdg disk group with disk names that will be specified interactively. c0t0d0 Continue with operation? [y,n,q,?] (default: y) y The following disk has been selected for encapsulation. Output format: [Device_Name] c0t0d0 Continue with encapsulation? [y,n,q,?] (default: y) y Enter disk name for [<name>,q,?] (default: disk01) rootdisk The disk device c0t0d0 will be encapsulated and added to the disk group rootdg with the disk name rootdisk. The c0t0d0 disk has been configured for encapsulation. The first stage of encapsulation has completed successfully. You should now reboot your system at the earliest possible opportunity. The encapsulation will require two or three reboots, which will happen automatically after the next reboot. To reboot, execute the command: shutdown -g0 -y -i6 This will update the /etc/vfstab file so that volume devices are used to mount the file systems on this disk device. You will need to update any other references such as backup scripts, databases, or manually created swap devices. Encapsulate other disks? [y,n,q,?] (default: n) n Volume Manager Support Operations Menu: VolumeManager/Disk 1 Add or initialize one or more disks 2 Encapsulate one or more disks 3 Remove a disk 4 Remove a disk for replacement 5 Replace a failed or removed disk 6 Mirror volumes on a disk 7 Move volumes from a disk 8 Enable access to (import) a disk group 9 Remove access to (deport) a disk group 10 Enable (online) a disk device 11 Disable (offline) a disk device 12 Mark a disk as a hot-spare for a disk group 13 Turn off the hot-spare flag on a disk list List disk information ? Display help about menu ?? Display help about the menuing system q Exit from menus Select an operation to perform: q NOTE: We need to reboot for the encapsulation to take effect: # Init 6 This will create volumes around the root partitions. Generally these volumes will be rootvol, swapvol, var, usr, and export but this will vary depending on how the rootdisk was originally created/partitioned. Rebooting will also edit the /etc/system and /etc/vfstab to reflect that the boot disk is now encapsulated. STEP 2---------------------------------------- Now we need to prepare the mirror drive by initializing it into Volume Manager control using vxdiskadm. If you already have the disk initialized skip this step. You can determine if the disk is already initialized by doing a 'vxdisk list'. If the disk is online in the farthest right hand column, that means it has already been initialized. If the disk shows as error, you will need to initialize it. # vxdiskadm Volume Manager Support Operations Menu: VolumeManager/Disk 1 Add or initialize one or more disks 2 Encapsulate one or more disks 3 Remove a disk 4 Remove a disk for replacement 5 Replace a failed or removed disk 6 Mirror volumes on a disk 7 Move volumes from a disk 8 Enable access to (import) a disk group 9 Remove access to (deport) a disk group 10 Enable (online) a disk device 11 Disable (offline) a disk device 12 Mark a disk as a hot-spare for a disk group 13 Turn off the hot-spare flag on a disk list List disk information ? Display help about menu ?? Display help about the menuing system q Exit from menus Select an operation to perform: 1 Add or initialize disks Menu: VolumeManager/Disk/AddDisks Use this operation to add one or more disks to a disk group. You can add the selected disks to an existing disk group or to a new disk group that will be created as a part of the operation. The selected disks can also be added to a disk group as hot spares. The selected disks can also be initialized without adding them to a disk group leaving the disks available for use as replacement disks. More than one disk or pattern may be entered at the prompt. Here are some disk selection examples: all: all disks c3 c4t2: all disks on both controller 3 and controller 4, target 2 c3t4d2: a single disk Select disk devices to add: [<pattern-list>,all,list,q,?] c0t1d0 Here is the disk selected. Output format: [Device_Name] c0t1d0 Continue operation? [y,n,q,?] (default: y) y You can choose to add this disk to an existing disk group, a new disk group, or leave the disk available for use by future add or replacement operations. To create a new disk group, select a disk group name that does not yet exist. To leave the disk available for future use, specify a disk group name of "none". Which disk group [<group>,none,list,q,?] (default: rootdg) rootdg Use a default disk name for the disk? [y,n,q,?] (default: y) n Add disk as a hot-spare disk for rootdg? [y,n,q,?] (default: n) n Exclude disk from hot-relocation use ? [y,n,q,?] (default: n) n The selected disks will be added to the disk group rootdg with disk names that you will specify interactively. c0t1d0 Continue with operation? [y,n,q,?] (default: y) y Add or initialize other disks? [y,n,q,?] (default: n) n Volume Manager Support Operations Menu: VolumeManager/Disk 1 Add or initialize one or more disks 2 Encapsulate one or more disks 3 Remove a disk 4 Remove a disk for replacement 5 Replace a failed or removed disk 6 Mirror volumes on a disk 7 Move volumes from a disk 8 Enable access to (import) a disk group 9 Remove access to (deport) a disk group 10 Enable (online) a disk device 11 Disable (offline) a disk device 12 Mark a disk as a hot-spare for a disk group 13 Turn off the hot-spare flag on a disk list List disk information ? Display help about menu ?? Display help about the menuing system q Exit from menus Select an operation to perform: 6 Mirror volumes on a disk Menu: VolumeManager/Disk/Mirror This operation can be used to mirror volumes on a disk. These volumes can be be mirrored onto another disk or onto any available disk space. Volumes will not be mirrored if they are already mirrored. Also, volumes that are comprised of more than one subdisk will not be mirrored. Mirroring volumes from the boot disk will produce a disk that can be used as an alternate boot disk. At the prompt below, supply the name of the disk containing the volumes to be mirrored. Enter disk name [<disk>,list,q,?] rootdisk You can choose to mirror volumes from disk rootmirror onto any available disk space, or you can choose to mirror onto a specific disk. To mirror to a specific disk, select the name of that disk. To mirror to any available disk space, select "any". Enter destination disk [<disk>,list,q,?] (default: any) disk01 The requested operation is to mirror all volumes on disk rootdisk in disk group rootdg onto available disk space on disk rootmirror. NOTE: This operation can take a long time to complete. Continue with operation? [y,n,q,?] (default: y) y Mirror volume rootvol ... This message will be repeated for all volumes that are mirrored until it is complete. Run: # vxprint -htg rootdg To verify that the mirroring is set up when vxdiskadm is complete. 这个是偶自己做的,呵呵。 mmmmn,你要不加精,偶就suicide -f! |