Disk 구성
Disk partitioning
n Disk partition 이란?
사용자의 목적에 맞게 size, 성능, 안정화 방안 등을 고려하여 만든
physical disk의 일부분
n Disk partitioning 방법
a. Whole disk partitioning : 구성이 간편
b. LVM : 많은 관리상의 유연성 및 융통성(flexibility) 제공
5.2 LVM 개요
- Logical Volume Manager
- OSF Product - HP-UX 9.x 부터 O/S 에 bundle 되어 있다.
- Disk 관리를 위한 kernel에 기본 내장된 sub-system이다.
- LVM은 volume group이라는 disk의 집합을 만들고 volume group 내에
공간을 논리적 volume(lvol)으로 분할하여 각각의 partition을 구성할 수
있다.
5.3 LVM 구성 요소
n Physical Volume
- 의미 : LVM에 의해서 관리되는 물리적인 디스크. 즉 일반 물리적인
디스크에LVM 데이터 구조가 생성된 디스크.
- Device file
(예) /dev/rdsk/c0t6d0 character device file
/dev/dsk/c0t6d0 block device file
- 생성 방법
# pvcreate -f /dev/rdsk/c0t6d0
n Volume Group
- 의미 : 한 개 이상의 physical volume으로 구성된 disk pool
- Device file
(예) /dev/vg01 vg01과 관련된device file을 가지고 있는 directory
/dev/vg01/group “vg01” volume group device file
- 생성 방법
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000[CODE][/CODE]
(0x010000은 vg번호와 연관 vg02이면 0x020000)
# vgcreate /dev/vg01 /dev/dsk/c0t6d0
n Logical Volume
- 의미 : 각각의 filesystem을 구성하는 단위로서 partition 과 같다.
특정한 volume group 안에서 생성가능 하다.
volume group이 다수의 disk로 구성된다면, lvol은 한 개의 disk
범위를 넘어 설정될 수 있다.
- Device file
(예) /dev/vg01/lvol1 block device file
/dev/vg01/rlvol1 character device file
- 생성 방법
# lvcreate -L 1024 /dev/vg01
ð 크기가 1024 MB인 logical volume을 생성
n LVM Table
- 의미 : 모든 LVM 정보를 가지고 있고, LVM 구성 시 자동으로 생성 및
update 된다. 시스템 부팅 시 참조되어 해당 volume group을
활성화 시킨다.
- 위치 : /etc/lvmtab
# strings /etc/lvmtab
ð 현재 LVM 정보를 display 한다.
# mv /etc/lvmtab /etc/lvmtab.org
# vgscan -v
ð 기존 LVM 정보를 다른 이름으로 저장 후 , 현재 LVM 정보를
읽어 /etc/lvmtab 파일을 새로 생성
Volume group 생성 예제
① # ioscan -fnkC disk
ð physical volume 으로 구성할 disk의 device file을 확인
② # pvcreate /dev/rdsk/c2t2d0
ð physical volume으로 구성
③ # mkdir /dev/vg01
ð volume group 의 device file이 저장 될 directory 생성
④ # mknod /dev/vg01/group c 64 0x010000
(0x010000은 vg번호와 연관 vg02이면 0x020000)
ð volume group device file 생성
⑤ # vgcreate /dev/vg01 /dev/dsk/c2t2d0
ð 하나의 disk를 volume group으로 구성
⑥ # lvcreate -L 500 /dev/vg01
ð volume group vg01에 크기가 500MB인 logical volume 구성
ð logical volume 이름은 기본으로 lvol1(만들어진 순서에 따라)으로 생성
⑦ # newfs -F vxfs /dev/vg01/rlvol1
ð logical volume lvol1을 vxfs type인 File system으로 만듦
⑧ # mount /dev/vg01/lvol1 /data1
ð 특정 directory에 mount 시킨다