Procedimiento para cambiar un disco bajo SDS y RAID1

Page last edited hace 2181 días 2 horas
De Solaris-ES
Saltar a: navegación, buscar
  • Estado del mirror desde el comando metastat
# metastat d430
d430: Mirror
    Submirror 0: d431
      State: Needs maintenance
    Submirror 1: d432
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 70716942 blocks

d431: Submirror of d430
    State: Needs maintenance
    Invoke: metareplace d430 c0t1d0s0 <new device>
    Size: 70716942 blocks
    Stripe 0:
        Device     Start Block  Dbase State        Hot Spare
        c0t1d0s0          0     No    Maintenance

# metastat -p d430
d430 -m d431 d432 1
d431 1 1 c0t1d0s0
d432 1 1 c1t1d0s0
  • Estado de los discos desde el comando format
# format
AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@13c,700000/pci@1/scsi@2/sd@0,0
       1. c0t1d0 <drive type unknown>
          /pci@13c,700000/pci@1/scsi@2/sd@1,0
       2. c0t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@13c,700000/pci@1/scsi@2/sd@2,0
       3. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@15c,700000/pci@1/scsi@2/sd@0,0
       4. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@15c,700000/pci@1/scsi@2/sd@1,0
       5. c1t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@15c,700000/pci@1/scsi@2/sd@2,0
  • Verificar la particion del mirror que esta OK (c1t1d0)
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
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 24620 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0 - 24477       33.72GB    (24478/0/0) 70716942
  1 unassigned    wu       0                0         (0/0/0)  0
  2     backup    wu       0 - 24619       33.92GB    (24620/0/0) 71127180
  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   24478 - 24619      200.31MB    (142/0/0) 410238
  • Verificar si existen replicas con error
# metadb -i
        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        2084            1034 /dev/dsk/c0t0d0s7
     a    p  luo        16              1034 /dev/dsk/c1t0d0s7
     a    p  luo        1050            1034 /dev/dsk/c1t0d0s7
     a    p  luo        2084            1034 /dev/dsk/c1t0d0s7
     a    p  luo        16              1034 /dev/dsk/c1t1d0s7
     a    p  luo        1050            1034 /dev/dsk/c1t1d0s7
     a    p  luo        2084            1034 /dev/dsk/c1t1d0s7
      W   p  l          16              1034 /dev/dsk/c0t1d0s7
      W   p  l          1050            1034 /dev/dsk/c0t1d0s7
      W   p  l          2084            1034 /dev/dsk/c0t1d0s7
 o - replica active prior to last mddb configuration change
 u - replica is up to date
 l - locator for this replica was read successfully
 c - replica's location was in /etc/lvm/mddb.cf
 p - replica's location was patched in kernel
 m - replica is master, this is replica selected as input
 W - replica has device write errors
 a - replica is active, commits are occurring to this replica
 M - replica had problem with master blocks
 D - replica had problem with data blocks
 F - replica had format problems
 S - replica is too small to hold current data base
 R - replica had device read errors
  • Borrar las replicas dañadas
# metadb -d /dev/dsk/c0t1d0s7
  • Verificar el estado actual de las replicas
# metadb -i
        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        2084            1034 /dev/dsk/c0t0d0s7
     a    p  luo        16              1034 /dev/dsk/c1t0d0s7
     a    p  luo        1050            1034 /dev/dsk/c1t0d0s7
     a    p  luo        2084            1034 /dev/dsk/c1t0d0s7
     a    p  luo        16              1034 /dev/dsk/c1t1d0s7
     a    p  luo        1050            1034 /dev/dsk/c1t1d0s7
     a    p  luo        2084            1034 /dev/dsk/c1t1d0s7
 o - replica active prior to last mddb configuration change
 u - replica is up to date
 l - locator for this replica was read successfully
 c - replica's location was in /etc/lvm/mddb.cf
 p - replica's location was patched in kernel
 m - replica is master, this is replica selected as input
 W - replica has device write errors
 a - replica is active, commits are occurring to this replica
 M - replica had problem with master blocks
 D - replica had problem with data blocks
 F - replica had format problems
 S - replica is too small to hold current data base
 R - replica had device read errors
  • Reparticionar el disco con la misma distribucion que su mirror (Ver Paso 1)
  • Recrear las replicas en el nuevo disco
# metadb -a -c3 /dev/dsk/c0t1d0s7
  • Verificar el estado de las mismas
# metadb -i
         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        2084            1034 /dev/dsk/c0t0d0s7
      a    p  luo        16              1034 /dev/dsk/c1t0d0s7
      a    p  luo        1050            1034 /dev/dsk/c1t0d0s7
      a    p  luo        2084            1034 /dev/dsk/c1t0d0s7
      a    p  luo        16              1034 /dev/dsk/c1t1d0s7
      a    p  luo        1050            1034 /dev/dsk/c1t1d0s7
      a    p  luo        2084            1034 /dev/dsk/c1t1d0s7
      a        u         16              1034 /dev/dsk/c0t1d0s7
      a        u         1050            1034 /dev/dsk/c0t1d0s7
      a        u         2084            1034 /dev/dsk/c0t1d0s7
  o - replica active prior to last mddb configuration change
  u - replica is up to date
  l - locator for this replica was read successfully
  c - replica's location was in /etc/lvm/mddb.cf
  p - replica's location was patched in kernel
  m - replica is master, this is replica selected as input
  W - replica has device write errors
  a - replica is active, commits are occurring to this replica
  M - replica had problem with master blocks
  D - replica had problem with data blocks
  F - replica had format problems
  S - replica is too small to hold current data base
  R - replica had device read errors
  • Remplazar el disco dañado
# metareplace -e d430 c0t1d0s0
d430: device c0t1d0s0 is enabled
Nota: No se especifica un nuevo disco dado que se replaza el mismo disco.
  • Estado Final
# metastat -p d430
d430 -m d431 d432 1
d431 1 1 c0t1d0s0
d432 1 1 c1t1d0s0
# metastat d430
d430: Mirror
    Submirror 0: d431
      State: Okay
    Submirror 1: d432
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 70716942 blocks

d431: Submirror of d430
    State: Okay
    Size: 70716942 blocks
    Stripe 0:
        Device     Start Block  Dbase State        Hot Spare
        c0t1d0s0          0     No    Okay

d432: Submirror of d430
    State: Okay
    Size: 70716942 blocks
    Stripe 0:
        Device     Start Block  Dbase State        Hot Spare
        c1t1d0s0          0     No    Okay
# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@13c,700000/pci@1/scsi@2/sd@0,0
       1. c0t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@13c,700000/pci@1/scsi@2/sd@1,0
       2. c0t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@13c,700000/pci@1/scsi@2/sd@2,0
       3. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@15c,700000/pci@1/scsi@2/sd@0,0
       4. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@15c,700000/pci@1/scsi@2/sd@1,0
       5. c1t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@15c,700000/pci@1/scsi@2/sd@2,0

selecting c0t1d0
[disk formatted]

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
        !<cmd>     - execute <cmd>, 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
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 24620 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0 - 24477       33.72GB    (24478/0/0) 70716942
  1 unassigned    wu       0                0         (0/0/0)  0
  2     backup    wu       0 - 24619       33.92GB    (24620/0/0) 71127180
  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   24478 - 24619      200.31MB    (142/0/0) 410238