Friday, June 11, 2010

Veritas encapsulated partition

If look into dictionary, encapsulate is mean like below.

encapsulate
enclose in a capsule or other small container

Usually, when Veritas filesystem installated into the system. We will change the current normal UNIX filesystem with Veritas. What we will do is excapsulated current partition and then mirror it.

*** Current view of standard UNIX filesystem in /etc/vfstab ***

/dev/dsk/c1t0d0s1 - - swap - no -
/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 / ufs 1 no
-
/dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /var ufs 1 no



1. Run command vxdiskadm to start the disk encapsulate

# 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 spare for a disk group
13 Turn off the spare flag on a disk
14 Unrelocate subdisks back to a disk
15 Exclude a disk from hot-relocation use
16 Make a disk available for hot-relocation use
17 Prevent multipathing/Suppress devices from VxVM's view
18 Allow multipathing/Unsuppress devices from VxVM's view
19 List currently suppressed/non-multipathed devices
20 Change the disk naming scheme
21 Get the newly connected/zoned disks in VxVM view
22 Change/Display the default disk layouts
23 Mark a disk as allocator-reserved for a disk group
24 Turn off the allocator-reserved 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 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 (in the c#t#d# naming scheme)
xyz_0 : a single disk (in the enclosure based naming scheme)
xyz_ : all disks on the enclosure whose name is xyz



2. It is better to list the current disk available. Standard UNIX filesystem disk in Solaris are c1t0d0 or you can refer to /etc/vfstab to confirm.

Select disk devices to encapsulate:
[,all,list,q,?] list

DEVICE DISK GROUP STATUS
c1t0d0 - - online invalid
c1t1d0 - - online invalid

Select disk devices to encapsulate:
[,all,list,q,?] c1t0d0
Here is the disk selected. Output format: [Device_Name]

c1t0d0

Continue operation? [y,n,q,?] (default: 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.



3. Usually, we will put "rootdg" disk group name for primary.

Which disk group [,list,q,?] (default: rootdg)
There is no active disk group named rootdg.

Create a new group named rootdg? [y,n,q,?] (default: y)

Use a default disk name for the disk? [y,n,q,?] (default: y)
A new disk group will be created named rootdg and the selected
disks will be encapsulated and added to this disk group with
default disk names.

c1t0d0

Continue with operation? [y,n,q,?] (default: y)
The following disk has been selected for encapsulation.
Output format: [Device_Name]

c1t0d0

Continue with encapsulation? [y,n,q,?] (default: y)
A new disk group rootdg will be created and the disk device c1t0d0 will
be encapsulated and added to the disk group with the disk name rootdg01.

Enter desired private region length
[,q,?] (default: 2048)
VxVM vxencap INFO V-5-2-0 Updating /etc/vfstab ...
The c1t0d0 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)

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 spare for a disk group
13 Turn off the spare flag on a disk
14 Unrelocate subdisks back to a disk
15 Exclude a disk from hot-relocation use
16 Make a disk available for hot-relocation use
17 Prevent multipathing/Suppress devices from VxVM's view
18 Allow multipathing/Unsuppress devices from VxVM's view
19 List currently suppressed/non-multipathed devices
20 Change the disk naming scheme
21 Get the newly connected/zoned disks in VxVM view
22 Change/Display the default disk layouts
23 Mark a disk as allocator-reserved for a disk group
24 Turn off the allocator-reserved 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

Goodbye.



4. As instructed, we need to reboot the server with below command. This reboot process will be happen twice or more as it will configure the changing.

# shutdown -g0 -y -i6



5. After server is up, you will see that rootdg diskgroup are created and from vxprint, you can see its volume.

# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:sliced rootdg01 rootdg online
c1t1d0s2 auto:none - - online invalid

# vxprint -htg rootdg
DG NAME NCONFIG NLOG MINORS GROUP-ID
ST NAME STATE DM_CNT SPARE_CNT APPVOL_CNT
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK
CO NAME CACHEVOL KSTATE STATE
VT NAME NVOLUME KSTATE STATE
V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO

dg rootdg default default 44000 1176279616.6.ouxs56db

dm rootdg01 c1t0d0s2 auto 20351 143328960 -

v rootvol - ENABLED ACTIVE 20972736 ROUND - root
pl rootvol-01 rootvol ENABLED ACTIVE 20972736 CONCAT - RW
sd rootdg01-02 rootvol-01 rootdg01 4202687 20972736 0 c1t0d0 ENA

v swapvol - ENABLED ACTIVE 4202688 ROUND - swap
pl swapvol-01 swapvol ENABLED ACTIVE 4202688 CONCAT - RW
sd rootdg01-B0 swapvol-01 rootdg01 143328959 1 0 c1t0d0 ENA
sd rootdg01-01 swapvol-01 rootdg01 0 4202687 1 c1t0d0 ENA

v var - ENABLED ACTIVE 8395200 ROUND - fsgen
pl var-01 var ENABLED ACTIVE 8395200 CONCAT - RW
sd rootdg01-03 var-01 rootdg01 25175423 8395200 0 c1t0d0 ENA



6. Create mirror disk. Before we mirror the disk, we need to format new disk to veritas format and add it into diskgroup.

# vxdisksetup -i c1t1d0

# vxdg -g rootdg adddisk rootmirr=c1t1d0

# vxdisk list

c1t0d0s2 auto:sliced rootdg01 rootdg online
c1t1d0s2 auto:sliced rootmirr rootdg online



7. Run command vxdiskadm to start the disk mirror

# 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 spare for a disk group
13 Turn off the spare flag on a disk
14 Unrelocate subdisks back to a disk
15 Exclude a disk from hot-relocation use
16 Make a disk available for hot-relocation use
17 Prevent multipathing/Suppress devices from VxVM's view
18 Allow multipathing/Unsuppress devices from VxVM's view
19 List currently suppressed/non-multipathed devices
20 Change the disk naming scheme
21 Get the newly connected/zoned disks in VxVM view
22 Change/Display the default disk layouts
23 Mark a disk as allocator-reserved for a disk group
24 Turn off the allocator-reserved 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 [,list,q,?] list

Disk group: rootdg

DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE

dm rootdg01 c1t0d0s2 auto 20351 143328960 -
dm rootmirr c1t1d0s2 auto 2048 143347008 -



8. Put the source disk. It is the primary or in here it is a rootdg01

Enter disk name [,list,q,?] rootdg01
You can choose to mirror volumes from disk rootdg01 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".



9. Put the destination disk. It is the rootmirr

Enter destination disk [,list,q,?] (default: any) rootmirr
The requested operation is to mirror all volumes on disk rootdg01
in disk group rootdg onto available disk space on disk rootmirr.
VxVM NOTICE V-5-2-3650 This operation can take a long time to complete.

Continue with operation? [y,n,q,?] (default: y)
VxVM vxmirror INFO V-5-2-22 Mirror volume swapvol ...
VxVM vxmirror INFO V-5-2-22 Mirror volume rootvol ...
VxVM vxmirror INFO V-5-2-22 Mirror volume var ...
VxVM INFO V-5-2-674 Mirroring of disk rootdg01 is complete.

Mirror volumes on another disk? [y,n,q,?] (default: 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 spare for a disk group
13 Turn off the spare flag on a disk
14 Unrelocate subdisks back to a disk
15 Exclude a disk from hot-relocation use
16 Make a disk available for hot-relocation use
17 Prevent multipathing/Suppress devices from VxVM's view
18 Allow multipathing/Unsuppress devices from VxVM's view
19 List currently suppressed/non-multipathed devices
20 Change the disk naming scheme
21 Get the newly connected/zoned disks in VxVM view
22 Change/Display the default disk layouts
23 Mark a disk as allocator-reserved for a disk group
24 Turn off the allocator-reserved 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

Goodbye.



*** The new look in /etc/vfstab. You can compare with the standard UNIX filesystem in /etc/vfstab at above ***

/dev/vx/dsk/bootdg/swapvol - - swap - no nologging
/dev/vx/dsk/bootdg/rootvol /dev/vx/rdsk/bootdg/rootvol / ufs 1 no nologging
/dev/vx/dsk/bootdg/var /dev/vx/rdsk/bootdg/var /var ufs 1 no nologging
#NOTE: volume rootvol () encapsulated partition c1t0d0s0
#NOTE: volume swapvol () encapsulated partition c1t0d0s1
#NOTE: volume var () encapsulated partition c1t0d0s6



10. Run vxprint -htg rootdg to see the volume. If you compare with above vxprint before we do the mirror. There will be only 1 plexe for each volomes. Now, we can see there 2 plexes for each volume - that mean volume are mirrored successfully.

ouxs54qt:/uhome/fhizarul# vxprint -htg rootdg

DG NAME NCONFIG NLOG MINORS GROUP-ID
ST NAME STATE DM_CNT SPARE_CNT APPVOL_CNT
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK
CO NAME CACHEVOL KSTATE STATE
VT NAME NVOLUME KSTATE STATE
V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO

dg rootdg default default 44000 1176279616.6.ouxs56db

dm rootdg01 c1t0d0s2 auto 20351 143328960 -
dm rootmirr c1t1d0s2 auto 20351 143328960 -

v rootvol - ENABLED ACTIVE 20972736 ROUND - root
pl rootvol-01 rootvol ENABLED ACTIVE 20972736 CONCAT - RW
sd rootdg01-02 rootvol-01 rootdg01 4202687 20972736 0 c1t0d0 ENA
pl rootvol-02 rootvol ENABLED ACTIVE 20972736 CONCAT - RW
sd rootmirr-02 rootvol-02 rootmirr 4202688 20972736 0 c1t1d0 ENA

v swapvol - ENABLED ACTIVE 4202688 ROUND - swap
pl swapvol-01 swapvol ENABLED ACTIVE 4202688 CONCAT - RW
sd rootdg01-B0 swapvol-01 rootdg01 143328959 1 0 c1t0d0 ENA
sd rootdg01-01 swapvol-01 rootdg01 0 4202687 1 c1t0d0 ENA
pl swapvol-02 swapvol ENABLED ACTIVE 4202688 CONCAT - RW
sd rootmirr-01 swapvol-02 rootmirr 0 4202688 0 c1t1d0 ENA

v var - ENABLED ACTIVE 8395200 ROUND - fsgen
pl var-01 var ENABLED ACTIVE 8395200 CONCAT - RW
sd rootdg01-03 var-01 rootdg01 25175423 8395200 0 c1t0d0 ENA
pl var-02 var ENABLED ACTIVE 8395200 CONCAT - RW
sd rootmirr-03 var-02 rootmirr 25175424 8395200 0 c1t1d0 ENA



These encapsulated steps are same in HPUX, Solaris, AIX and Linux.

No comments: