문 서 명 : Redhat Linux LVM 관리 문 서 버 전 : Ver_1.0 문 서 구 분 : ■ Manual □ Summary 작 성 일 : 2016년 04월 19일 작 성 자 : 우리들의 삶 테 스 트 환 경 : Redhat Entprise Linux 6.7 출 처 : 본인 |
- 개요
.png)
- 디스크 확인
[root@hsy-test ~]# fdisk -l Disk /dev/sda: 17.2 GB, 17179869184 bytes 64 heads, 32 sectors/track, 16384 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000e305e Device Boot Start End Blocks Id System /dev/sda1 * 2 501 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 502 16384 16264192 8e Linux LVM Partition 2 does not end on cylinder boundary. Disk /dev/mapper/vg_hsytest-lv_root: 14.9 GB, 14935916544 bytes 255 heads, 63 sectors/track, 1815 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/vg_hsytest-lv_swap: 1715 MB, 1715470336 bytes 255 heads, 63 sectors/track, 208 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdb: 1073 MB, 1073741824 bytes 34 heads, 61 sectors/track, 1011 cylinders Units = cylinders of 2074 * 512 = 1061888 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 |
- PV 만들기
[root@hsy-test ~]# pvcreate /dev/sdb <-- PV(Phisycal Volume) 생성 명령어 [root@hsy-test ~]# pvs <-- PV 리스트 확인, # pvdisplay 명령을 통해서도 확인 가능 PV VG Fmt Attr PSize PFree /dev/sda2 vg_hsytest lvm2 a-- 15.51g 0 /dev/sdb lvm2 --- 1.00g 1.00g <-- 물리디스크 /dev/sdb 가 LVM2버전으로 PV 전환되었음을 알 수 있다. |
- VG 만들기
[root@hsy-test ~]# vgcreate vg_raw /dev/sdb <-- VG(Volume Group) 생성 명령어, 만약 여러개의 PV를 묶어 Pool 처럼 만들고자 할 때에는 띄어쓰기하여 디스크 장치를 명시해준다. Volume group "vg_raw" successfully created [root@hsy-test ~]# vgs <-- VG 리스트 확인 # vgdisplay 명령을 통해서도 확인 가능 VG #PV #LV #SN Attr VSize VFree vg_hsytest 1 2 0 wz--n- 15.51g 0 vg_raw 1 0 0 wz--n- 1020.00m 1020.00m |
- LV 만들기
[root@hsy-test ~]# lvcreate -n dev1G1 -L 100M vg_raw Logical volume "dev1G1" created. TIP : -n : LV Name을 지정 -L : LV Size를 지정 vg_raw : LV가 속할 VG를 명시 [root@hsy-test ~]# lvs <- LV 리스트 확인, # lvscan 혹은 # lvdisplay 명령으로도 확인 가능 LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lv_root vg_hsytest -wi-ao---- 13.91g lv_swap vg_hsytest -wi-ao---- 1.60g dev1G1 vg_raw -wi-a----- 100.00m [root@hsy-test ~]# ls -al /dev/vg_raw/dev1G1 <-- 해당 위치를 mkfs 명령을 통해 포맷하여 mount 하면 된다. lrwxrwxrwx. 1 root root 7 2016-04-18 11:03 /dev/vg_raw/dev1G1 -> ../dm-2 tip : /dev/VG_name/LV_name |
- LV 여러개를 만들어야 될 때
#!/bin/sh index=1 while [ ${index} -le 42 ];do lvcreate -n dev10G${index} -L 10G vg_raw index=$((index + 1)) done |
'시스템 > Operating System' 카테고리의 다른 글
[VMware, Redhat 6] VM환경의 Linux OS 디스크 사이즈 늘리기 (0) | 2016.11.02 |
---|---|
[Solaris] 솔라리스 패스워드 복잡성 설정 (0) | 2016.09.30 |
[Redhat 6] RAW Device 생성 및 관리 방법 (0) | 2016.09.06 |
[Linux, AIX] LV 여러개 만들 때 유용한 스크립트!! (0) | 2016.09.06 |
[Redhat 6] CPU Core Disable 하는 방법!! (0) | 2016.09.06 |