Crear Mirror del Sistema Operativo Solaris
Primero Copiar la tabla de particiones
prtvtoc /dev/rdsk/c0t0d0s2 > vtoc.c0t0d0s2
fmthard -s vtoc.c0t0d0s2 /dev/rdsk/c0t1d0s2
Añadir dos copias de la base de datos en el slide 7
metadb -a -f -c 2 c0t0d0s7 c0t1d0s7
output of metadb:
flags first blk block count
a m p luo 16 1034 /dev/dsk/c0t0d0s7
a p luo 1050 1034 /dev/dsk/c0t0d0s7
a p luo 16 1034 /dev/dsk/c0t1d0s7
a p luo 1050 1034 /dev/dsk/c0t1d0s7
Mapa de metadevice
###
### metadevice mapping to physical devices
### disk in tag 0 and 1 (9 gigs) pair
###
### orig new mirror
### root d0 submirrors: d10 d20 : c0t0d0s0 c0t1d0s0
### swap d1 submirrors: d11 d21 : c0t0d0s1 c0t1d0s1
### usr d4 submirrors: d14 d24 : c0t0d0s4 c0t1d0s4
### var d5 submirrors: d15 d25 : c0t0d0s5 c0t1d0s5
### u01 d6 submirrors: d16 d26 : c0t0d0s6 c0t1d0s6
###
# Crear los discos que van a ser replicas del sistema operativo
# boot disk c0t0 ::
metainit -f d10 1 1 c0t0d0s0 # init submirror of /
metainit -f d11 1 1 c0t0d0s1 # swap
metainit -f d14 1 1 c0t0d0s4 # /usr
metainit -f d15 1 1 c0t0d0s5 # /var
metainit -f d16 1 1 c0t0d0s6 # /oracle/u01
Crear los mirror del sistema operativo
metainit d0 -m d10 # mountable /
metainit d1 -m d11 # usable swap
metainit d4 -m d14 # mountable /usr
metainit d5 -m d15 # mountable /var
metainit d6 -m d16 # mountable /u01
Ejecuta el commando metaroot que actualiza la el /etc/vfstab y /etc/system
metaroot d0 # activate SVM for boot partition,
# add one entry to vfstab for /
# update /etc/system, etc
Actualizar el /etc/vfstab:
vi /etc/vfstab # update mount device to use /dev/md/... ::
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/md/d1 - - swap - no -
/dev/dsk/md/d0 /dev/rdsk/md/d0 / ufs 1 no logging
/dev/dsk/md/d4 /dev/rdsk/md/d4 /usr ufs 1 no logging
/dev/dsk/md/d5 /dev/rdsk/md/d5 /var ufs 1 no logging
/dev/dsk/md/d6 /dev/rdsk/md/d6 /u01 ufs 1 no logging
...
swap - /tmp tmpfs - yes -
(double check path is /dev/*dsk/md/...
Sincronizar los fs y reboot
sync; sync; # optional, flush all data to disk
lockfs -fa # lock fs, recommended
reboot
Crear los segundos submirror
# create the additional submirror components of all slides, use disk in c0t1
metainit -f d20 1 1 c0t1d0s0 # addtional mirror of /
metainit -f d21 1 1 c0t1d0s1 # additiional mirror for swap
metainit -f d24 1 1 c0t1d0s4 # additiional mirror for /usr
metainit -f d25 1 1 c0t1d0s5 # additiional mirror for /var
metainit -f d26 1 1 c0t1d0s6 # additiional mirror for /u01
Añadir los segundos submirror
# add the additional mirrors to be active:
metattach d0 d20 # activate mirror of / with new slide from d20
metattach d1 d21 # activate mirror of swap
metattach d4 d24 # activate mirror of /usr
metattach d5 d25 # activate mirror of /var
metattach d6 d26 # activate mirror of /u01
Validar con el metastat el estado del proceso de sincronización
# the above cmd return right away, use metastat to monitor sync process
# or metatool for gui monitor/admin tool.
# review /etc/lvm/md.tab
output of metastat -p:
d0 -m d10 d20 1
d10 1 1 c0t0d0s0
d20 1 1 c0t1d0s0
d1 -m d11 d21 1
d11 1 1 c0t0d0s1
d21 1 1 c0t1d0s1
d4 -m d14 d24 1
d14 1 1 c0t0d0s4
d24 1 1 c0t1d0s4
d5 -m d15 d25 1
d15 1 1 c0t0d0s5
d25 1 1 c0t1d0s5
d6 -m d16 d26 1
d16 1 1 c0t0d0s6
d26 1 1 c0t1d0s6
Boot de neuvo para validar estabilidad
When all done, reboot again just to be sure all is okay.
These errors from boot are ok:
Boot device: disk:a File and args:
SunOS Release 5.8 Version Generic_108528-16 64-bit
Copyright 1983-2001 Sun Microsystems, Inc. All rights reserved.
WARNING: forceload of misc/md_trans failed
WARNING: forceload of misc/md_raid failed
WARNING: forceload of misc/md_hotspares failed
WARNING: forceload of misc/md_sp failed
configuring IPv4 interfaces: hme0.
Hostname: cqdb
The system is coming up. Please wait.
checking ufs filesystems
/dev/md/rdsk/d6: is logging.
[...]
volume management starting.
The system is ready.
If these errors are annoying, update /etc/system and comment out the
forceload of the unecessary components. The problem with such mods is that
should there be a need of raid 5 device down the road, and forget to re-enable
these, then there maybe some hair pulling in finding out the error :)
----
Actualizar el OBP para que busque los dos submirror en caso de fallas:
Optional update to OBP to allow easier booting,
should one of the boot disk fail, this allows one to do:
boot rootmirror
Save the following content to a file, eg nvramrc.cmd
devalias rootdisk /pci@1f,4000/scsi@3/disk@0,0:a
devalias rootmirror /pci@1f,4000/scsi@3/disk@1,0:a
eeprom "boot-device=rootdisk rootmirror"
eeprom "use-nvramrc?=true"
eeprom "nvramrc=`cat nvramrc.cmd`"
eeprom boot-device # read back programmed content
eeprom nvramrc
Completado.
0 Response to Crear Mirror del Sistema Operativo Solaris
Publicar un comentario