jueves, 31 de diciembre de 2009

Feliz año nuevo

Que el 2010 sea un año lleno de éxitos para todos!!!

viernes, 11 de diciembre de 2009

Jugando con un Garmin Oregon 550

Este resumen no está disponible. Haz clic en este enlace para ver la entrada.

lunes, 7 de diciembre de 2009

Reescaneo de tapes

Hay un servidor Solaris 10 el cual el cual tiene un nivel de parches bajo y por cuestiones con el proveedor no se puede actualizar. Cuando se reinicia una librería de tapes conectada por HBA, deja de ver los tapes y no se pueden hacer backups.
El procedimiento que se realiza para corregir esto es el siguiente:

Se listan los dispositivos y se ve que están en estado "failed":

[root@solaris10]:/>cfgadm -al
Ap_Id Type Receptacle Occupant Condition
N0.IB6 PCI-X_I/O_B connected configured ok
N0.IB6::pci0 io connected configured ok
N0.IB6::pci1 io connected configured ok
N0.IB6::pci2 io connected configured ok
N0.IB6::pci3 io connected configured ok
N0.SB0 CPU_V3 connected configured ok
N0.SB0::cpu0 cpu connected configured ok
N0.SB0::cpu1 cpu connected configured ok
N0.SB0::cpu2 cpu connected configured ok
N0.SB0::cpu3 cpu connected configured ok
N0.SB0::memory memory connected configured ok
N0.SB2 CPU_V3 connected configured ok
N0.SB2::cpu0 cpu connected configured ok
N0.SB2::cpu1 cpu connected configured ok
N0.SB2::cpu2 cpu connected configured ok
N0.SB2::cpu3 cpu connected configured ok
N0.SB2::memory memory connected configured ok
N0.SB4 unknown empty unconfigured unknown
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 CD-ROM connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t0d0 disk connected configured unknown
c1::dsk/c1t1d0 disk connected configured unknown
c1::rmt/0 tape connected configured unknown
c2 scsi-bus connected unconfigured unknown
c3 fc-fabric connected configured unknown
c3::50060e8004eabf20 disk connected configured unknown
c4 fc-fabric connected configured unknown
c4::100000e00222e5d7 unknown connected unconfigured unknown
c4::100000e00222fdad unavailable connected configured failed
c4::100000e00222fe25 unavailable connected configured failed
c4::100000e002233d02 unavailable connected configured failed
c4::100000e002233f76 unavailable connected configured failed
c4::100000e002234b9f unavailable connected configured failed
c4::100000e00242fdad unavailable connected configured failed
c4::100000e00242fe25 unavailable connected configured failed
c4::100000e002433d02 unavailable connected configured failed
c4::100000e002433f76 unavailable connected configured failed
c4::100000e002434b9f unavailable connected configured failed
c5 fc-fabric connected configured unknown
c5::50060e8004eabf70 disk connected configured unknown
c6 fc connected unconfigured unknown
[root@solaris10]:/>

Se hace un reescaneo de dispositivos, borrando los que ya no ve:

[root@solaris10]:/>devfsadm -Cv
devfsadm[22389]: verbose: removing file: /dev/rmt/1
devfsadm[22389]: verbose: removing file: /dev/rmt/1n
devfsadm[22389]: verbose: removing file: /dev/rmt/1b
devfsadm[22389]: verbose: removing file: /dev/rmt/1bn
devfsadm[22389]: verbose: removing file: /dev/rmt/1l
devfsadm[22389]: verbose: removing file: /dev/rmt/1m
.
.
.

El administrador de los switch de SAN borra la zona de la librería y se vuelve a escanear dispositivos en el servidor:

[root@solaris10]:/>devfsadm -Cv
[root@solaris10]:/>cfgadm -al
Ap_Id Type Receptacle Occupant Condition
N0.IB6 PCI-X_I/O_B connected configured ok
N0.IB6::pci0 io connected configured ok
N0.IB6::pci1 io connected configured ok
N0.IB6::pci2 io connected configured ok
N0.IB6::pci3 io connected configured ok
N0.SB0 CPU_V3 connected configured ok
N0.SB0::cpu0 cpu connected configured ok
N0.SB0::cpu1 cpu connected configured ok
N0.SB0::cpu2 cpu connected configured ok
N0.SB0::cpu3 cpu connected configured ok
N0.SB0::memory memory connected configured ok
N0.SB2 CPU_V3 connected configured ok
N0.SB2::cpu0 cpu connected configured ok
N0.SB2::cpu1 cpu connected configured ok
N0.SB2::cpu2 cpu connected configured ok
N0.SB2::cpu3 cpu connected configured ok
N0.SB2::memory memory connected configured ok
N0.SB4 unknown empty unconfigured unknown
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 CD-ROM connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t0d0 disk connected configured unknown
c1::dsk/c1t1d0 disk connected configured unknown
c1::rmt/0 tape connected configured unknown
c2 scsi-bus connected unconfigured unknown
c3 fc-fabric connected configured unknown
c3::50060e8004eabf20 disk connected configured unknown
c4 fc-fabric connected configured unknown
c4::100000e00222fe25 tape connected configured unusable
c4::100000e002233d02 tape connected configured unusable
c4::100000e002233f76 tape connected configured unusable
c4::100000e002234b9f tape connected configured unusable
c4::100000e00242fdad tape connected configured unusable
c4::100000e00242fe25 tape connected configured unusable
c4::100000e002433d02 tape connected configured unusable
c4::100000e002433f76 tape connected configured unusable
c4::100000e002434b9f tape connected configured unusable
c5 fc-fabric connected configured unknown
c5::50060e8004eabf70 disk connected configured unknown
c6 fc connected unconfigured unknown
[root@solaris10]:/>


Ya aparecen en estado "unusable", ahora el administrador de SAN vuelve a presentar la zona de la librería, se reescanea y se vuelven a listar:

[root@solaris10]:/>devfsadm -Cv
[root@solaris10]:/>cfgadm -al
Ap_Id Type Receptacle Occupant Condition
N0.IB6 PCI-X_I/O_B connected configured ok
N0.IB6::pci0 io connected configured ok
N0.IB6::pci1 io connected configured ok
N0.IB6::pci2 io connected configured ok
N0.IB6::pci3 io connected configured ok
N0.SB0 CPU_V3 connected configured ok
N0.SB0::cpu0 cpu connected configured ok
N0.SB0::cpu1 cpu connected configured ok
N0.SB0::cpu2 cpu connected configured ok
N0.SB0::cpu3 cpu connected configured ok
N0.SB0::memory memory connected configured ok
N0.SB2 CPU_V3 connected configured ok
N0.SB2::cpu0 cpu connected configured ok
N0.SB2::cpu1 cpu connected configured ok
N0.SB2::cpu2 cpu connected configured ok
N0.SB2::cpu3 cpu connected configured ok
N0.SB2::memory memory connected configured ok
N0.SB4 unknown empty unconfigured unknown
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 CD-ROM connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t0d0 disk connected configured unknown
c1::dsk/c1t1d0 disk connected configured unknown
c1::rmt/0 tape connected configured unknown
c2 scsi-bus connected unconfigured unknown
c3 fc-fabric connected configured unknown
c3::50060e8004eabf20 disk connected configured unknown
c4 fc-fabric connected configured unknown
c4::100000e00222e5d7 unknown connected unconfigured unknown
c4::100000e00222fdad tape connected configured unknown
c4::100000e00222fe25 tape connected configured unknown
c4::100000e002233d02 tape connected configured unknown
c4::100000e002233f76 tape connected configured unknown
c4::100000e002234b9f tape connected configured unknown
c4::100000e00242fdad tape connected configured unknown
c4::100000e00242fe25 tape connected configured unknown
c4::100000e002433d02 tape connected configured unknown
c4::100000e002433f76 tape connected configured unknown
c4::100000e002434b9f tape connected configured unknown
c5 fc-fabric connected configured unknown
c5::50060e8004eabf70 disk connected configured unknown
c6 fc connected unconfigured unknown
[root@solaris10]:/>

Ahora aparecen en estado "unknown" lo que quiere decir que ya los ve bien y se pueden usar las tapes de la librería.

martes, 1 de diciembre de 2009

Encapsular un root disk en Solaris manejado por Veritas

Luego de haber desencapsulado el filesystem / para dar servicio en un servidor Solaris 10, se necesita volverlo a encapsular en Veritas para tener alta disponibilidad a través de mirror del sistema operativo.
Tenemos el filesystem raíz montado normalmente:

[root@solaris10]:/>df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s0 75083863 46475285 27857740 63% /


Los discos con el sistema operativo y el que va a ser el mirror ya los detecta Veritas:

[root@solaris10]:/>vxdisk list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:sliced - - online
c1t1d0s2 auto:sliced - - online
[root@solaris10]:/>


Pero como este disco ya estaba encapsulado antes, tiene datos de Veritas que pueden causar problemas, por eso lo mejor es quitar el disco del control de Veritas y borrar las particiones, dejando solo las de sistema operativo (0, 1 y 2):

[root@solaris10]:/>vxdisk rm c1t0d0s2
[root@solaris10]:/>format c1t0d0s2
selecting c1t0d0s2
[disk formatted]
Warning: Current Disk has mounted partitions.
/dev/dsk/c1t0d0s0 is currently mounted on /. Please see umount(1M).
/dev/dsk/c1t0d0s1 is in use by dump. Please see dumpadm(1M).


FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit
format> p


PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit
partition> p
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 6595 - 14086 72.71GB (7492/0/0) 152477184
1 swap wu 2 - 6594 63.98GB (6593/0/0) 134180736
2 backup wm 0 - 14086 136.71GB (14087/0/0) 286698624
3 - wu 2 - 14086 136.69GB (14085/0/0) 286657920
4 - wu 0 - 1 19.88MB (2/0/0) 40704
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

partition> 3
Part Tag Flag Cylinders Size Blocks
3 unassigned wu 2 - 14086 136.69GB (14085/0/0) 286657920

Enter partition id tag[unassigned]:
Enter partition permission flags[wu]:
Enter new starting cyl[2]: 0
Enter partition size[286657920b, 14085c, 14084e, 139969.69mb, 136.69gb]: 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 6595 - 14086 72.71GB (7492/0/0) 152477184
1 swap wu 2 - 6594 63.98GB (6593/0/0) 134180736
2 backup wm 0 - 14086 136.71GB (14087/0/0) 286698624
3 unassigned wu 0 0 (0/0/0) 0
4 unassigned wu 0 - 1 19.88MB (2/0/0) 40704
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

partition> 4
Part Tag Flag Cylinders Size Blocks
4 unassigned wu 0 - 1 19.88MB (2/0/0) 40704

Enter partition id tag[unassigned]:
Enter partition permission flags[wu]:
Enter new starting cyl[0]: 0
Enter partition size[40704b, 2c, 1e, 19.88mb, 0.02gb]: 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 6595 - 14086 72.71GB (7492/0/0) 152477184
1 swap wu 2 - 6594 63.98GB (6593/0/0) 134180736
2 backup wm 0 - 14086 136.71GB (14087/0/0) 286698624
3 unassigned wu 0 0 (0/0/0) 0
4 unassigned wu 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

partition> l
Ready to label disk, continue? y

partition> q


FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit
format> q
[root@solaris10]:/>

Ahora se hace que Veritas vuelva a escanear el disco y lo tome en control, y con vxdiskadm se crea el diskgroup rootdg indicando que c1t0d0 será el integrante. Al final solicita un reincio:

[root@solaris10]:/>vxdctl enable
[root@solaris10]:/>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

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) 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 [,list,q,?] rootdg
There is no active disk group named rootdg.

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

Use a default disk name for the disk? [y,n,q,?] (default: y) 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) y
The following disk has been selected for encapsulation.
Output format: [Device_Name]

c1t0d0

Continue with encapsulation? [y,n,q,?] (default: y) 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)
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) 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.
[root@solaris10]:/>shutdown -g0 -y -i6


Al subir la máquina comprobamos que ya existe un diskgroup rootdg cuyo integrante es el disco del sistema operativo:

[root@solaris10]:/>vxdisk list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:sliced rootdg01 rootdg online
c1t1d0s2 auto:sliced - - online
[root@solaris10]:/>

Ahora se quita del control de Veritas el disco que va a ser el mirror, se borran todas las particiones y se vuelve a adicionar al control de Veritas, debe aparecer entonces como "online" e "invalid":

[root@solaris10]:/>vxdctl enable
[root@solaris10]:/>vxdisk list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:sliced rootdg01 rootdg online
c1t1d0s2 auto:none - - online invalid
[root@solaris10]:/>


Inicializo el disco de mirror, y lo adiciono al diskgroup rootdg colocándole el nombre rootmirror:

[root@solaris10]:/>/usr/lib/vxvm/bin/vxdisksetup -i c1t1d0
[root@solaris10]:/>vxdg -g rootdg adddisk rootmirror=c1t1d0
[root@solaris10]:/>vxprint -g rootdg -ht
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 68000 1258130530.176.solaris10

dm rootdg01 c1t0d0s2 auto 40703 286657920 -
dm rootmirror c1t1d0s2 auto 2048 286696320 -

v rootvol - ENABLED ACTIVE 152477184 ROUND - root
pl rootvol-01 rootvol ENABLED ACTIVE 152477184 CONCAT - RW
sd rootdg01-01 rootvol-01 rootdg01 134180736 152477184 0 c1t0d0 ENA

v swapvol - ENABLED ACTIVE 134180736 ROUND - gen
pl swapvol-01 swapvol ENABLED ACTIVE 134180736 CONCAT - RW
sd rootdg01-02 swapvol-01 rootdg01 0 134180736 0 c1t0d0 ENA
[root@solaris10]:/>


Ahora con vxdiskadm le digo que haga mirror al disco recien adicionado:

[root@solaris10]:/>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 40703 286657920 -
dm rootmirror c1t1d0s2 auto 2048 286696320 -

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".

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

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

Mirror volumes on another disk? [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: q

Goodbye.
[root@solaris10]:/>


Verifico que en segundo plano se esté llevando a cabo el mirror:

[root@solaris10]:/>vxtask list
TASKID PTID TYPE/STATE PCT PROGRESS
161 ATCOPY/R 28.90% 0/134180736/38772736 PLXATT swapvol swapvol-02 rootdg
[root@solaris10]:/>vxtask list
TASKID PTID TYPE/STATE PCT PROGRESS
170 ATCOPY/R 01.13% 0/152477184/1726464 PLXATT rootvol rootvol-02 rootdg
[root@solaris10]:/>


Y cuando termina compruebo que los mirrors fueron hechos:

[root@solaris10]:/>vxprint -g rootdg -ht
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 68000 1258130530.176.solaris10

dm rootdg01 c1t0d0s2 auto 40703 286657920 -
dm rootmirror c1t1d0s2 auto 40703 286657920 -

v rootvol - ENABLED ACTIVE 152477184 ROUND - root
pl rootvol-01 rootvol ENABLED ACTIVE 152477184 CONCAT - RW
sd rootdg01-01 rootvol-01 rootdg01 134180736 152477184 0 c1t0d0 ENA
pl rootvol-02 rootvol ENABLED ACTIVE 152477184 CONCAT - RW
sd rootmirror-02 rootvol-02 rootmirror 134180736 152477184 0 c1t1d0 ENA

v swapvol - ENABLED ACTIVE 134180736 ROUND - gen
pl swapvol-01 swapvol ENABLED ACTIVE 134180736 CONCAT - RW
sd rootdg01-02 swapvol-01 rootdg01 0 134180736 0 c1t0d0 ENA
pl swapvol-02 swapvol ENABLED ACTIVE 134180736 CONCAT - RW
sd rootmirror-01 swapvol-02 rootmirror 0 134180736 0 c1t1d0 ENA
[root@solaris10]:/>


Con esto el sistema operativo ya tiene alta dispobilidad por mirror a través de Veritas.

Desencapsular un root disk en Solaris manejado por Veritas

Debido a que en una actividad un servidor Solaris 10 con el filesystem root encapsulado con Veritas se queda en un loop de reinicios, se necesita dar servicio y subir la máquina lo mas rápido posible. Para hacerlo hay que desencapsular los filesystems del S.O. y dejarlo iniciando por las particiones físicas. El procedimiento está en un documento de Sun, pero el cual no es de acceso público.

Para realizarlo las actividades serían las siguientes:

Si todavía no ha iniciado el sistema operativo, por consola mandar una señal de break y desde el prompt del ok indicar que inicie por cd-rom:

boot cdrom -s

Una vez que suba el sistema, configurar la consola:

TERM=vt100;export TERM

Hacer un chequeo del disco con la partición root:

fsck -y /dev/rdsk/c0t0d0s0

Montar el filesystem en un directorio:

mount /dev/dsk/c0t0d0s0 /a

Hacer un backup del archivo /a/etc/system y editarlo:

cp /a/etc/system /a/etc/system.orig
vi /a/etc/system


Quitar las siguientes líneas:

rootdev:/pseudo/vxio@0:0
set vxio:vol_rootdev_is_volume=1

Hacer una copia del vfstab y editarlo:

cp /a/etc/vfstab /a/etc/vfstab.orig
vi /a/etc/vfstab


Cambiar los paths de Veritas por los físicos, y si hay filesystems en almacenamiento externo manejado por Veritas, comentariarlos, por ejemplo, si se tiene:

/dev/vx/dsk/swapvol - - swap - no -
/dev/vx/dsk/rootvol /dev/vx/rdsk/rootvol / ufs 1 no -

/dev/vx/dsk/datadg/somevol /dev/vx/rdsk/datadg/somevol /somevol ufs 2 yes -
#NOTE: volume rootvol (/) encapsulated partition c0t0d0s0
#NOTE: volume swapvol (swap) encapsulated partition c0t0d0s1

Cambiar por:

/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -

#/dev/vx/dsk/datadg/somevol /dev/vx/rdsk/datadg/somevol /somevol ufs 2 yes -
#NOTE: volume rootvol (/) encapsulated partition c0t0d0s0
#NOTE: volume swapvol (swap) encapsulated partition c0t0d0s1


Ejecutar el siguiente comando, para que Veritas no inicie en el siguiente reinicio:

touch /a/etc/vx/reconfig.d/state.d/install-db

Quitar la bandera que le dice a Veritas que el filesystem root está encapsulado:

rm /a/etc/vx/reconfig.d/state.d/root-done

Reiniciar.
Si todo sale bien, el sistema debería subir con las particiones físicas y sin activar Veritas.
Luego que suba ejecutar:

rm /etc/vx/reconfig.d/state.d/install-db
/usr/sbin/vxiod set 10
/usr/sbin/vxconfigd -m disable
/usr/sbin/vxdctl enable


Con esto suben los servicios de Veritas, ahora hay que eliminar los volumenes del diskgroup root, se puede saber cuales son con el comando 'vxprint -htg rootdg':

/usr/sbin/vxedit -rf rm

Luego eliminar el rootdisk de rootdg que ya no tiene volúmenes:

/usr/sbin/vxdg [-g diskgroup] rmdisk

Si ya solo le queda un disco, el comando anterior va a fallar, entonces se pasa a destruir el diskgroup:

/usr/sbin/vxdg destroy

Ahora hay que reescribir las particiones a como estaba antes de encapsularlo, la forma mas fácil es con:

/etc/vx/bin/vxedvtoc -f /etc/vx/reconfig.d/disk.d/c0t0d0/vtoc /dev/rdsk/c0t0d0s2

Ya se podrían descomentariar en /etc/vfstab los filesystems en almacenamiento externo manejados por Veritas.
Para activarlos se ejecutaría:

/usr/sbin/vxvol [-g diskgroup] startall

y con mountall se montan.
Esto es todo, ya el sistema no tendría la partición / manejada por Veritas.