60.Unix2008. 12. 11. 11:43
반응형
* 설치된 Package 정보
system      VRTSvmdev      VERITAS Volume Manager, Header and Library Files
system      VRTSvmdoc      VERITAS Volume Manager (user documentation)
system      VRTSvmman      VERITAS Volume Manager, Manual Pages
system      VRTSvmsa       VERITAS Volume Manager Storage Administrator
system      VRTSvxvm       VERITAS Volume Manager, Binaries
 
#  pkginfo -l VRTSvxvm
   PKGINST:  VRTSvxvm
      NAME:  VERITAS Volume Manager, Binaries
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  3.0.3,REV=02.11.2000.17.32
   BASEDIR:  /
    VENDOR:  VERITAS Software
      DESC:  Virtual Disk Subsystem
    PSTAMP:  VERITAS-3.0.3h:11-February-2000
  INSTDATE:  1¿ù 27 2001 19:53
   HOTLINE:  800-342-0652
     EMAIL:  support@veritas.com
    STATUS:  completely installed
     FILES:    303 installed pathnames
                12 shared pathnames
                 6 linked files
                44 directories
               183 executables
                 1 setuid/setgid executables
             45446 blocks used (approx)
 
* 시스템 정보(E3500)
# uname -a
SunOS search_move 5.7 Generic_106541-14 sun4u sparc SUNW,Ultra-Enterprise
 
search_move[root/]:1 format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,socal@d,10000/sf@0,0/ssd@w2100002037bd1966,0
       1. c0t1d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,socal@d,10000/sf@0,0/ssd@w2100002037a833c2,0
       2. c0t2d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,socal@d,10000/sf@0,0/ssd@w2100002037bd9613,0
       3. c0t3d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,socal@d,10000/sf@0,0/ssd@w2100002037bd7aa3,0
       4. c1t4d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,socal@d,10000/sf@1,0/ssd@w2100002037bd5390,0
       5. c1t5d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,socal@d,10000/sf@1,0/ssd@w2100002037a5f521,0
       6. c1t6d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,socal@d,10000/sf@1,0/ssd@w2100002037a5f380,0
       7. c1t7d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,socal@d,10000/sf@1,0/ssd@w2100002037ae64c0,0
Specify disk (enter its number):
 
(참고)  c0t0d0  --> o/s disk 사용
           c1t4d0 --> o/s backup disk 로 사용 (o/s 디스크 장애시 대비)
           c0t1d0, c0t2d0, c0t3d0   -> stripe 구성 (18GB disk 3개로 plex 1개 구성)
           c1t5d0, c1t6d0, c1t7d0  -> stripe 구성 (18GB disk 3개로 plex 1개 구성)
 
* 작업시작.

1. rootdg 생성 - 새로운 볼륨을 생성하기 위해 rootdg 를 만들어준다.
    rootdg로 사용할 slice를 미리 정해준다.
    저는 c0t0d0s7 과 c1t4d0s7에 약 20MB정도의 slice를 생성하였음.
 
 # newfs /dev/rdsk/c0t0d0s7
  newfs: construct a new file system /dev/rdsk/c0t0d0s7: (y/n)? y
  /dev/rdsk/c0t0d0s7:     23560 트랙의 5 실린더에 있는 19 섹터, 248 섹터
        1076298240 실린더 그룹의 0.0MB(16 c/g, 36.81MB/g, 17664 i/g)
  수퍼-블록 백업은 (fsck -F ufs -o b=#를 위한) 다음에:
  32,
 #
 # newfs /dev/rdsk/c1t4d0s7
  ...

 # vxconfigd -m disable   ; deamon 정지
  (ex)
   # vxconfigd -m disable
    vxvm:vxconfigd: ERROR: cannot open /dev/vx/config: Device is already open

 # vxdctl init   ; /etc/vx/volboot 파일 초기화
 # vxdctl list      
 
  (ex)
 # vxdctl init
 # vxdctl list
 Volboot file
 version: 3/1
 seqno:   0.5
 hostid:  search_move
 entries:
 
 # vxdctl add disk c0t0d0s7 type=simple
 # vxdctl add disk c1t4d0s7 type=simple
 
 # vxdg init rootdg    ; rootdg생성하는 것으로 초기화하는 부분.
 
 # vxdg list rootdg   ; rootdg에 대한 정보 출력해본다.그냥.
 Group:     rootdg
 dgid:      1102393079.1050.search_move
 import-id: 0.1
 flags:   
 version:   60
 copies:    nconfig=default nlog=default
 config:    seqno=0.1034 permlen=4 free=2 templen=0 loglen=0
 
 # vxdisk -f init c0t0d0s7 type=simple    ; 헤더정보를 인스톨
 # vxdisk -f init c1t4d0s7 type=simple

 # vxdg adddisk c0t0d0s7    ; rootdg에 c0t0d0s7, c1t4d0s7 영역을 import함.
 # vxdg adddisk c1t4d0s7

 # vxdctl enable   ; 각각의 디스크로 부터 볼륨을 가져옴

 # vxdctl list
 Volboot file
 version:3/1
 seqno: 0.7
 hostid : search_move
 entries:
   disk c0t0d0s7 type=simple privoffset=1
   disk c1t4d0s7 type=simple privoffset=1

 # vxdg list rootdg
   ……
   config disk c0t0d0s7 copy 1 len=727 state=clean online
   config disk c1t4d0s7 copy 1 len=727 state=clean online
 
 # vxdisk list
 DEVICE       TYPE      DISK         GROUP        STATUS
 c0t0d0s2     sliced    -            -            error
 c0t0d0s7     simple    c0t0d0s7     rootdg       online
 c0t1d0s2     sliced    -            -            error
 c0t2d0s2     sliced    -            -            error
 c0t3d0s2     sliced    -            -            error
 c1t4d0s2     sliced    -            -            error
 c1t5d0s2     sliced    -            -            error
 c1t6d0s2     sliced    -            -            error
 c1t7d0s2     sliced    -            -            error
 c0t0d0s7     simple    c1t4d0s7     rootdg       online
 
위에서 error 로 표기된 것은 vxvm 디스크로 초기화 되지 않은 상태이다.
2. 볼륨을 구성할 디스크 6개에 대해서 초기화 시켜준다.
   방법은 vxdiskadm 으로 들어가서 대화식모드로 디스크를 초기화시켜주는 방법이 있고,
   두번째로는 vxdisksetup 명령어를 이용해서 생성할 수 있다.
 
  # vxdiskadm
Volume Manager Support Operations
Menu: VolumeManager/Disk
 1      Add or initialize one or more disks
 2      Encapsulate one or more disks
 3      Remove a disk
 4      Remove a disk for replacement
 5      Replace a failed or removed disk
 6      Mirror volumes on a disk
 7      Move volumes from a disk
 8      Enable access to (import) a disk group
 9      Remove access to (deport) a disk group
 10     Enable (online) a disk device
 11     Disable (offline) a disk device
 12     Mark a disk as a spare for a disk group
 13     Turn off the spare flag on a disk
 list   List disk information

 ?      Display help about menu
 ??     Display help about the menuing system
 q      Exit from menus
Select an operation to perform:  1
 여기서 1번 메뉴로 들어가면..아래와 같이 나온다.
 
Add or initialize disks
Menu: VolumeManager/Disk/AddDisks
  Use this operation to add one or more disks to a disk group.  You can
  add the selected disks to an existing disk group or to a new disk group
  that will be created as a part of the operation. The selected disks may
  also be added to a disk group as spares. The selected disks may also
  be initialized without adding them to a disk group leaving the disks
  available for use as replacement disks.
  More than one disk or pattern may be entered at the prompt.  Here are
  some disk selection examples:
  all:          all disks
  c3 c4t2:      all disks on both controller 3 and controller 4, target 2
  c3t4d2:       a single disk
Select disk devices to add:                                         
[<pattern-list>,all,list,q,?] list
DEVICE       DISK         GROUP        STATUS
c0t0d0       -            -            error
c0t0d0       c0t0d0s7     rootdg       online
c0t1d0       -            -            error
c0t2d0       -            -            error
c0t3d0       -            -            error
c1t4d0       -            -            error
c1t4d0       c1t4d0s7     rootdg     online
c1t5d0       -            -            error
c1t6d0       -            -            error
c1t7d0       -            -            error
 
Select disk devices to add:                                         
[<pattern-list>,all,list,q,?] c0t1d0 c0t2d0 c0t3d0 c1t5d0 c1t6d0 c1t7d0
  Here are the disks selected.  Output format: [Device_Name]
  c0t1d0 c0t2d0 c0t3d0 c1t5d0 c1t6d0 c1t7d0
Continue operation? [y,n,q,?] (default: y) y
  You can choose to add these disks to an existing disk group, a
  new disk group, or you can leave these disks 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 disks available for future use, specify a disk group
  name of "none".
Which disk group [<group>,none,list,q,?] (default: rootdg) list
NAME         STATE           ID
rootdg       enabled  1102033027.1042.investinfo_move
Which disk group [<group>,none,list,q,?] (default: rootdg) investinfodg
  There is no active disk group named investinfodg.
 
Create a new group named searchdg? [y,n,q,?] (default: y) y
Use default disk names for these disks? [y,n,q,?] (default: y) y
Add disks as spare disks for searchdg? [y,n,q,?] (default: n) n
  A new disk group will be created named investinfodg and the selected disks
  will be added to the disk group with default disk names.
  c0t1d0 c0t2d0 c0t3d0 c1t5d0 c1t6d0 c1t7d0
Continue with operation? [y,n,q,?] (default: y) y
  These disk devices are currently listed as in use by another host.
  If you are certain that the other host is not using the disks, you
  can choose to clear the use status. To use these disks the use status
  must be cleared.
  Output format: [Device_Name,Disk_Access_Name,Hostid]
  [c0t1d0,c0t1d0s2,search_move] [c0t2d0,c0t2d0s2,search_move] [c0t3d0,c0t3d0s2,search_move]
  [c1t5d0,c1t5d0s2,search_move] [c1t6d0,c1t6d0s2,search_move] [c1t7d0,c1t7d0s2,search_movel]
Clear use status? [Y,N,S(elect),q,?] (default: N) y
  Please respond with "Y", "N", or "S"
Clear use status? [Y,N,S(elect),q,?] (default: N) Y
  The following disks you selected for use appear to already have
  been initialized for the Volume Manager.  If you are certain the
  disks already have been initialized for the Volume Manager, then
  you do not need to reinitialize these disk devices.
  Output format: [Device_Name]
  c0t1d0 c0t2d0 c0t3d0 c1t5d0 c1t6d0 c1t7d0
Reinitialize these devices? [Y,N,S(elect),q,?] (default: Y) Y
  Initializing device c0t1d0.
  Initializing device c0t2d0.
  Initializing device c0t3d0.
  Initializing device c1t5d0.
  Initializing device c1t6d0.
  Initializing device c1t7d0.
  Creating a new disk group named searchdg containing the disk
  device c0t1d0 with the name searchd01.
  Adding disk device c0t2d0 to disk group searchdg with disk
  name searchd02.
  Adding disk device c0t3d0 to disk group searchdg with disk
  name searchd03.
  Adding disk device c1t5d0 to disk group searchdg with disk
  name searchd04.
  Adding disk device c1t6d0 to disk group searchdg with disk
  name searchd05.
  Adding disk device c1t7d0 to disk group searchdg with disk
  name searchd06.
Add or initialize other disks? [y,n,q,?] (default: n) n
 
Volume Manager Support Operations
Menu: VolumeManager/Disk
 1      Add or initialize one or more disks
 2      Encapsulate one or more disks
 3      Remove a disk
 4      Remove a disk for replacement
 5      Replace a failed or removed disk
 6      Mirror volumes on a disk
 7      Move volumes from a disk
 8      Enable access to (import) a disk group
 9      Remove access to (deport) a disk group
 10     Enable (online) a disk device
 11     Disable (offline) a disk device
 12     Mark a disk as a spare for a disk group
 13     Turn off the spare flag on a disk
 list   List disk information

 ?      Display help about menu
 ??     Display help about the menuing system
 q      Exit from menus
Select an operation to perform: q
Goodbye.
 
 이렇게 하면 초기화가 된다. 초기화 하는 중 리부팅후에 적용해야 된다는 경우도 메세지로 출력될 수 있는데...그때는 리부팅....
 
 다시 리부팅후 vxdisk list 해서 디스크가 올라오는지 확인후 ,
새롭게 디스크 정보를 지우고 초기화 한다.

 # vxdiskadm   --> 1.Add or initialize disks
기존 정보에 대해 clear 시킨다. 해당 디스크 c0t1d0, c0t2, c0t3, c1t5, c1t6, c1t7 를 선택한다.
여기서, 새롭게 설정할 디스크그룹(dg)이름도 만들어서 해당디스크들을 새로운DG(investinfodg)의 멤버로서 초기화한다.

 - 리부팅해야 할 경우도 생긴다. Encapsulate 해야 되니…아님…해당 디스크는 리부팅후 초기화 해야된다는 메시지가 나오면 리부팅후 혹은 아래와 같이 명령어로 한다.

 (기존 정보 제거 순서) 만약에 기존 디스크에 볼륨정보가 존재하고 있다면…. 아래와 같이 제거후 다시 해준다.
 - plex 제거 # vxedit -r rm plex_이름
 - dg에서 subdisk 제거   # vxdg -g dg이름 rmdisk subdisk이름
 - dg에 남은 마지막 남은 subdisk는 위 명령으로 제거가 안된다.
    그래서 아예 dg를 아래와 같이 날린다.
    # vxdg destory dg이름

 - FDP(Free Disk Pool) 에 디스크제거  
 # vxdiskupsetup c#t#d#
 기존 정보를 제거를 헀다면…. 초기화 시킨다.'

  # cd /etc/vx/bin
  # vxdisksetup -i c#t#d#    ;  FDP영역에 넣어 주는 것.( vxdisk list 했을 시 errot 에서 online으로 바뀐다.)
 
2. subdisk 생성 -> plex 생성 -> volume 생성 -> volume start -> newfs(파일시스템생성) -> 마운트(여기같은 경우 물리적 디스크 한 개에 subdisk 한 개를 만들었다.)
(len값의 35363560은 "vxdisk list c#t#d#s2"로 보면 나오는 최종 offset값이다..즉…전체사이즈를 말한다.)
 
** subdisk 생성 **
 # vxmake -g searchdg sd searchd01-01 len=35363560  dmname=searchd01 dmoffset=0
 # vxmake -g searchdg sd searchd02-01 len=35363560  dmname=searchd02 dmoffset=0
 # vxmake -g searchdg sd searchd03-01 len=35363560  dmname=searchd03 dmoffset=0
 # vxmake -g searchdg sd searchd04-01 len=35363560 dmname=searchd04 dmoffset=0
 # vxmake -g searchdg sd searchd05-01 len=35363560 dmname=searchd05 dmoffset=0
 # vxmake -g searchdg sd searchd06-01 len=35363560 dmname=searchd06 dmoffset=0
 
 # vxprint -s 혹은 vxprint -st 로 확인한다.
 
** dg에 속한 subdisk 제거 **
 # vxdg -g dg이름 rmdisk disk이름     ; 마지막남은 놈은 이 명령으로 안 지워진다.

 # vxdg destroy dg이름    ; 마지막 남은 디스크와 dg를 완전히 제거
 
** subdisk 제거 **   (보통 default로 dg이름이 aadg이면 disk이름은 aad01,aad02… 이렇고, subdisk이름은 aad01-01,aad02-01…)
 # vxedit rm subdisk이름

** plex 생성 **
(plex 생성 - 여기서는 디스크를 3개씩 스트라이프로 묶어 plex를 2개 만들어 미러하고자 한다.)

 # vxmake -g searchdg plex home1-01 sd=searchd01-01,searchd02-01,searchd03-01  layout=stripe stwidth=256 ncolumn=3

 # vxmake -g searchdg plex home1-02 sd=searchd04-01,searchd05-01,searchd06-01  layout=stripe stwidth=256 ncolumn=3
 
여기서 stwidth는 stripe width를 가리키는데,
위 명령은 stripe용 plex를 생성하는 것이다.
Plex 이름은 home1-01 이며, subdisk가 3개이므로 ncolumn은 3이며, stwidth는 256이다.

 # vxprint -sp  ; plex 생성후 제대로 생성되었는 지 확인해본다.
 
** plex 제거 **

 # vxedit -r rm plex이름 plex이름 …

** volume 생성 **
 # vxmake -g investinfodg -Ufsgen vol home1 plex=home1-01,home1-02  
  ; home1이라는 volume을 생성한다.
  ( home1이란 volume을 생성하는 plex두개를 동시에 적어서 포함시켜준다.)
 
 # vxprint -pvt       ; plex 와 volume 확인

 # vxvol start home1    ; 생성된 volume 을 시작하게 되면, 자동으로 sync 를 시작한다.
 
 # ls -ld /dev/vx/rdsk/investinfodg/home1    ; 생성된 raw device 확인
   crw-------   1 root     root     155,83000 Dec  3 17:09 /dev/vx/rdsk/investinfodg/home1

 # newfs /dev/vx/rdsk/investinfodg/home1       ; file system 생성.

 # mount /dev/vx/dsk/investinfodg/home1 /home1      ; mount

** volume 제거 **
 # vxedit -r rm volume이름     ; volume 제거시 포함된 plex, subdisk등을 전부 다 제거한다.
 

(참고)
 # vxdg -g dg이름 -k rmdisk disk이름
    ; vxdisk list 시 failed 라고 떨어지는 디스크를 removed로 바꾼다.
Posted by 1010