Volume Manager Command

# vxinstall

1) Disk 추가
# vxdiskadd [devname]
# vxdiskadd c1t0d0

2) Disk 제거
# vxdg -g [groupname] rmdisk [diskname]


3) Hot Spare 디스크 만들기
# vxedit set spare=on [diskname]

4) Hot Spare 디스크 지우기
# vxedit set spare=off [diskname]

5) Volume start
# vxvol startall
# vxvol [volumename] start

6) Volume stop
# vxvol stop [volumename]
# vxvol stopall

7) Volume 만들기
# vxassist -g [type] -U [gen, fsgen] make [volname] [length] layout=[raid5, stripe, mirror] [diskname .....]

8) Volume 제거
# vxedit -rf rm [volumename]

9) Volume의 최대 사이즈 알아보기
# vxassist maxsize layout=[raid type]

10) Volume의 남은 사이즈
# vxassist maxgrow [raidvol]

11) Volume Information
# vxprint -vt
# vxprint -l [volumename]
# vxprint -vl

12) C0t0d0s7 슬라이스를 rootdg로 만드는 방법
rootdg.sh
# vxconfigd -m disable
# vxdctl init
# vxdg init rootdg
# vxdctl add disk c0t0d0s7 type=simple
# vxdisk -f init c0t0d0s7 type=simple
# vxdg adddisk c0t0d0s7
# vxdctl enable
# rm /etc/vx/reconfig.d/state.d/install-db

13) VxVM License 입력

# vxlicense -c

License 확인. # vxlicense -p

14) Disk Group deport/import

# vxdg deport [dgname]
# vxdg import [dgname]
# vxdg list

15) Monitoring

# vxstat

# vxtrace

16) Disk Group 제거.(Disk Group 완전 삭제)

# vxdg destory [dgname]

17) 불안한 디스크를 수동으로 새로운 디스크로 이동.

# vxevac -g [dgname] [old disk] [new disk]

18) DMP 정보 확인

# vxdmpadm listctlr all

# vxdmpadm disable ctlr=c1

# vxdctl enable
# vxdmpadm enable ctlr=c1

19) Disk Group version upgrade
# vxdg -T 90 upgrade [diskgroup]

20) Renameing Disk Group
# vxdg -h [hostname] deport [diskgroup]
# vxdg -tC -n [newdg_name] import [diskgroup]

감사합니다.

1. Mirroring root disk step by step

1.1 <Preparation>
2disk상황에서는 root disk를 미러링할 경우 replica를 양쪽 디스크에 설정을 하지만
하나의 디스크가 fail시 quorum rule을 만족을 못하기 때문에 single user mode로 부
팅이 된다.
이를 방지하기 위해서는 /etc/system 파일에 다음을 설정한다.


# vi /etc/system
set md:mirrored_root_flag=1


양쪽 디스크의 파티션을 동일하게 한다.
# prtvtoc /dev/rdsk/c0t0d0s2 > disk0.txt
# fmthard -s disk0.txt /dev/rdsk/c0t1d0s2
or
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2


# metadb -a -f -c 2 /dev/rdsk/c0t0d0s7 /dev/rdsk/c0t1d0s7

1.2  3개 HDD 이상
각 HDD마다 2개의 replica 를 구성한다.
# metadb -a -c 2 -f /dev/rdsk/c0t0d0s7  /dev/rdsk/c0t1d0s7  /dev/rdsk/c0t2d0s7


1.3 <Create mirror for root and swap file system>
1.3.1 root file system
# metainit -f d10 1 1 c0t0d0s0 <--- the root partition
# metainit d20 1 1 c0t1d0s0 <--- the mirror partition
# metainit d30 -m d10
# metaroot d30


(metaroot 명령어에 의해 /etc/system, /etc/vfstab 파일이 수정된다. 하지만
/etc/vfstab 파일중에서 / 에 해당하는 디바이스만 /dev/md/dsk/d0 와 같이 바뀌기
때문에 다른 파일시스템이 있는 경우에는 수동으로 직접 수정해야 한다.)


1.3.2 swap file system
# metainit -f d11 1 1 c0t0d0s1
# metainit d21 1 1 c0t1d0s1
# metainit d31 -m d11


1.4 <Edit /etc/vfstab>
1.4.1 update vfstab file
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d31 - - swap - no -
/dev/md/dsk/d30 /dev/md/rdsk/d30 / ufs 1 no -
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /var ufs 1 no -
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /export/home ufs 2


1.5 <Reboot the system>
# lockfs -fa
# reboot
you must reboot with a one-way mirror : do not create a 2 way mirror before
rebooting otherwise the system will crash because of the round robin manner in
which data is read.


1.6 <Attach the second sub mirror to the mirror>
# metattach d30 d20 <-- root file system
# metattach d31 d21 <-- swap

출처 : http://sunsolve.sun.com/search/document.do?assetkey=1-9-17003-1

When replacing a failed disk under Sun Enterprise Volume Manager[TM] 2.6 (SEVM) or Veritas Volume Manager (VxVM) 3.x control in the Sun Enterprise Network Array (SENA) A5x00 array, one cannot simply pull out the disk and replace it with a new one as with other types of drives.

Because each disk has a unique world-wide number (WWN), the following procedure must be followed to correctly remove and replace any disk in an A5x00 array.

Please see SunAlert 40765, "Replacement of a Disk on StorEdge A5200 May Disconnect the Array", if this is an A5200, and the drive is in slot Front 10, or Rear 10 (f10, r10), it's in single loop mode and Loop A is the loop in use.

Also note that if you are experiencing difficulty with any of the procedures below, it is highly advisable to apply the latest luxadm patch for your particular operating system.  luxadm patches are as follows:

	Solaris 2.5.1	105310

	Solaris 2.6	105375

	Solaris 7		107473

	Solaris 8		109529

	Solaris 9		113049

If the procedure below is not followed, SEVM/VxVM may display this message when attempting to get the new disk online:

device cxtxxdxsx online failed : device path not valid

The following procedure illustrates the correct sequence of commands needed to replace a disk in an A5x00 array if a Volume Manager is being used.  The vxdiskadm command will bring up a menu of Volume Manager options.

1)  Inform Volume Manager you wish to remove the disk:

	# vxdiskadm -> option 4 (Remove a disk for replacement)


2) Offline the device (use the c#t#d# name):

	# vxdiskadm -> option 11 (Disable (offline) a disk device)


3) Remove the device and device nodes.  Use the enclosure name as reported by luxadm probe, and “f” or “r” for the “front” or “rear” panel.

	# luxadm remove_device enclosurename,[f|r]slot#


For example:  front panel slot 3 with box name of saturn:

	# luxadm remove_device saturn,f3


This command will prompt you to physically remove the device.  If this is successful, remove the disk drive, finish the procedure, and skip to step 5.  Otherwise, proceed to step 4.

4)  If removal says  "device busy" and does not continue the removal, there is the possibility of “ghost” disks remaining if the correct procedure was not used. This is confirmed by running the Volume Manager command “vxdisk list”, and checking if there are 2 entries for the same disk drive (one is the “ghost”). If this is the case, please contact a Sun Representative, referring the Internal Infodoc 70929 for solving this issue.

In extreme cases, it may be necessary to manually remove the device paths for the A5x00 if all of the above procedures are not working. This procedure is detailed in Infodoc 18168.  This is a last-resort workaround, if the previous reported “ghost disk” situation in Volume Manager is not the case.

Do not use the -f option of the luxadm remove_device command as this won't properly update the device tree.

5) Run the following command, and when prompted, insert the new disk in the same previous slot of the same A5x00 enclosure:

# luxadm insert_device enclosurename,[f|r]slot#

This will create the new device and device nodes.  Again, on a multi-initiated array, this command must be performed on all systems connected to the array.

NOTE: there are situations (for example, if the previous luxadm remove_device left some garbage or was not followed correctly) that can lead to the command syntax "luxadm insert_device enclosurename,[f|r]slot#" not creating all the dev/devices entries required to correctly see the disk in both format and "luxadm display" outputs. In this case, you need to remove the old disk's dev/devices references again (through "luxadm remove_device" or manually as reported before), and create the references for the new disk without specifying the "enclosurename,[f|r]slot#" in the command, as below:

      # luxadm insert_device

This command syntax will scan ALL the SENA/FCAL devices connected to the equipment, and create the new dev/devices entries for the disk.

6) Inform Volume Manager of the configuration changes with the command:

	# vxdctl enable


7) Bring the disk back online in Volume Manager:

	# vxdiskadm option 5 (Replace a failed or removed disk)
== disksuit으로 mirror 구성된 o/s disk 강제로 metadb 제거 하는 방법.==
Ok boot cdrom –s
Singuser mode
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
/sbus@2,0/SUNW,socal@d,10000/sf@1,0/ssd@w2100002037a801b4,0
1. c1t1d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
/sbus@2,0/SUNW,socal@d,10000/sf@1,0/ssd@w21000020375b94ae,0
#mount /dev/dsk/c1t0d0s0 /mnt
#cd /mnt/etc/
#cp system system.old
#vi system
----------------- omitted -------------
* Begin MDD root info (do not edit)
forceload: misc/md_trans
forceload: misc/md_raid
forceload: misc/md_hotspares
forceload: misc/md_stripe
forceload: misc/md_mirror
forceload: drv/pcisch
forceload: drv/qlc
forceload: drv/fp
forceload: drv/ssd
rootdev:/pseudo/md@0:0,8,blk
* End MDD root info (do not edit)
----------------- omitted -------------
rootdev:/pseudo/md@0:0,8,blk  <-- 이부분 삭제


#cd /mnt/etc/lvm
devpath lock md.cf md.ctlrmap md.tab mddb.cf runtime.cf
#cp /dev/null md.cf
#cp /dev/null mddb.cf
#cd /mnt/etc
#vi vfstab
--- Vfstab file edit----
/dev/md/dsk/d1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
------------------------------------------------------------
/dev/dsk/c1t0d0s1 - - swap - no -
/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 / ufs 1 no -
Meta device를 기존의 slice로 변경.
#cd /
#umount /mnt
#reboot -r

1. Error Disk 확인.

#vxdisk list

DEVICE    TYPE   DISK    GROUP  STATUS
c0t0d0s2 sliced - - error       <-- OS disk임. error 아님다.    
c0t0d0s3 simple c0t0d0s3 rootdg online
c1t0d0s2 sliced testdg01 testdg error  <-- 이 넘이 error 
c1t0d2s2 sliced testdg02 testdg online
c1t1d0s2 sliced testdg03 testdg online
c1t1d0s2 sliced testdg04 testdg online

testdg01 이란 disk가 말썽이다. 이넘에게 있는 자료를 복구시켜보자.

2. 빈 슬롯에 새 디스크를 삽입한다.(같은 스펙이면 됨. 제조사구분상관없음)

#vxdiskadm       1번선택.

잠시기다렸다

#vxdisk list

DEVICE    TYPE   DISK    GROUP  STATUS
c0t0d0s2 sliced - - error       <-- OS disk임. error 아님다.    
c0t0d0s3 simple c0t0d0s3 rootdg online
c1t0d0s2 sliced testdg01 testdg error  <-- 이 넘이 error 
c1t0d2s2 sliced testdg02 testdg online
c1t1d0s2 sliced testdg03 testdg online
c1t1d2s2 sliced testdg04 testdg online
c1t2d0s2 sliced testdg05 testdg online <-- 삽입한 새 디스크

맨 밑에 새로운 disk가 잘 잡혔다.


3. diskgroup 의 free size 확인한다.

#vxdg -g testdg free
그럼 새 디스크는 OFFSET이 0 이다.device명이랑 일치하는지 확인.


4. error 난 disk에 있는 자료를 새 디스크로 복구하자.

#vxevac -g 그룹명 에러난디스크 새디스크
ex)# vxevac -g testdg testdg01 testdg05
그후 다시 free size 확인하면
#vxdg -g testdg free
에러난 디스크가 OFFSET이 0 으로 되어있구 새 디스크엔 자료가 들어가있다.
free size가 testdg05 에서 testdg01 로 변경된것이다.


5. error 난 디스크 제거

#vxdiskadm      3번선택

에러난 디스크제거

--------------the end -------------

각자의 볼륨상태에 따라 달라지므로 잘 확인후 작업해야한다.
vm에서 vxevac 명령어는 반드시반드시 세번 확인후 실행.!!


***때때로 볼륨상태가 여전히 error인 경우가 있는데
   이경우
#vxrecover -sv -o unsafe -g testdg vol1

하심된다. 되도록이면 정상적으로 작업하자..

VxVM의 Physica disk는 두 부분으로 구성됨
- private : VxVM의 환경과 관리 정보 저장, default로 3번 slice가 사용됨
- public : 데이터 저장, default로 4번 slice가 사용됨

- private region
# private region을 구성하는데는 하나의 cylinder가 필요함.
# VTOC(Volume Table Of Contents)를 조회하여 확인 가능하다.(ex. # prtvtoc /dev/dsk/c0t0d0s2)

-- private region 의 이용
# disk header : 하나의 디스크에서 private region의 정보를 저장하는 하나의 block.
- 디스크의 현재 소유자 : 지정된 호스트에서 사용중인 디스크가 디스크 그룹의 일부일 때 그 디스크는 사용 중인 host id가 저장.
만약 다른 VxVM이 이 디스크에 access하면 host id가 일치하지 않으므로 사용 중인 시스템에서 host id를 해제하기 전까지는 access 불가능하다.
- disk identifier : 64byte로 구성된 디스크의 고유한 식별자
# configuration database(configdb)는 디스크 그룹의 환경 정보 저장. default로 VxVM은 디스크 그룹당 4개의 복사본을 저장함.
- dgname : disk group name, 관리자가 지정
- dgid : 64byte의 식별자로 디스크 그룹이 생성될 때 VxVM이 생성함.
- Records : 디스크 그룹을 위한 VxVM Virtual structure information.
# Kernel Log
- transaction commit, plex detaches, dirty-region og failure, first write to a volume, volume close information 등이 저장.
- 시스템이 reboot 되거나 crash날 경우 disk group의 상태를 복구에 사용.

- VxVM 초기화
# 최소 요구사항 : 최소한 하나의 디스크를 포함하는 rootdg라는 디스크 그룹이 존재 해야함.
· system boot disk를 encapsulation
· 디스크를 초기화 하고 rootdg 디스크 그룹에 넣음.
# 초기화 과정
· VxVM에 의해 디스크가 초기화 될 때 디스크는 표준 VxVM 환경 설정으로 다시 파티셔닝됨.
· 초기화된 디스크는 3번과 4번 slice로만 구성
· 3번 slice의 크기는 매우 작고 VxVM환경이 저장됨.
· 4번 slice는 데이터가 저장됨.
※ vxinstall : 디스크의 encapsulation이나 초기화하는 유틸리티

- 특정 장치를 VxVM이 사용하지 않게 설정
# Limited Exclusion
· /etc/vxvm에 다음 파일을 설정하면 vxinstall, vxdiskadm유틸리티에서 초기화 시키는것을 제외할 수 있다.
· enclr.exclude : enclosure를 제외(ex. sena1)
· cntrls.exclude : controller를 제외(ex. c2)
· disk.exclude : 특정 디스크를 제외(ex. c0t3d5)
# Global Exclusion
· /etc/vx/vxvm.exclude, /etc/vx/vxdmp.exclude // 직접 편집하면 안된다.
· vxinstall이나 vxdiskadm명령어로 편집됨

- boot 디스크를 encapsulation하기 위한 필요사항
# boot 디스크는 최소한 사용하지 않은 2개의 slice를 포함해야 한다.
# boot 디스크는 slice 2와 root, swap, var, opt, usr를 제외한 다른 slice를 가져서는 안된다.
# boot 디스크의 시작이나 끝에 어떤 파티션에도 속하지 않은 최소한 2048 섹터의 공간 필요

1. 설치
- 패키지 구성
1. VRTSfsdoc : VxFS 문서
2. VRTSlic : Veritas 라이센스 유틸리티
3. VRTSvmdev : VxVM 헤더와 라이브러리 파일
4. VRTSvmdoc : VxVM 사용 문서
5. VRTSvmman : VxVM 맨페이지
6. VRTSvmsa : VxSA 프로그램
7. VRTSvxfs : VxFS 프로그램
8. VRTSvxvm : VxVM 프로그램

- 패키지 설치
# pkginfo -d .
# pkgadd -d .
※ 패키지 설치 순서 : 2 8 6 3 4 5

- License 등록
# vxlicense -c // license 등록
# vxlicense -p // 등록된 license 확인

# /opt/VRTSvlic/bin/vxlicinst // license 등록
# /opt/VRTSvlic/bin/vxlicrep // 등록된 license 확인(3.5 이후부터)
# vxlicrep -g | -s | -e // -g는 일반적, -s는 짧게, -e는 자세히


- vxinstall 유틸리티
# 시스템을 확인하고 모든 디스크 controller를 확인.
# default로 root 디스크를 포함한 모든 디스크를 encapsulation하기 때문에 Quick Installation은 권장되지 않는다.
# boot disk의 encapsulation
· VxVM 초기화 과정에서 boot 디스크는 encapsulation되고 rootdg 디스크 그룹에 포함된다.
· 준비사항
- boot 는 root와 swap만 포함해야 한다.
- boot 디스크에 10800개의 빈 block이 있어야 한다.
- primary boot 디스크를 제외한 모든 디스크는 /etc/vx/vxvm.exclude, /etc/vx/vxdmp.exclude에서 제외시켜야 한다.
· encapsulation을 위한 응답이 끝나면 2번 재부팅됨.

- VxVM 환경
# VxVM이 설치 되면 /etc/system 파일에 아래와 비슷한 환경이 추가된다. 필요하지 않거나 존재하지 않는 드라이버는 에러가 발생하므로 *를 붙여 주석 처리할것.
* vxvm_START (do not remove)
forceload: drv/vxdmp
forceload: drv/vxio
forceload: drv/vxspec
forceload: drv/sd
forceload: drv/scsi
forceload: drv/pci
forceload: drv/ssd
rootdev:/pseudo/vxio@0:0
set vxio:vol_rootdev_is_volume=1
* vxvm_END (do not remove)

# /etc/rc.*에 VxVM 등록
· /etc/rcS.d/S25vxvm-sysboot // 부팅 단계에서 /와 /usr를 구성, 환경구성 가능한 디버깅 parameter도 포함된다.(vxconfigd daemon)
· /etc/rcS.d/S35vxvm-startup1 // /와 /usr이 가능한 상태에서 다른 volume들이 가능하도록 한다.(vxrecover)
· /etc/rcS.d/S85vxvm-startup2 // I/O 데몬 실행, /dev/vx/dks와 /dev/vx/rdsk를 재생성. 모든 디스크 그룹을 import, 앞에서 시작되지 않은 모든 volume을 시작한다.(vxrecover)
· /etc/rcS.d/S86vxvm-reconfig // root 파티션에 fsck 유틸리티 실행
· /etc/rc2.d/S94vxnm-host_infod // VERITAS Volume Replicator(VVR)이 설치되고 라이센스된 상태에서 host_infod 프로그램을 실행함.
· /etc/rc2.d/S94vxnm-vxnetd // VVR S/W option이 설치되고 라이센스된 상태에서 vxnetd 실행.
· /etc/rc2.d/S95vxvm-recover // plexes를 붙이고 VxVM watch daemon을 시작.(vxrecover, vxrelocd, vxsparecheck,, vxnotify)
· /etc/rc2.d/S96vmsa-server // remote client s/w에 응답하는 VxVM command server시작.(/opt/VRTSvmsa/bin/vmsa_server파일 실행, 2 jre and 1 cmdserver 시작)
· /etc/rc0.d/K10vmsa-server or /etc/rc1.d/K10vmsa-server VMSA 서버 종료
· /etc/rc0.d/K99vxvm-shutdown // vxconfigd 데몬을 종료하고, vxspec, vxio, vxdmp 드라이버 내림.

# 스크립트와 파일들의 위치
· /opt/VRTS // VxVM man 페이지
· /opt/VRTSlic // VxVM license installation and verification
· /opt/VRTSvxvm // VxVM technical documents and library files
· /opt/VRTSvmsa // VMSA server and client S/W.
· /usr/sbin/vx*
· /etc/vx/bin


- VxVM Object
# VxVM disk drive
· VxVM이 디스크를 관리하게 되면 존재하는 디스크 그룹에 디스크를 추가, 새로운 디스크 그룹에 디스크를 추가, free-disk pool에 디스크를 추가 할 수 있다.
· free-disk pool에 디스크를 추가하는 방법이 제일 쉽다. vxdisksetup는 VxVM format으로 디스크를 변경한 다음 하나의 blank header에 정보 기록한다.
# VxVM disk group
· 공통된 환경을 공유하는 VxVM디스크들의 모음.
· 각각의 디스크 그룹은 하나의 호스트에 종속된다. 현재의 소유권은 모든 configuration records에 기록되고, 디스크 그룹 내의 모든 디스크들은 configuration records의 복사본을 저장한다.
· 디스크 그룹은 하나의 호스트에서 다른 호스트로 옮겨갈 수 있다. 하지만 두번째 호스트가 같은 array에 연결되어 있더라고 현재 소유권을 가진 호스트만이 access가 가능하다. 디스크 그룹을 deport한 후에 다른 호스트에서 import하여 사용.
· Shared disk group : 두 개 이상의 호스트들이 같은 디스크 그룹에 동시에 access 가능하다. 호스트는 node라고 불림. shared disk group은 연결된 어떤 node에서도 import가 가능하고 cluster_naeme이 디스크의 configuration record에 기록되면 모든 연결된 node에서 disk group을 access할 수 있다.
# Subdisks
· 연속된 디스크 블록의 집합. 한 개의 디스크 내에서 하나의 subdisk는 디스크 전체를 의미한다.
· 디스크 그룹 내의 디스크에서 public region은 하나 이상의 서브디스크로 나누어질 수 있다.
· 서브디스크는 public region에서 같은 구획에 중첩되거나 공유될 수 없다.
· 가장 작은 서브디스크의 크기는 1 sector(512byte)이고 가장 큰 크기는 VxVM의 public retion전체가 될 수 있다.
# Plexes
· 여러 개의 서브디스크를 묶어 Plex를 구성할 수 있다.
· Plex는 하나 이상의 물리 디스크 에서 하나 이상의 서브디스크로 구성된다.
· mirroring에는 plex가 구별되지만 기타 다른 RAID level에서는 plex가 volum을 의미한다.
· 하나의 Plex는 초대 4096개의 서브디스크를 포함할 수 있다.
· 하나의 Plex에서 서브디스크들은 Concatenation, Striping, Striping with parity 방식으로 데이터를 저장 가능하다.
# Volumes
· Volumes은 하나 이상의 plex로 구성된다.
· 두개의 plex를 가진 하나의 volume은 mirror된 것임.
· volume은 두개 이상의 mirror를 가질 수 있다.
· RAID-5 volume은 mirroring될 수 없다.
· 데이터 저장에 사용하지 않는 plex는 logging structure될 수 있다.


- 상태 정보를 확인하는 기본 명령
# vxprint // 상태와 구성 정보 출력.
# vxprint -ht // 자세히 출력
· TY : Component type
· NAME : Component name
· ASSOC : Hierarchy association
· KSTATE : component state in kernel records
· LENGTH : component length in disk drive blocks
· PLOFFS : component offset within a plex
· STATE : component operationa state
· TUTIL0/PUTIL0 : Temporary and persistent control bits
# vxprint -spv // -p : plex 정보, -s : subdisk와 sub volume 정보, -v : volume 정보
# vxdisk list // 시스템에 부착된 모든 디스크의 상태와 소유권의 요약 정보 출력.
# vxdisk list c1t3d0s7 // 지정한 디스크에 관한 정보 출력
· online : VxVM 용으로 등록된 disk, error : solaris용 disk
# vxdisk -s list // 자세한 정보 표시
# vxdg list // 모든 디스크 그룹의 일반 정보와 unique identfier 출력.
# vxdg -g DGa free // 디스크 그룹 내의 각각의 디스크의 여유 공간의 양을 출력.
# vxdg list rootdg // rootdg 디스크 그룹 의 자세한 정보 출력

- VMSA
# VRTSvmsa : VMSA관련 패키지.
# Server와 Client로 구성. VMSA server는 VxVM 서버단에 설치. client는 하나 이상의 관리 시스템에 설치
# VxVM의 GUI환경의 관리 소프트웨어.
※ 원격지에서 VMSA 관리 GUI 사용 방법 : setenv DISPLAY 192.168.10.10:0.0
# VMSA 서버의 시작과 종료
· /etc/rc2.d/S96vmsa-server // VMSA서버의 시작 스크립트, vmsa_sercer와 cmdserver의 시작 스크립트이다.
· /etc/init.d/vmsa_server start | stop // 수동으로 시작과 종료
· /opt/VRTSvmsa/bin/vmsa_server // 옵션 설정 가능.
-V : VMSA서버의 버전 표시
-q : 서버가 실행 중인 경우 체크를 위한 쿼리
-k : 서버 프로세스 종료
-r : read-only 모드로 시작
-u : 서버에 연결된 클라이언트 사용자 푯
-h : 도움말 표시
# VMSA Client의 시작
· /opt/VRTSvmsa/bin/vmsa server_name &

- vxdiskadm
# VxVM의 관리와 오류 복구 등을 지원하는 Bourne shell script.

- vxdiskunsetup
# 디스크에서 이전의 VxVM 환경을 제거
# /etc/vx/bin/vxdiskunsetup -C c2t3d0 // 지정한 디스크를 VxVM초기화 이전의 상태로 되돌림. -C는 강제로 제거하는 옵션.

- vxdisksetup
# VxVM이 사용할 수 있도록 디스크를 초기화, 그러나 디스크 그룹에는 포함시키지 않는다.
# 디스크는 free pool에 남아있는다.
# vxdisksetup c2t0d0 // 디스크를 VxVM형식의 파티션으로 repartition만 수행
# vxdisksetup -i c2t0d0 // -i : VxVM의 환경이 private region에 기록된다.
# vxdisksetup -i c2t0d0 privlen=10080 // private영역을 10080 섹터크기로 지정, 기본값은 1024임.

- vxdg
# 디스크 그룹을 생성하고 디스크 그룹에 디스크를 추가 /제거
# vxdg를 통해 디스크를 추가하거나 디스크 그룹을 생성하기 전에 디스크는 초기화되어 있어야한다.
# vxdg init // 디스크 그룹을 생성
# vxdg destory // 디스크 그룹을 삭제
# vxdg adddisk // 존재하는 디스크 그룹에 디스크를 추가
# vxdg rmdisk // 디스크 그룹에서 디스크를 제거
# vxdg import // 디스크 그룹의 설정을 가져옴
# vxdg deport // 디스크 그룹의 설정을 내보냄.

- 디스크 그룹의 생성
# vxdisk list // 디스크의 상태와 소유권의 요약 정보 출력
# vxdisksetup -i c2t1d0
# vxdisksetup -i c2t2d0 // 디스크를 초기화하고 환경을 private region에 기록(-oi)
# vxdg init newDG ndg-01=c2t1d0 ndg-02=c2t2d0 // 디스크 그룹을 생성하고 그룹에 디스크를 추가
# vxdisk -g newDG list // newDG그룹의 상태와 소유권의 요약 정보 출력.
# vxdg list // 모든 디스크 그룹의 일반 정보와 unique identfier 출력.

- 디스크를 추가하거나 제거
# vxdisksetup -i c2t5d0
# vxdisksetup -i c2t16d0 // 디스크를 초기화
# vxdg -g newDG adddisk ndg-03=c2t5d0 ndg-04=c2t16d0 // newDG디스크 그룹에 디스크를 추가
# vxdisk list
# vxdg -g newDG rmdisk ndg-04 // newDG디스크 그룹에서 ndg-04 디스크를 제거. free 상태로.
# vxdisk rm c2t16d0 // c2t16d0를 VxVM에서 제거.

- 디스크 online/offline
# vxdisk online c1t2d0s2
# vxdisk offline c1t2d0s2

- 디스크 그룹의 import / deport
# 하나 이상의 호스트에서 arrary를 공유해서 사용하는 경우에 유용.
# 하나의 호스트에서 장애가 발생하면 다른 호스트에서 import하여 계속 서비스를 제공할 수 있다.
# vxdg list
# vxdg deport newDG // newDG 디스크 그룹을 deport.
# vxdg list // deport된 newDG디스크 그룹은 보이지 않는다.
· 디스크 그룹이 deport되면 디스크 그룹 내의 모든 디스크에 저장된 호스트 ID는 없어진다. 그러므로 시스템이 재부팅 되더라도 자동으로 다시 import되지 않는다.
· 디스크 그룹은 호스트 ID가 지워지지 않고 deport되거나 다른 호스트에서 import되도록 대상 호스트 ID를 지정할 수 있다.
· 만약 deport된 디스크 그룹의 이름을 잊어버렸다면 vxdiskadm 유틸리티와 vxdisk -o alldgs list를 통해 알 수 있다.
# vxdg import newDG // newDG디스크 그룹을 import

- 디스크 그룹의 제거
# vxdg list
# vxdg destory newDG // newDG 디스크 그룹을 제거, 삭제된 디스크 그룹 내의 디스크들은 다른 그룹에 등록되어 사용 가능.
# vxdg list

- 디스크 그룹의 이름 변경
# vxdg list
# vxdg deport newDG // 이름을 변경항 디스크 그룹을 deport
# vxdg -n new oldDG import newDG // oldDG라는 디스크 그룹을 생성하고 newDG를 import
or
# vxdg list
# vxdg -n nwdg deport dg01 // dg01을 nwdg로 이름을 변경하고 deport
# vxdisk -s list

- 디스크 그룹 내에 있는 디스크 이름의 변경
# vxedit -g newDG rename c2t4d0 disk04 // c2t4d0를 disk04로 변경

- 디스크의 이름 변경
# vxedit rename dga01 dbdisk01 // 디스크 그룹 내의 디스크 이름 변경

- Hot spare 지정과 해제
· spare disk는 mirror나 raid5에서 사용.
· spare를 지정하지 않은 경우 여유 디스크를 찾아 자동으로 할당
# vxedit -g newDG set spare=on disk07 // 지정
# vxedit -g newDG set spare=off disk07 // 해제

- 디스크 그룹의 시작과 종료
# vxvol start vol01
# vxvol -g newDG startall // 그룹 내의 모든 volume 시작

# vxvol stop vol01 // 지정한 volume 종료
# vxvol -g newDG stopall

- subdisk 생성
# vxdg -g newDG free // 디스크의 여유 공간과 offset 확인
# vxmake -g newDG1 sd disk1-01 len=100m dmname=disk1 dmoffset=0 // 100MB 용량의 subdisk생성
# vxprint -s // 현재 생성된 subdisk 확인
# vxdg -g newDG free // 설정 내용 확인

- subdisk케 코멘트 설정
# vxedit set comment="Sales Dept" disk1-01

- subdisk 크기 변경
# vxedit set len="20481" disk1-01
# vxprint -l disk1-01

- subdisk의 분할
# vxprint -s
# vxsd -s 50m split disk2-01 disk2-02 disk2-03 // disk2-01을 disk2-02, disk2-02으로 분할

- subdisk의 병합
# vxprint -s
# vxsd -g newDG join disk2-02 disk2-03 disk2-01 // disk02-01로 disk2-02와 disk02-03을 병합.

- subdisk 제거
# vxedit rm disk1-01 // subdisk disk1-01을 제거


-- Volume Operation
- Disk group
# 디스크 그룹은 VxVM이 관리하는 디스크들의 집합이다.
# default 디스크 그룹은 rootdg임.
# volume은 디스크 그룹내에서 생성된다.
# 디스크 그룹의 주요 기능
· 쉬운 관리 : 디스크들을 관리상 편의를 위한 논리적인 집합으로 변경.
· 데이터의 가용성 증가 : 하나의 호스트에서 다른 호스트로 디스크 그룹을 이동 가능.
- 하나의 호스트에서 장애가 발생했을 경우 다른 호스트에서 디스크 그룹을 import하여 디스크 그룹의 data를 계속 access가능하도록 한다.
※ 디스크 그룹의 volume이 open되어 있을 경우(status가 ENABLED or ACTIVE인 경우)에 디스크 그룹은 deport할 수 없다. deport 전에 반드시 stop되어야 한다.
# umount /vol01
# vxvol stop vol01
# vxdg deport newDG
# vxdisk import newDG // 다른 호스트에서
# vxrecover -g datadg -sb (s:start disable volume, -b: background operation)

- Disk group의 요구사항
# 디스크 그룹을 초기화 하기 전 고려해야 할 사항들.
· 모든 시스템에서 모든 디스크 그룹은 유일한 이름을 가져야 한다.
· 하나의 호스트 내에 위치한 모든 디스크 그룹은 유일한 이름을 가져야 한다.
· 각각의 호스트는 rootdg 디스크 그룹을 포함해야 한다.
· 일반적으로 rootdg 디스크 그룹은 작게 유지되어야 한다.
· 모든 디스크 그룹은 최소한 하나의 디스크를 포함하고 있어야 한다.(redundancy를 위해서는 두개 이상)

- volume 생성
# vxassist -g diskgroup_name make volume_name length laylout=stripe,nolog alloc=“disk_name disk_name”
· layout의 종류 : stripe, mirror, raid5, concatenate등. default는 concatenate
· nolog : log disk를 만들지 않음, default는 log disk 생성.
· alloc : volume을 만들 disk를 지정
# vxassist -g datadg make vol01 100m disk01 // concatenate volume 생성
# vxassist -b -t test -g datadg make vol01 100m disk01 // -b : background로 실행 vxtask list로 진행 사항 확인 가능, -t test : task id를 설정.
# vxassist -g datadg make vol01 100m layout=stripe disk01 disk02 disk03 //stripe volume 생성
# vxassist -g datadg make vol01 100m layout=raid5,nolog disk01 disk02 disk03 //RAID 5 volume 생성
# vxassist -g datadg make vol01 100m layout=mirror disk01 disk02 //mirror volume 생성(RAID 1)
# vxassist -g datadg make vol01 100m layout=stripe-mirror //1+0 volume 생성(stripe-pro volume) 0+1일 때는 mirror-stripe
# vxprint -vl vo01 // 생성한 volume의 자세한 정보 확인

- volume 삭제
# umount /data // mount 되어 있는 volume을 umount
# vxprint -v // 현재 volume 상태를 확인
# vxvol stop vol01 -> volume이 사용중이라면 중지시킨다.
# vxedit -g datadg -rf rm vol01 -> datadg disk group에서 vol01이라는 volume을 지운다.

- 관리 모드 또는 손상된 volume의 복구
# vxrecover -g newDG -s vol01
# vxvol start vol01

- volume내의 plex 정지/시작
# vxprint -p
# vxmend off vo1-01 // plex 정지
# vxprint -p
# vxmend on vol1-01 // plex 시작
# vxprint -p
# vxrecover -g newDG -s vol01 // volume 복구
# vxprint -v

- volume내의 plex detach/attach
# vxplex -g newDG det vol1-01 // plex vol1-01을 정지
# vxprint -p vol1-01
# vxplex -g newDG att vol1 vol1-01 // plex vol1-01을 vol1 volume에 attach


- volume의 권한, 소유권 설정
# vxedit -g newDG set user=oracle group=dba mode=660 vol01

- Hot space 공간을 확인
# vxdg -g newDG spare

- Hot spare 구성과 해제
# vxedit -g datadg set spare=on disk07 // datadg 디스크 그룹에 disk07 디스크를 hotspare로 지정
# vxedit -g datadg set spare=off disk07 // 해제.

- volume 이름 변경
# vxedit rename vol02 vol01 -> vol02를 vol01로 변경

- Performance Monitoring
# vxstat -g newDG // 지정한 디스크 그룹의 상태
# vxstat -g newDG vol01 // 디스크 그룹 내의 볼륨 상태
# vxstat -g newDG -d disk01 // 디스크 그룹 내의 디스크 상태

# vxtrace -o disk // 모든 디스크의 I/O나 에러 상태
# vxtrace -o c3t2d0 // 지정한 디스크의 I/O나 에러 상태
# vxtrace vol01 // vol01 volume가 관련된 모든 가상 장치의 I/O나 에러 상태

- controller 확인
# /etc/vx/bin/vxcntrllist
# vxdmpadm listctlr all
# ls /dev/dsk |awk '{print substr($0,0,2)}' |uniq

- A5000 장치 정보 보기
# luxadm probe
# luxadm display /dev/es/ses0

- disk 체크하기
# vxdisk check c0t1d0s4

출처 : Tong - 浪漫 IT님의 syStemEngiNeer [S/W]통

안녕하세요?
최병석입니다.

Veritas Volume Manager 명령을 요약해 봤습니다.

Volume Manager Command

# vxinstall

1) Disk 추가
# vxdiskadd [devname]
# vxdiskadd c1t0d0

2) Disk 제거
# vxdg -g [groupname] rmdisk [diskname]


3) Hot Spare 디스크 만들기
# vxedit set spare=on [diskname]

4) Hot Spare 디스크 지우기
# vxedit set spare=off [diskname]

5) Volume start
# vxvol startall
# vxvol [volumename] start

6) Volume stop
# vxvol stop [volumename]
# vxvol stopall

7) Volume 만들기
# vxassist -g [type] -U [gen, fsgen] make [volname] [length] layout=[raid5, stripe, mirror] [diskname .....]

8) Volume 제거
# vxedit -rf rm [volumename]

9) Volume의 최대 사이즈 알아보기
# vxassist maxsize layout=[raid type]

10) Volume의 남은 사이즈
# vxassist maxgrow [raidvol]

11) Volume Information
# vxprint -vt
# vxprint -l [volumename]
# vxprint -vl

12) C0t0d0s7 슬라이스를 rootdg로 만드는 방법
rootdg.sh
# vxconfigd -m disable
# vxdctl init
# vxdg init rootdg
# vxdctl add disk c0t0d0s7 type=simple
# vxdisk -f init c0t0d0s7 type=simple
# vxdg adddisk c0t0d0s7
# vxdctl enable
# rm /etc/vx/reconfig.d/state.d/install-db

13) VxVM License 입력

# vxlicense -c

License 확인. # vxlicense -p

14) Disk Group deport/import

# vxdg deport [dgname]
# vxdg import [dgname]
# vxdg list

15) Monitoring

# vxstat

# vxtrace

16) Disk Group 제거.(Disk Group 완전 삭제)

# vxdg destory [dgname]

17) 불안한 디스크를 수동으로 새로운 디스크로 이동.

# vxevac -g [dgname] [old disk] [new disk]

18) DMP 정보 확인

# vxdmpadm listctlr all

# vxdmpadm disable ctlr=c1

# vxdctl enable
# vxdmpadm enable ctlr=c1

19) Disk Group version upgrade
# vxdg -T 90 upgrade [diskgroup]

20) Renameing Disk Group
# vxdg -h [hostname] deport [diskgroup]
# vxdg -tC -n [newdg_name] import [diskgroup]

감사합니다.

[VxVM4.0] 베리타스 볼륨매니저 4.0 변경된 부분

=========================================================================================================================


1.1 rootdg의 제거

----------------
: Veritas Volume Manager의 3.5 이하 버전에서는 rootdg가 사용된다.
  vxconfigd가 boot mode에서 rootdg를 import하고 vxconfigd가 enabled mode로 진입하기를 기다린다.
  rootdg로 인한 문제가 지속적으로 발생함.

   [rootdg를 제거]
 - vxconfigd가 boot mode로 올라올 때에 rootdg를 체크하지 않게 함
 - rootdg에 대한 문제를 사전에 차단 함
 
1.2 vxconfigbackupd 추가 - 자동적으로 disk group에 대한 configration을 백업한다.

--------------------------------------------------------------------------------

 역할: The vxconfigbackupd daemon automatically backs  up  information  about  a  disk  group's new configuration whenever the configuration is changed

 [관련 files]
/etc/init.d/vxvm-recover                     //Startup file for vxconfigbackupd.
/etc/vx/cbr/bk/dgname.dgid/dgid.dginfo         //Location of backup file for  disk  group  information.
/etc/vx/cbr/bk/dgname.dgid/dgid.diskinfo //Location of backup file for disk attributes.
/etc/vx/cbr/bk/dgname.dgid/dgid.binconfig //Location of backup file for  binary  configuration copy.
/etc/vx/cbr/bk/dgname.dgid/dgid.cfgrec         //Location of backup file for configuration  records in vxprint -m format.

1.3 cdsdisk : Cross platform Data Sharing
 sliced, simple, nopriv이외에 cdsdisk type이 Veritas Volume Manager 4.0에서 추가되었다.
 vxdisksetup시에 default로 cdsdisk type으로 설정되어진다.
 cdsdisk는 다른 OS에서 data sharing이 가능하다.
 cdsdisk는 private region과 public region이 slice 7번에 공존한다.


1.3. 설치 방법

--------------------

 Software Package Installation

1. Install Basic VxVM Package
 # pkgadd –d . VRTSvlic VRTSvxvm VRTSvmdoc VRTSvmman


2. Install VEA Package
 # pkgadd –a ../scripts/VRTSobadmin –d . VRTSob VRTSobgui


3. Install remaining VxVM Package
 # pkgadd –d . VRTSalloc VRTSddlpr VRTSvmpro VRTSfspro


참조> Package 경로


1.4. Initializing 방법

-------------------------

VxVM software start하기 전에 vxinstall을 이용하여 Disk Group을 초기화 한다.
Voulme Manager 4.0버전에서는 vxinstall시에 rootdg에 대한 요구가 제거되었다.

# vxinstall

Do you want to use enclosure based names for all disks ?
[y,n,q,?]  (default : n) n

Do you want to setup a system wide default disk group ?
[y,n,q,?]  (default : y) n
 The installation is successfully completed.


1.5. Install License

------------------------

# vxlicinst              // 위의 command를 사용하여 License 입력
# vxlicrep               // 위의 command를 사용하여 License 확인


+ Recent posts