lunes, 30 de julio de 2012

Agregar disco duro nuevo a una ZONA de Solaris


DESDE LA ZONA GLOBAL

1) Chequeamos que el nuevo disco sea reconocido:

#cfgadm -al
#devfsadm

2) Notamos que hay un nuevo disco en otro bus :
# ls /dev/rdsk/*s0
/dev/rdsk/c0t0d0s0 /dev/rdsk/c1t0d0s0 /dev/rdsk/c0t60060E80104643C004F2B7EC00000023d0s0

3) Empezamos con el formateo del nuevo disco (incluyendo la creacion de particiones):
# format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@0,0/pci1000,30@10/sd@0,0
1. c0t60060E80104643C004F2B7EC00000023d0
/pci@0,0/pci1000,30@10/sd@1,0
Specify disk (enter its number):

4) Seleccionamos el disco con la opcion 1, el cual es el nuevo disco adicionado . Es posible que el disco sea preformateado en algunos casos , al tipear ENTER.

selecting c0t60060E80104643C004F2B7EC00000023d0
[disk formatted]

5) Con el comando fdisk crearemos la partición que precisemos, por defecto al tipear "y" crea un partición Solaris por default , lo cual hacemos a continuación.
#format> fdisk
No fdisk table exists. The default partition for the disk is:
a 100% “SOLARIS System” partition

Type “y” to accept the default partition, otherwise type “n” to edit the
partition table.
y

4) Entramos en el submenu del modulo format llamado partition :
format> partition

5) Imprimimos la partition existente:

partition> print
Current partition table (original):
Total disk cylinders available: 1020 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 1020 5.99GB (1021/0/0) 4182016
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 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
8 boot wu 0 – 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0

6) Seleccionamos la particion donde queremos asignar nuestro disco (tamaño total o particionado) :
partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 1
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 1019c

7) Imprimiendo la tabla de particiones de vuelta vemos los cambios hechos :

partition> print
Current partition table (unnamed):
Total disk cylinders available: 1020 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 1 – 1019 1.99GB (1019/0/0) 4173824
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 1020 1.99GB (1021/0/0) 4182016
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 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
8 boot wu 0 – 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0

8) Guardamos los cambios escribiendo label en el disco:

partition> label
Ready to label disk, continue? y

9 ) Salimos del submenu partition y del modulo format

partition> quit
format> quit
#

10 ) Creamos el sistema de archivos , en este caso UFS.

# newfs /dev/rdsk/c0t60060E80104643C004F2B7EC00000023d0s0
newfs: construct a new file system /dev/rdsk/c1t1d0s0: (y/n)? y
/dev/rdsk/c1t1d0s0: 4173824 sectors in 1019 cylinders of 128 tracks, 32 sectors
2038.0MB in 45 cyl groups (23 c/g, 46.00MB/g, 11264 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 94272, 188512, 282752, 376992, 471232, 565472, 659712, 753952, 848192,
3298432, 3392672, 3486912, 3581152, 3675392, 3769632, 3863872, 3958112,
4052352, 4146592

11 ) Verificamos que el nuevo filesystem este limpio :

# fsck /dev/rdsk/c1t1d0s0
** /dev/rdsk/c1t1d0s0
** Last Mounted on
** Phase 1 – Check Blocks and Sizes
** Phase 2 – Check Pathnames
** Phase 3a – Check Connectivity
** Phase 3b – Verify Shadows/ACLs
** Phase 4 – Check Reference Counts
** Phase 5 – Check Cylinder Groups
2 files, 9 used, 2020758 free (14 frags, 252593 blocks, 0.0% fragmentation)

OBS :Como esto lo hacemos desde la zona global , no existe la necesidad de agregar la linea del Nuevo disco en el etc/vfstab


DESDE NUESTRA ZONA

12 ) Ingresamos a la zona donde queremos agregar el nuevo disco :

zonecfg -z <nombre zona>

zonecfg:my-zone> add fs

zonecfg:my-zone:fs> set dir=/data  ----->> Directorio donde se montara el disco

zonecfg:my-zone:fs> set special=/dev/dsk/c0t60060E80104643C004F2B7EC00000023d0s0

zonecfg:my-zone:fs> set raw=/dev/rdsk/c0t60060E80104643C004F2B7EC00000023d0s0

zonecfg:my-zone:fs> set type=ufs

zonecfg:my-zone:fs> end

zonecfg:my-zone>commit

zonecfg:my-zone>exit

13) Reiniciamos la zona y después verificamos que el nuevo filesystem aparezca con df –h :

zoneadm -z my-zone reboot

No hay comentarios:

Publicar un comentario