disk 추가에서 볼륨생성까지

2011.02.18 18:51

조인상 조회 수:40444

원문 : http://www.ischo.net -- 조인상 // 시스템 엔지니어

Writer : http://www.ischo.net -- ischo // System Engineer in Replubic Of Korea

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

원문 : http://www.ischo.net -- 조인상 //시스템 엔지니어

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

디스크인식 -> 볼륨그룹 생성 -> Logical Volume 생성 -> 파일시스템 생성

 

의 순으로 감.

 

디스크 인식

#
# ioscan -fnC disk
Class        I  H/W Path        Driver         S/W State   H/W Type     Description
====================================================================================
disk         2  0/0/2/1.0.16.0.0     sdisk          CLAIMED     DEVICE       TEAC    DVD-ROM DW-224EV
                               /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk         3  0/3/1/0.1.0.0.0.0.0  sdisk          CLAIMED     DEVICE       DGC     CX3-10cWDR5
                               /dev/dsk/c6t0d0   /dev/rdsk/c6t0d0
disk         1  0/4/1/0.0.0.0.0      sdisk          CLAIMED     DEVICE       HP      IR Volume
                               /dev/dsk/c3t0d0     /dev/dsk/c3t0d0s2   /dev/rdsk/c3t0d0    /dev/rdsk/c3t0d0s2
                               /dev/dsk/c3t0d0s1   /dev/dsk/c3t0d0s3   /dev/rdsk/c3t0d0s1  /dev/rdsk/c3t0d0s3
disk         4  0/7/1/0.1.0.0.0.0.0  sdisk          CLAIMED     DEVICE       DGC     CX3-10cWDR5
                               /dev/dsk/c7t0d0   /dev/rdsk/c7t0d0

 

신규 인식된 놈이  c6와 c7.

 

 

 

* (legacy) hardware path, lunpath hardware path, and LUN hardware path 등을 확인하려면~

 

# ioscan -m dsf
Persistent DSF           Legacy DSF(s)
========================================
/dev/rdisk/disk1         /dev/rdsk/c2t0d0
/dev/rdisk/disk1_p1      /dev/rdsk/c2t0d0s1
/dev/rdisk/disk1_p2      /dev/rdsk/c2t0d0s2
/dev/rdisk/disk1_p3      /dev/rdsk/c2t0d0s3
/dev/pt/pt2              /dev/rscsi/c3t0d0
                         /dev/rscsi/c4t0d0
/dev/rtape/tape1_BEST    /dev/rmt/c1t3d0BEST
/dev/rtape/tape1_BESTn   /dev/rmt/c1t3d0BESTn
/dev/rtape/tape1_BESTb   /dev/rmt/c1t3d0BESTb
/dev/rtape/tape1_BESTnb   /dev/rmt/c1t3d0BESTnb
/dev/rdisk/disk17        /dev/rdsk/c5t0d0
                         /dev/rdsk/c6t0d0
/dev/rdisk/disk18        /dev/rdsk/c5t0d1
                         /dev/rdsk/c6t0d1
/dev/rdisk/disk19        /dev/rdsk/c5t0d2
                         /dev/rdsk/c6t0d2
/dev/rdisk/disk20        /dev/rdsk/c5t0d3
                         /dev/rdsk/c6t0d3
/dev/rdisk/disk21        /dev/rdsk/c5t0d4
                         /dev/rdsk/c6t0d4
/dev/rdisk/disk22        /dev/rdsk/c5t0d5
                         /dev/rdsk/c6t0d5

 

 

 

 

 

 

디스크 용량 확인

# diskinfo /dev/rdsk/c6t0d0
vendor: DGC
product id: CX3-10cWDR5
type: direct access
size: 75497472 Kbytes
bytes per sector: 512

 

 

EMC 스토리지에 인식된 내용 확인(powerpath 설치시)
# powermt display dev=all
CLARiiON ID=CK200080400034
Logical device ID=600601601C901E00A48464F69E23E011
state=dead; policy=CLAROpt; priority=0; queued-IOs=0;
Owner: default=SP B, current=SP B       Array failover mode: 1
==============================================================================
--------------- Host ---------------   - Stor -   -- I/O Path --  -- Stats ---
###  HW Path               I/O Paths    Interf.   Mode    State   Q-IOs Errors
==============================================================================
   6 0/3/1/0.1.0.0.0.0.0      c6t0d0    SP B2     active  dead        0      1
   7 0/7/1/0.1.0.0.0.0.0      c7t0d0    SP A2     active  dead        0      1

 

그런데 상태가 dead.

 

# ioscan -fnCdisk
Class        I  H/W Path        Driver         S/W State   H/W Type     Description
====================================================================================
disk         2  0/0/2/1.0.16.0.0     sdisk          CLAIMED     DEVICE       TEAC    DVD-ROM DW-224EV
                               /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk         3  0/3/1/0.1.0.0.0.0.0  sdisk          CLAIMED     DEVICE       DGC     CX3-10cWDR5
                               /dev/dsk/c6t0d0   /dev/rdsk/c6t0d0
disk         1  0/4/1/0.0.0.0.0      sdisk          CLAIMED     DEVICE       HP      IR Volume
                               /dev/dsk/c3t0d0     /dev/dsk/c3t0d0s2   /dev/rdsk/c3t0d0    /dev/rdsk/c3t0d0s2
                               /dev/dsk/c3t0d0s1   /dev/dsk/c3t0d0s3   /dev/rdsk/c3t0d0s1  /dev/rdsk/c3t0d0s3
disk         4  0/7/1/0.1.0.0.0.0.0  sdisk          CLAIMED     DEVICE       DGC     CX3-10cWDR5
                               /dev/dsk/c7t0d0   /dev/rdsk/c7t0d0

해당 디스크 삭제후 재인식 하기로 함.


#
#
# rmsf -H 0/3/1/0.1.0.0.0.0.0
# rmsf -H 0/7/1/0.1.0.0.0.0.0

 

디스크 재인식
# ioscan -fnCdisk                
Class        I  H/W Path        Driver         S/W State   H/W Type     Description
====================================================================================
disk         2  0/0/2/1.0.16.0.0     sdisk          CLAIMED     DEVICE       TEAC    DVD-ROM DW-224EV
                               /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk         3  0/3/1/0.1.0.0.0.0.0  sdisk          CLAIMED     DEVICE       DGC     CX3-10cWDR5
disk         1  0/4/1/0.0.0.0.0      sdisk          CLAIMED     DEVICE       HP      IR Volume
                               /dev/dsk/c3t0d0     /dev/dsk/c3t0d0s2   /dev/rdsk/c3t0d0    /dev/rdsk/c3t0d0s2
                               /dev/dsk/c3t0d0s1   /dev/dsk/c3t0d0s3   /dev/rdsk/c3t0d0s1  /dev/rdsk/c3t0d0s3
disk         4  0/7/1/0.1.0.0.0.0.0  sdisk          CLAIMED     DEVICE       DGC     CX3-10cWDR5

CX3-10cWDR5로 두놈 잡힘.


#
#
# ioscan -fnkCdisk              ---> 커널에서 정보를 가져옴
Class        I  H/W Path        Driver         S/W State   H/W Type     Description
====================================================================================
disk         2  0/0/2/1.0.16.0.0     sdisk          CLAIMED     DEVICE       TEAC    DVD-ROM DW-224EV
                               /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk         3  0/3/1/0.1.0.0.0.0.0  sdisk          CLAIMED     DEVICE       DGC     CX3-10cWDR5
                               /dev/dsk/c6t0d0   /dev/rdsk/c6t0d0
disk         1  0/4/1/0.0.0.0.0      sdisk          CLAIMED     DEVICE       HP      IR Volume
                               /dev/dsk/c3t0d0     /dev/dsk/c3t0d0s2   /dev/rdsk/c3t0d0    /dev/rdsk/c3t0d0s2
                               /dev/dsk/c3t0d0s1   /dev/dsk/c3t0d0s3   /dev/rdsk/c3t0d0s1  /dev/rdsk/c3t0d0s3
disk         4  0/7/1/0.1.0.0.0.0.0  sdisk          CLAIMED     DEVICE       DGC     CX3-10cWDR5
                               /dev/dsk/c7t0d0   /dev/rdsk/c7t0d0
#
#
# insf -eCdisk         --> disk를 device명에 매핑함
insf: Installing special files for sdisk instance 2 address 0/0/2/1.0.16.0.0
insf: Installing special files for sdisk instance 3 address 0/3/1/0.1.0.0.0.0.0
insf: Installing special files for sdisk instance 1 address 0/4/1/0.0.0.0.0
insf: Installing special files for sdisk instance 4 address 0/7/1/0.1.0.0.0.0.0
#

# pvcreate -f /dev/rdsk/c6t0d0

# pvcreate -f /dev/rdsk/c7t0d0

 

이제 /dev/dsk/c6t0d0  와 /dev/dsk/c7t0d0  이라는 PV가 생성되었다.

 

 

 

볼륨그룹 생성

 

# mkdir /dev/vg01

# ls -l /dev/vg00
총 0 블록입니다.
crw-r-----   1 root       sys         64 0x000000 2009.12.21   group
brw-r-----   1 root       sys         64 0x000001 2009.12.21   lvol1
brw-r-----   1 root       sys         64 0x000002 2009.12.21   lvol2
brw-r-----   1 root       sys         64 0x000003 2009.12.21   lvol3
brw-r-----   1 root       sys         64 0x000004 2009.12.29   lvol4
crw-r-----   1 root       sys         64 0x000001 2009.12.21   rlvol1
crw-r-----   1 root       sys         64 0x000002 2009.12.21   rlvol2
crw-r-----   1 root       sys         64 0x000003 2009.12.21   rlvol3
crw-r-----   1 root       sys         64 0x000004 2009.12.29   rlvol4

 

vg00 의 minor number 가 0x000000 이므로 새로운  vg01의 minor number로 0x010000를 쓰도록 한다.

 

# mknod /dev/vg01/group c 64 0x010000                   c:character device / 64 : major number 디스크타입은 64로 고정

#

# vgcreate vg01 /dev/dsk/c6t0d0 /dev/dsk/c7t0d0

볼륨그룹 생성됨.

 

생성 확인

# vgdisplay -v vg01

# pvdisplay -v /dev/dsk/c6t0d0

# pvdisplay -v /dev/dsk/c7t0d0

 

참고 : 실수로 인해서 삭제된 vg의 정보를 재생성 => #vgscan
volume group 확인 => # strings /etc/lvmtab

 

 

(추가)  vgcreate 다음과 같은 에러 발생시

# vgcreate vg01 /dev/dsk/c6t0d0

vgcreate : couldn't open physical volume "/dev/dsk/c6t0d0"

Device busy.

 

이건 /dev/dsk/c6t0d0 디스크가 다른 vg등에 이미 들어가 있기 때문임. 그려면 vg에서 해당 볼륨을 빼면 되겠지?

# vgreduce vg01 /dev/dsk/c6t0d0

vgreduce : couldn't query physical volume "/dev/dsk/c6t0d0 "

 

이 상태는 /dev/dsk/c6t0d0  가 ghost disk가 된 것임.

# vgreduce -f vg01                --> vg01 에 있는 free한 pv만 제거해줌 (lv가 없는 pv)

혹은

# vgreduce -l vg01 /dev/dsk/c6t0d0 

로 제거 가능함.

 

 

 

 

볼륨그룹 산하의 LV 만들기

 

# lvcreate -L 10240 vg01

-n 옵션으로 lv 이름을 따로 지정하지 않으면 자동으로 lvol1 이라는 lv가 생긴다.

10240 은 MB단위.

 

생성 확인

# vgdisplay -v vg01

# ls -l /dev/vg01

 

 

파일시스템 생성&mount

# newfs -F vxfs -o largefiles /dev/vg01/rlvol1             

 

/dev/vg01/lvol1 이 block device  /dev/vg01/rlvol1이 character device 이므로 rlvol1 디바이스를 이용해서 파일시스템을 생성한다.

 

# mount -F vxfs -o largefiles /dev/vg01/lvol1 /data  

라고 해도 되겠지만 기타 다른 마운트 옵션도 필요하므로 /etc/fstab에 등록하고 mount 하도록 한다.

 

# vi /etc/fstab

/dev/vg01/lvol1 /data vxfs rw,suid,largefiles,delaylog,datainlog 0 2

 

와 같이 등록해서 저장하고.

 

# mount /data

 

위 옵션들이 기억이 안나면 sam 을 이용해서 생성해주면 옵션이 자동생성된다.

 

 

 

* FC 디스크 관리

FC HBA카드 검색하기

# ioscan -fnkC fc

 

검색한 HBA카드 정보보기(WWN 등 확인할때)
# fcmsutil /dev/fcd0

 

HBA카드가 설치된 슬롯(slot)보기

# olrad -q

의 결과와 ioscan 의 H/W path를 비교하면 알수 있음.

 

 

  

서버에 요청 중입니다. 잠시만 기다려 주십시오...