Servicios

Web hosting
Ver »
Páginas Web
Ver »
Soporte UNIX
Ver »
UNIX TIPS
Ver »

MIRROR THE SYSTEM DISK PARTITIONS
USING SOLSTICE DISK SUITE ( VOLUMEN MANAGER )

Slices y size del disco root

d0 c0t0d0s0    3 GB             /
d1 c0t0d0s1    6 GB             /tmp (SWAP)
d2 c0t0d0s3    8 GB             /usr
d3 c0t0d0s4    10 GB           /var
d4 c0t0d0s5    20 GB           /export/home
d5 c0t0d0s6    21.24 GB       /intercia
     c0t0d0s7    104.34 MB    Disk Suite

El segundo disk debe estar particionado identicamente al primer disk, cada slice
y el disk del mismo tamaño que el root disk.

#prtvtoc /dev/rdsk/c0t0d0s2 >/var/tmp/ c0t0d0   #Guardar la imagen del label root disk.
#fmthard -s /var/tmp/c0t0d0 > /dev/rdsk/c0t1d0s2 #Aplicar el label al segundo disk.

# O se puede hacer en en un solo paso.
prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2

1. Crear por lo menos 3 dbreplicas en un slice que no este usado, en cada drive.

#metadb -a -f -c 3 c0t0d0s7 c0t1d0s7

2. Para cada slice hay que crear 3 nuevos metadevices:
   - uno para el slice existente
   - uno para el slice en el disk espejeado
   - uno para el mirror.
  
   Almacena esta inf en el file /etc/lvm/md.tab sin espacios entre lineas
   
d10 1 1 /dev/dsk/c0t0d0s0
d20 1 1 /dev/dsk/c0t1d0s0
d0 -m d10

d11 1 1 /dev/dsk/c0t0d0s1
d21 1 1 /dev/dsk/c0t1d0s1
d1 -m d11

d12 1 1 /dev/dsk/c0t0d0s3
d22 1 1 /dev/dsk/c0t1d0s3
d2 -m d12

d13 1 1 /dev/dsk/c0t0d0s4
d23 1 1 /dev/dsk/c0t1d0s4
d3 -m d13

d14 1 1 /dev/dsk/c0t0d0s5
d24 1 1 /dev/dsk/c0t1d0s5
d4 -m d14

d15 1 1 /dev/dsk/c0t0d0s6
d25 1 1 /dev/dsk/c0t1d0s6
d5 -m d15

-------End File --------

Ejecutar el metainit comando para crear los metadevices definidos en el file
md.tab usando la opcion -a, se crean todos los metadevices definidos previamente.

# metainit -a -f  # La opcion -f es necesaria pq los slices estan montados.

3. Modificar el file /etc/vfstab para reflejar los metadevices, hacer antes backup del file.

# cp /etc/vfstab /etc/vfstab.orig

# metaroot d0  

# vi vfstab         #Se muestra como hacerlo con swap, hacer para cada slice al correspondiente
                    # mirror.Para el slice root se hace con el comando metaroot que actualiza
                    # este file automaticamente.
                     
  /dev/dsk/c0t0d0s1    -    -    swap   ; - no    -

a
 /dev/md/dsk/d1            -    -    swap   ; - no    -  # Para no confundirse Veamoos como
                                                                  # como se asigno esto a c/slice.
---------------
EJEMPLO:

d0 c0t0d0s0    3 GB    /
d1 c0t0d0s1    6 GB    /tmp (SWAP)
d2 c0t0d0s3    8 GB    /usr
d3 c0t0d0s4    10 GB    /var
d4 c0t0d0s5    20 GB    /export/home
d5 c0t0d0s6    21.24 GB    /intercia
   c0t0d0s7    104.34 MB    Disk Suite
---------------
 
5. Bloquear los filesystems antes de rebootear.

#lockfs -fa  

6. #Necesario reboot sino se pueden corromper datos.

7. Verificar la nva configuracion, como salida veremos metadevices no slices.

# df -k
# swap -l

8. Asignar el dump device al correcto device.

# dumpadm -d swap

  Verificamos el dump device si fue setado correctamente.
#dumpadm

9.  Por Ultimo attachar el segundo submirro a el metamirror device, para cada particion
  del disk

# metattach d1 d21
d1: submirror d21 is attached

# metattach d2 d22
d2: submirror d22 is attached

# metattach d3 d23
d3: submirror d23 is attached

# metattach d4 d24
d4: submirror d24 is attached

# metattach d5 d25
d5: submirror d25 is attached

Verificamos la syncronizacion de datos de un disk al otro. Al terminar syncronizacion
el root disk ha sido espejeado (mirrored).

# metastat | grep Resync
      State: Resyncing
    Resync in progress: 0 % done
    State: Resyncing
      State: Resyncing
    Resync in progress: 0 % done
    State: Resyncing
      State: Resyncing
    Resync in progress: 1 % done
    State: Resyncing
      State: Resyncing
    Resync in progress: 2 % done
    State: Resyncing
      State: Resyncing
    Resync in progress: 17 % done
    State: Resyncing
      State: Resyncing
    Resync in progress: 0 % done
    State: Resyncing

---------------- DESATACHAR UN SUBMIRROR ------------------------------------------
Ejemplo:

d13 -m d3 d8 1  <===  Mirror
d3 1 1 c0t0d0s4 <===  Submirror 0  ESTE NECESITA MANTENIMIENTO
d8 1 1 c0t1d0s4 <===  Submirror 1

Desatachar el Metadevice (Submirror d3)
metadetach -f d13 d3   
 
Eliminar Activos Metadevices y Hot Spare Pools  
metaclear  d3

Crear el Submirror Nuevamente
metainit   d3 1 1 c0t0d0s4

Atachar el Submiror d3 al Mirror d13
metattach  d13 d3

Validar la Syncronizacion
metastat   |  grep -i sync


--------------- CONCATENAR UN FILESYSTEMS ---------------

# metadb -a -f -c3 c0t2d0s7

# metadb
flags first blk block count a u 16 8192 /dev/dsk/c0t2d0s7
a u 8208 8192 /dev/dsk/c0t2d0s7
a u 16400 8192 /dev/dsk/c0t2d0s7

# metainit d100 2 1 /dev/dsk/c0t0d0s4 1 /dev/dsk/c0t2d0s0
d100: Concat/Stripe is setup

# metastat -p
d100 2 1 c0t0d0s4 \
1 c0t2d0s0

# metastat
d100: Concat/Stripe
Size: 156055920 blocks (74 GB)
Stripe 0:
Device Start Block Dbase Reloc
c0t0d0s4 0 No Yes
Stripe 1:
Device Start Block Dbase Reloc
c0t2d0s0 4080 No Yes

Regresar


Random TIPS

Removing "Drive Not Available" from Solaris

These are steps I followed to remove the LUNS which were unmasked from the system.
Removing the Unused/Unmasked LUNS from Solaris.

1. First Step is identifying the from Format o/p.
2. Remove them from Volume Manager. In my case, they are veritas. so I used vxdisk rm
3. look at the cfgadm -al o/p to find the disks which are failing. they are failing because they are unmasked from this system and still OS sees them.
c3::50060482d53135b8,84 disk connected configured failing
c3::50060482d53135b8,86 disk connected configured failing
c3::50060482d53135b8,87 disk connected configured failing
3. luxadm -e offline /dev/rdsk/ # This will kick the device from failing to unusable. and also removes them from format o/p.
4. cfgadm -o unusable_FCP_dev -c unconfigure c3::50060482d53135b8
# This will remove all unusable LUNS from system for particular controller and target id. don't worry there might be some working devices on that target. This command won't affect them. they'll be in working state only.
5. clean the device files using devfsadm -Cv
6. You should be clear now in both format and cfgadm -al.

free counters