Disk Mirroring with Veritas

Mirroring a disk:

Removing a disk from mirroring

Go into Veritas E.A. for the server you want to modify.
Expand the Server name
Expand Disk Groups
Select rootdg
On the right portion of the screen, click the Volumes tab
Right click on opt/rootvol/etc.. Mirrors, Remove
From there, select Remove mirrors by “quantity/disk”.
Select the mirror you want to remove and remove it. Do the same for opt/rootvol/swap/var/etc.

Go to the Disks tab and select the disk you wish to remove.
Right click on the disk and select remove from group.

Go into vxdiskadm and option 11.
Select the disk you wish to disable follow the instructions.

Adding a disk

bash-2.03# 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: 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 may
also be added to a disk group as spares. Or they may be added as
nohotuses to be excluded from hot-relocation use. The selected
disks may 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 (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

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

DEVICE DISK GROUP STATUS
c0t0d0 – – offline
c0t1d0 rootdg02 rootdg online nohotuse
c0t2d0 appdg01 appdg online nohotuse
c0t3d0 appdg02 appdg online nohotuse

Select disk devices to add: [,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, 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 [,none,list,q,?] (default: rootdg)

Use a default disk name for the disk? [y,n,q,?] (default: y)

Add disk as a spare disk for rootdg? [y,n,q,?] (default: n)

Exclude disk from hot-relocation use? [y,n,q,?] (default: n) y
The selected disks will be added to the disk group rootdg
with default disk names. They will be marked as nohotuses
and excluded from hot-relocation use.

c0t0d0

Continue with operation? [y,n,q,?] (default: y)
Access is disabled for the following disk.
Output format: [Device_Name]

c0t0d0

Enable access for this device? [y,n,q,?] (default: y)
The following disk device has a valid VTOC, but does not appear to have
been initialized for the Volume Manager. If there is data on the disk
that should NOT be destroyed you should encapsulate the existing disk
partitions as volumes instead of adding the disk as a new disk.
Output format: [Device_Name]

c0t0d0

Encapsulate this device? [y,n,q,?] (default: y) n

c0t0d0

Instead of encapsulating, initialize? [y,n,q,?] (default: n) y
Initializing device c0t0d0.

When selecting the format for the disk, keep in mind that a CDS disk
cannot contain a subdisk for a ‘root’ or ‘swap’ volume, so it cannot
be used for mirroring, evacuating, or sparing the boot disk.

Enter the desired format
[cdsdisk,sliced,simple,q,?] (default: cdsdisk) sliced

Enter desired private region length
[,q,?] (default: 2048)
VxVM NOTICE V-5-2-88
Adding disk device c0t0d0 to disk group rootdg with disk
name rootdg01.
VxVM INFO V-5-2-927 Excluding disk rootdg01 in disk group rootdg from hot-rel ocation use.

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 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 c0t0d0s2 auto 20095 286657920 NOHOTUSE
dm rootdg02 c0t1d0s2 auto 20351 286678272 NOHOTUSE

Disk group: appdg

DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE

dm appdg01 c0t2d0s2 auto 20095 286657920 NOHOTUSE
dm appdg02 c0t3d0s2 auto 20095 286657920 NOHOTUSE

Enter disk name [,list,q,?] rootdg02
You can choose to mirror volumes from disk rootdg02 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 [,list,q,?] (default: any) rootdg01
The requested operation is to mirror all volumes on disk rootdg02
in disk group rootdg onto available disk space on disk rootdg01.
VxVM NOTICE V-5-2-3650 This operation can take a long time to complete.

Continue with operation? [y,n,q,?] (default: y) y

Solaris – useful commands.

##
/usr/platform/`uname -i`/sbin/scadm help (can reset console)
prtdiag
prtconf
##
to find cdrom on solaris:

ls -al /dev/sr* |awk ‘{print “/” $11}’
##————————————————-
##
## FIND commands
## To find a specific file:
find / -name -type f
## To find files of a certain size and list them, with sizes:
find `directory’ -size +1024k -exec du -h {} \;
##
##
##
If a disk is failed in veritas:

/usr/lib/vxvm/bin/vxreattach (failed drive) c1t3d0
vxvol -fg appdg start (failed filesystem) admin1
fsck -o full /admin1
#
##then mount the drives
##
##
to route something through a specific nic (legato in this case)

route -p add 10.55.170.0/24 10.250.251.1 -ifp e1000g2
##