利用Veritas对系统盘镜像及反封装

发表于:2007-05-26来源:作者:点击数: 标签:
利用Veritas对系统盘镜像及反封装 #vxdg list NAME STATE ID rootdg enabled 1115647860.1025.E250 确信系统盘盘已封装: # vxdisk list DEVICE TYPE DISK GROUP STATUS c0t0d0s2 sliced rootdisk rootdg online c0t9d0s2 sliced - - online 将c0t9d0加入到V
利用Veritas对系统盘镜像及反封装

#vxdg list
NAME         STATE           ID
rootdg       enabled  1115647860.1025.E250

确信系统盘盘已封装:
# vxdisk list
DEVICE       TYPE      DISK         GROUP        STATUS
c0t0d0s2     sliced    rootdisk     rootdg       online
c0t9d0s2     sliced    -            -            online
将c0t9d0加入到VxVm中:

# vxdiskadd c0t9d0

Add or initialize disks
Menu: VolumeManager/Disk/AddDisks

  Here is the disk selected.  Output format: [Device_Name]

  c0t9d0

Continue operation? [y,n,q,?] (default: y)

  You can choose to add this disk to an existing disk group, a
  new disk group, or leave the disk available for use by future
  add or replacement operations.  To create a new disk group,
  select a disk group name that does not yet exist.  To leave
  the disk available for future use, specify a disk group name
  of "none".

Which disk group [<group>,none,list,q,?] (default: rootdg)

Use a default disk name for the disk? [y,n,q,?] (default: y)

Add disk as a spare disk for rootdg? [y,n,q,?] (default: n)

Exclude disk from hot-relocation use? [y,n,q,?] (default: n)

  The selected disks will be added to the disk group rootdg with
  default disk names.

  c0t9d0

Continue with operation? [y,n,q,?] (default: y)

  The following disk device appears to have been initialized already.
  The disk is listed as added to a disk group, but is not currently
  active.  Output format: [Device_Name,Disk_Aclearcase/" target="_blank" >ccess_Name,Disk_Group]

  [c0t9d0,c0t9d0s2,rootdg]

Use this device? [y,n,q,?] (default: y)

  The following disk you selected for use appears to already have
  been initialized for the Volume Manager.  If you are certain the
  disk has already been initialized for the Volume Manager, then you
  do not need to reinitialize the disk device.
  Output format: [Device_Name]

  c0t9d0

Reinitialize this device? [y,n,q,?] (default: y)

  Initializing device c0t9d0.

Use a default private region length for this disk?
[y,n,q,?] (default: y)

  Adding disk device c0t9d0 to disk group rootdg with disk
  name disk01.

Goodbye.
# vxdisk list
DEVICE       TYPE      DISK         GROUP        STATUS
c0t0d0s2     sliced    rootdisk     rootdg       online
c0t9d0s2     sliced    disk01       rootdg       online

让c0t0d0与c0t9d0做镜像:

# vxmirror rootdisk disk01
! vxassist -g rootdg mirror rootvol disk01
! vxassist -g rootdg mirror swapvol disk01
! vxassist -g rootdg mirror usr disk01
! vxassist -g rootdg mirror var disk01
! vxbootsetup
# vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   162           ATCOPY/R 31.28% 0/8194168/2562832 PLXATT rootvol rootvol-02
# vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   165           ATCOPY/R 61.95% 0/4099440/2539768 PLXATT usr usr-02
# vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   167           ATCOPY/R 84.85% 0/4099440/3478448 PLXATT var var-02
# vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
# vxdisk list
DEVICE       TYPE      DISK         GROUP        STATUS
c0t0d0s2     sliced    rootdisk     rootdg       online
c0t9d0s2     sliced    disk01       rootdg       online
# vxprint
Disk group: rootdg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg rootdg       rootdg       -        -        -        -        -       -

dm disk01       c0t9d0s2     -        35363560 -        -        -       -
dm rootdisk     c0t0d0s2     -        35363560 -        -        -       -

v  rootvol      root         ENABLED  8194168  -        ACTIVE   -       -
pl rootvol-01   rootvol      ENABLED  8194168  -        ACTIVE   -       -
sd rootdisk-02  rootvol-01   ENABLED  8194168  0        -        -       -
pl rootvol-02   rootvol      ENABLED  8194168  -        ACTIVE   -       -
sd disk01-01    rootvol-02   ENABLED  8194168  0        -        -       -

v  swapvol      swap         ENABLED  2049720  -        ACTIVE   -       -
pl swapvol-01   swapvol      ENABLED  2049720  -        ACTIVE   -       -
sd rootdisk-01  swapvol-01   ENABLED  2049720  0        -        -       -
pl swapvol-02   swapvol      ENABLED  2049720  -        ACTIVE   -       -
sd disk01-02    swapvol-02   ENABLED  2049720  0        -        -       -

v  usr          fsgen        ENABLED  4099440  -        ACTIVE   -       -
pl usr-01       usr          ENABLED  4099440  -        ACTIVE   -       -
sd rootdisk-B0  usr-01       ENABLED  1        0        -        -       Block0
sd rootdisk-04  usr-01       ENABLED  4099439  1        -        -       -
pl usr-02       usr          ENABLED  4099440  -        ACTIVE   -       -
sd disk01-03    usr-02       ENABLED  4099440  0        -        -       -

v  var          fsgen        ENABLED  4099440  -        ACTIVE   -       -
pl var-01       var          ENABLED  4099440  -        ACTIVE   -       -
sd rootdisk-03  var-01       ENABLED  4099440  0        -        -       -
pl var-02       var          ENABLED  4099440  -        ACTIVE   -       -
sd disk01-04    var-02       ENABLED  4099440  0        -        -       -
#
******************************************************************************
取消mirror
# vxplex -o rm dis rootvol-02 swapvol-02 usr-02 var-02
# vxprint
Disk group: rootdg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg rootdg       rootdg       -        -        -        -        -       -

dm disk01       c0t9d0s2     -        35363560 -        -        -       -
dm disk02       c0t0d0s2     -        35363560 -        -        -       -

v  rootvol      root         ENABLED  8194168  -        ACTIVE   -       -
pl rootvol-01   rootvol      ENABLED  8194168  -        ACTIVE   -       -
sd disk02-02    rootvol-01   ENABLED  8194168  0        -        -       -

v  swapvol      swap         ENABLED  2049720  -        ACTIVE   -       -
pl swapvol-01   swapvol      ENABLED  2049720  -        ACTIVE   -       -
sd disk02-01    swapvol-01   ENABLED  2049720  0        -        -       -

v  usr          fsgen        ENABLED  4099440  -        ACTIVE   -       -
pl usr-01       usr          ENABLED  4099440  -        ACTIVE   -       -
sd disk02-B0    usr-01       ENABLED  1        0        -        -       Block0
sd disk02-04    usr-01       ENABLED  4099439  1        -        -       -

v  var          fsgen        ENABLED  4099440  -        ACTIVE   -       -
pl var-01       var          ENABLED  4099440  -        ACTIVE   -       -
sd disk02-03    var-01       ENABLED  4099440  0        -        -       -
#
#
# /etc/vx/bin/vxunroot

  This operation will convert the following file systems from
  volumes to regular partitions:

        rootvol swapvol usr var

  Replace volumes in root disk to partitions.

  This operation will require a system reboot.  If you choose to
  continue with this operation, system configuration will be updated
  to discontinue use of the volume manager for your root and swap
  devices.

Do you wish to do this now [y,n,q,?] (default: y) y

  Restoring kernel configuration...

  A shutdown is now required to install the new kernel.
  You can choose to shutdown now, or you can shutdown later, at your
  convenience.

Do you wish to shutdown now [y,n,q,?] (default: n) y

  shutdown -g0 -y -i6

Shutdown started.    Tue May 10 18:07:01 CST 2005

Changing to init state 6 - please wait
Broadcast Message from root (pts/2) on E250 Tue May 10 18:07:01...
THE SYSTEM E250 IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

E250 console login: root
Password:
Last login: Tue May 10 13:30:07 from 192.168.1.10
May 10 16:54:15 E250 login: ROOT LOGIN /dev/console
Sun Microsystems Inc.   SunOS 5.9       Generic May 2002
#vxdg list
NAME         STATE           ID
rootdg       enabled  1115647860.1025.E250
# vxdisk list
DEVICE       TYPE      DISK         GROUP        STATUS
c0t0d0s2     sliced    -            -            error
c0t9d0s2     sliced    disk01       rootdg       online
# vxprint
Disk group: rootdg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg rootdg       rootdg       -        -        -        -        -       -

dm disk01       c0t9d0s2     -        35363560 -        -        -       -
# more /etc/vfstab
#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/c0t0d0s1       -       -       swap    -       no      -
/dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no      -
/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /usr    ufs     1       no      -
/dev/dsk/c0t0d0s4       /dev/rdsk/c0t0d0s4      /var    ufs     1       no      -
swap    -       /tmp    tmpfs   -       yes     -
#NOTE: volume rootvol (/) encapsulated partition c0t0d0s0
#NOTE: volume swapvol (swap) encapsulated partition c0t0d0s1
#NOTE: volume usr (/usr) encapsulated partition c0t0d0s3
#NOTE: volume var (/var) encapsulated partition c0t0d0s4
# May 10 16:54:25 E250 login: ROOT LOGIN /dev/pts/1 FROM 192.168.1.100

原文转自:http://www.ltesting.net