LVM volume group create example 시스템

자주하는 작업이 아니여서 교육받은거 되짚어보면서 만드는데, 작업했던 내용 정리용으로 한번 만들어둠

1. LVM tab 확인
hostname:/dev] strings /etc/lvmtab
/dev/vg00
/dev/dsk/c7t0d0s2
/dev/dsk/c6t1d0s2
/dev/dsk/c6t0d0s2
/dev/dsk/c7t1d0s2
/dev/vglock
/dev/dsk/c0t0d1
/dev/dsk/c3t0d1
/dev/vg01
/dev/dsk/c0t0d2
/dev/dsk/c3t0d2
/dev/dsk/c3t0d3
/dev/dsk/c0t0d3
/dev/dsk/c0t0d4
/dev/dsk/c3t0d4
/dev/dsk/c3t0d5
/dev/dsk/c0t0d5
/dev/dsk/c0t0d6
/dev/dsk/c3t0d6
/dev/dsk/c3t0d7
/dev/dsk/c0t0d7
/dev/dsk/c0t1d0
/dev/dsk/c3t1d0
/dev/dsk/c3t1d1
/dev/dsk/c0t1d1
/dev/dsk/c0t1d2
/dev/dsk/c3t1d2
/dev/dsk/c3t1d3
/dev/dsk/c0t1d3
/dev/dsk/c0t1d4
/dev/dsk/c3t1d4
/dev/dsk/c3t1d5
/dev/dsk/c0t1d5
/dev/dsk/c0t1d6
/dev/dsk/c3t1d6
/dev/dsk/c3t1d7
/dev/dsk/c0t1d7
/dev/dsk/c0t2d0
/dev/dsk/c3t2d0
/dev/dsk/c3t2d1
/dev/dsk/c0t2d1
/dev/dsk/c0t2d2
/dev/dsk/c3t2d2
/dev/dsk/c3t2d3
/dev/dsk/c0t2d3
/dev/dsk/c0t2d4
/dev/dsk/c3t2d4
/dev/dsk/c3t2d5
/dev/dsk/c0t2d5
/dev/dsk/c0t2d6
/dev/dsk/c3t2d6
/dev/dsk/c3t2d7
/dev/dsk/c0t2d7
/dev/dsk/c0t3d0
/dev/dsk/c3t3d0
/dev/dsk/c3t3d1
/dev/dsk/c0t3d1
/dev/dsk/c0t3d2
/dev/dsk/c3t3d2
/dev/dsk/c3t3d3
/dev/dsk/c0t3d3
/dev/dsk/c0t3d4
/dev/ds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t7d6
/dev/dsk/c3t7d7
/dev/dsk/c0t7d7
/dev/dsk/c3t8d0
/dev/dsk/c0t8d0
/dev/dsk/c3t8d1
/dev/dsk/c0t8d1
/dev/dsk/c3t8d2
/dev/dsk/c0t8d2
/dev/dsk/c3t8d3
/dev/dsk/c0t8d3
/dev/dsk/c3t8d4
/dev/dsk/c0t8d4
/dev/dsk/c3t8d5
/dev/dsk/c0t8d5
/dev/dsk/c3t8d6
/dev/dsk/c0t8d6
/dev/dsk/c3t8d7
/dev/dsk/c0t8d7
/dev/dsk/c3t9d0
/dev/dsk/c0t9d0
/dev/dsk/c3t9d1
/dev/dsk/c0t9d1
/dev/dsk/c3t9d2
/dev/dsk/c0t9d2
/dev/dsk/c3t9d3
/dev/dsk/c0t9d3
/dev/dsk/c3t9d4
/dev/dsk/c0t9d4
/dev/dsk/c3t9d5
/dev/dsk/c0t9d5
/dev/dsk/c3t9d6
/dev/dsk/c0t9d6
/dev/dsk/c3t9d7
/dev/dsk/c0t9d7
/dev/dsk/c3t10d0
/dev/dsk/c0t10d0
/dev/dsk/c3t10d1
/dev/dsk/c0t10d1
/dev/dsk/c3t10d2
/dev/dsk/c0t10d2
/dev/dsk/c3t10d3
/dev/dsk/c0t10d3
/dev/dsk/c3t10d4
/dev/dsk/c0t10d4
/dev/dsk/c3t10d5
/dev/dsk/c0t10d5
/dev/dsk/c3t10d6
/dev/dsk/c0t10d6
/dev/dsk/c3t10d7
/dev/dsk/c0t10d7
/dev/dsk/c3t11d0
/dev/dsk/c0t11d0
/dev/dsk/c3t11d1
/dev/dsk/c0t11d1
/dev/dsk/c3t11d2
/dev/dsk/c0t11d2
/dev/dsk/c3t11d3
/dev/dsk/c0t11d3


2. /dev/vgXX 디렉토리 존재하나 확인
hostname :/dev/vg02] ls -alt
total 16
dr-xr-xr-x 18 bin bin 8192 Jan 10 10:04 ..
drwx------ 2 root sys 96 Dec 14 2007 .
crw------- 1 root sys 64 0x020000 Dec 14 2007 group
안쓰는 VG02 로 VG 사용


3. 스크립트 생성
/tmp/lvm/pvcreate_vg02.sh 생성
pvcreate -f /dev/rdsk/c0t11d4
pvcreate -f /dev/rdsk/c3t11d4
pvcreate -f /dev/rdsk/c0t11d5
pvcreate -f /dev/rdsk/c3t11d5
pvcreate -f /dev/rdsk/c0t11d6
pvcreate -f /dev/rdsk/c3t11d6
pvcreate -f /dev/rdsk/c0t11d7
pvcreate -f /dev/rdsk/c3t11d7
pvcreate -f /dev/rdsk/c0t12d0
pvcreate -f /dev/rdsk/c3t12d0
pvcreate -f /dev/rdsk/c0t12d1
pvcreate -f /dev/rdsk/c3t12d1
pvcreate -f /dev/rdsk/c0t12d2
pvcreate -f /dev/rdsk/c3t12d2
pvcreate -f /dev/rdsk/c0t12d3
pvcreate -f /dev/rdsk/c3t12d3
pvcreate -f /dev/rdsk/c0t12d4
pvcreate -f /dev/rdsk/c3t12d4
pvcreate -f /dev/rdsk/c0t12d5
pvcreate -f /dev/rdsk/c3t12d5
pvcreate -f /dev/rdsk/c0t12d6
pvcreate -f /dev/rdsk/c3t12d6
pvcreate -f /dev/rdsk/c0t12d7
pvcreate -f /dev/rdsk/c3t12d7
pvcreate -f /dev/rdsk/c0t13d0
pvcreate -f /dev/rdsk/c3t13d0
pvcreate -f /dev/rdsk/c0t13d1
pvcreate -f /dev/rdsk/c3t13d1
pvcreate -f /dev/rdsk/c0t13d2
pvcreate -f /dev/rdsk/c3t13d2
pvcreate -f /dev/rdsk/c0t13d3
pvcreate -f /dev/rdsk/c3t13d3
pvcreate -f /dev/rdsk/c0t13d4
pvcreate -f /dev/rdsk/c3t13d4
pvcreate -f /dev/rdsk/c0t13d5
pvcreate -f /dev/rdsk/c3t13d5
pvcreate -f /dev/rdsk/c0t13d6
pvcreate -f /dev/rdsk/c3t13d6


4. VG 만들다 잘못됐을경우
# vgchange -a n /dev/vg02
# vgexport vg02
로 하면 /dev/vg02 와 vg02 가 삭제됨

# mkdir /dev/vg02
# mknod /dev/vg02/group c 64 0x020000
으로 만들어주면 됨


5. vgcreate 스크립트 생성
-p 는 PV 갯수라서 255개로 넉넉히 줌 (기본값이 16)
-s 는 PE 사이즈라서 32MB 로 만듬 (기본값이 4)

# vgcreate_vg02.sh 생성
hostname :/tmp/lvm] cat vgcreate_vg02.sh
vgcreate -p 255 -s 32 vg02 \
/dev/dsk/c0t11d4 \
/dev/dsk/c3t11d4 \
/dev/dsk/c0t11d5 \
/dev/dsk/c3t11d5 \
/dev/dsk/c0t11d6 \
/dev/dsk/c3t11d6 \
/dev/dsk/c0t11d7 \
/dev/dsk/c3t11d7 \
/dev/dsk/c0t12d0 \
/dev/dsk/c3t12d0 \
/dev/dsk/c0t12d1 \
/dev/dsk/c3t12d1 \
/dev/dsk/c0t12d2 \
/dev/dsk/c3t12d2 \
/dev/dsk/c0t12d3 \
/dev/dsk/c3t12d3 \
/dev/dsk/c0t12d4 \
/dev/dsk/c3t12d4 \
/dev/dsk/c0t12d5 \
/dev/dsk/c3t12d5 \
/dev/dsk/c0t12d6 \
/dev/dsk/c3t12d6 \
/dev/dsk/c0t12d7 \
/dev/dsk/c3t12d7 \
/dev/dsk/c0t13d0 \
/dev/dsk/c3t13d0 \
/dev/dsk/c0t13d1 \
/dev/dsk/c3t13d1 \
/dev/dsk/c0t13d2 \
/dev/dsk/c3t13d2 \
/dev/dsk/c0t13d3 \
/dev/dsk/c3t13d3 \
/dev/dsk/c0t13d4 \
/dev/dsk/c3t13d4 \
/dev/dsk/c0t13d5 \
/dev/dsk/c3t13d5 \
/dev/dsk/c0t13d6 \
/dev/dsk/c3t13d6

Volume group "/dev/vg02" has been successfully created.
Volume Group configuration for /dev/vg02 has been saved in /etc/lvmconf/vg02.conf
위와 같이 뜨면 성공


6. LV 생성
PE Size * Total PE 를 곱하면 220096 사이즈가 나옴

hostname :/tmp/lvm] lvcreate -L 220096 vg02
Logical volume "/dev/vg02/lvol1" has been successfully created with
character device "/dev/vg02/rlvol1".
Logical volume "/dev/vg02/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg02 has been saved in /etc/lvmconf/vg02.conf


7. filesystem 생성
-F 는 vxfs 를 사용하고 -o largefiles 를 넣어줘야 대용량 파일을 핸들링할 수 있음

hostname :/] newfs -F vxfs -o largefiles /dev/vg02/rlvol1
version 5 layout
225378304 sectors, 225378304 blocks of size 1024, log size 16384 blocks
unlimited inodes, largefiles supported
225378304 data blocks, 225305112 free data blocks
6878 allocation units of 32768 blocks, 32768 data blocks


8. fstab 수저
/etc/fstab 에 추가
/dev/vg02/lvol1 /home2 vxfs delaylog 0 2


9. 부팅시 자동으로 마운트 되게 하기 (클러스터 볼륨일 경우 기본값이 0으로 Disable 임)
/etc/lvmrc 에
AUTO_VG_ACTIVATE=1


10. 확인
cmviewcl 확인

# cmhaltnode hostname
으로 node 를 죽인후 리부팅
# reboot

마운트해서 제대로 올라오나 확인후

# cmrunnode hostname 
으로 클러스터에 다시 조인

hostname :/] bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 10485760 6526600 3928256 62% /
/dev/vg00/lvol1 512499 161500 299749 35% /stand
/dev/vg00/lvol7 10485760 4843480 5599464 46% /var
/dev/vg00/lvol10 16777216 2005008 13848951 13% /var/adm/crash
/dev/vg00/lvol6 6291456 2814960 3449400 45% /usr
/dev/vg00/lvol5 1048576 735352 310808 70% /tmp
/dev/vg00/lvol4 6291456 4079104 2195088 65% /opt
/dev/vg02/lvol1 225378304 71708 211224941 0% /home2

정상으로 확인됨.


덧글

댓글 입력 영역