sar 간단 정리sar 간단 정리

Posted at 2012. 11. 12. 01:21 | Posted in OS/Unix/Linux

sar 에서 날짜가 깨져서 나올때, (mpstat, vmstat 등 다른 도구들도 마찬가지)

LC_TIME=C 로 설정하면 됨. (LC_TIME= 하면 원래대로 돌아감. LC_ALL 또는 LANG 의 값을 사용하게 됨.)

LANG 또는 LC_ALL=C로 해도 무방. 자세한건 locale 설정 방법 검색 ㄱㄱ


sar [-u] 가 기본

sar -s <hh:mm:ss> -e <hh:mm:ss>  로 시작/끝 시간 지정할 수 있다.

sar <interval> <count> 로 정해진 주기로 자동 호출되게 할 수 있다.

sar -f /var/log/sa/sa16  해당날짜(16일)의 통계를 본다.


sar -A  모든 정보 출력

sar -c  새롭게 만들어져 활동하고 있는 프로세스

sar -n DEV | EDEV | SOCK  네트워크 통계 (DEV: network device 통계, EDEV: network device 에러 통계, SOCK: socket 통계)

sar -q  실행 대기 중인 프로세스를 점검. 시스템의 load average를 나타낸다.


각 옵션별 상세 설명은 여기 참조: http://www.cubrid.com/zbxe/71317


//

[linux] log files & how to see[linux] log files & how to see

Posted at 2012. 9. 16. 13:53 | Posted in OS/Unix/Linux

/var/log/wtmp : 사용자 login & logout & reboot 로그

$ last


/var/log/btmp : 로그인 실패 로그

$ lastb

짱깨들이 로그인하려고 돌린 흔적으로 용량이 300MB가 넘었다..
-rw------- 1 root utmp 309M Jun 11 11:55 btmp

test     ssh:notty    119.10.114.184   Mon Apr 16 19:37 - 19:37  (00:00)
test     ssh:notty    119.10.114.184   Mon Apr 16 19:37 - 19:37  (00:00)
oracle   ssh:notty    119.10.114.184   Mon Apr 16 19:37 - 19:37  (00:00)
oracle   ssh:notty    119.10.114.184   Mon Apr 16 19:37 - 19:37  (00:00)
root     ssh:notty    119.10.114.184   Mon Apr 16 19:37 - 19:37  (00:00)
root     ssh:notty    119.10.114.184   Mon Apr 16 19:37 - 19:37  (00:00)
root     ssh:notty    119.10.114.184   Mon Apr 16 19:36 - 19:36  (00:00)
root     ssh:notty    119.10.114.184   Mon Apr 16 19:36 - 19:36  (00:00)
unabv    ssh:notty    119.10.114.184   Mon Apr 16 19:36 - 19:36  (00:00)
unabv    ssh:notty    119.10.114.184   Mon Apr 16 19:36 - 19:36  (00:00)
rramirez ssh:notty    119.10.114.184   Mon Apr 16 19:36 - 19:36  (00:00)   

$ whois 119.10.114.184
[Querying whois.arin.net]
[Redirected to whois.apnic.net]
[Querying whois.apnic.net]
[whois.apnic.net]
% [whois.apnic.net node-3]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

inetnum:        119.10.0.0 - 119.10.127.255
netname:        XinnetIDC
country:        CN
descr:          XinNet Technology Corp.
descr:          1st Floor, 2nd Building Section A,
descr:          BDA BeiGongDa Soft-ware Area, Beijing China.  <-- 중국애들 맞네..


파일 비우기(clear btmp)

cat /dev/null > /var/log/btmp


/var/log/messages : 시스템 에러 및 하드웨어 에러 로그

$ vi messages


/var/log/secure : 사용자 인증관련 로그

$ vi secure


/var/log/lastlog : 사용자 최종 로그인 정보

$ lastlog


현재 접속자 정보 보기

$ w

$ who

//

[linux] sshd 보안 설정[linux] sshd 보안 설정

Posted at 2012. 9. 16. 13:48 | Posted in OS/Unix/Linux

출처: http://mrain7.egloos.com/2391163


/etc/ssh/sshd_config


Root 로그인 차단

공격자 또는 내부 사용자가 root로 접근 가능할 경우 암호 무작위 입력으로 권한을 획득할 수 있습니다. 따라서, root 로그인을 차단, 일반 계정을 통하여 접근토록 하여야 합니다.Root 로그인 허용이 yes로 되어 있으면 no로 수정합니다.

#PermitRootLogin no

- 주석처리를 지우면 된다.


Forwarding 막기

만약, TCP 포트와 X11에 대한 포워드 기능을 사용하지 않는다면 비활성화 하시기 바랍니다.

AllowTcpForwarding no

X11Forwarding no


호스트 기반 인증 차단

Rhosts 사용이나 hosts.equiv를 통한 인증을 차단합니다. Rhost는 보안상 취약함으로 비활성화 합니다.

IgnoreRhosts yes

HostbasedAuthentication no

RhostsRSAAuthentication no




Port 변경하기

Port <변경할포트번호>


ssh port를 변경한 경우 클라이언트 측에서는 다음과 같은 설정을 해두고 사용하면 편하다.

http://blog.naver.com/deepblue28?Redirect=Log&logNo=140157240471&from=postView


해당 IP만 접속 허가 또는 거부

/etc/host.allow 와 host.deny




* 그 외 상세 설정은 evernote에 정리돼 있다. (어디에 적었뒀는지 까먹어대서..)

* ssh brute force attack을 막기 위해 fail2ban 을 사용해보자.

//

[ubuntu] open files limit 변경하기[ubuntu] open files limit 변경하기

Posted at 2012. 9. 16. 13:40 | Posted in OS/Unix/Linux

redhat(centOS 등)계열은 ulimit -n 으로 쉽게 설정 가능하나,

우분투는 잘 안되네..

다음과 같이 해서 해결.


system-wide limit on the number of open files for all processes

$ cat /proc/sys/fs/file-max

148608

 

계정별 open file limit

$ ulimit -n

1024

 


다음 2개 파일을 수정 (box안의 내용을 추가)


/etc/pam.d/common-session ==> 안해도 됨 (/etc/pam.d/login 에 설정돼 있네..)

session    required   pam_limits.so


/etc/security/limits.conf

*   ?   nofile     6000

 


<reboot>

$ ulimit -n

6000

//

[Ubuntu] downgrade subversion 1.7 to 1.6[Ubuntu] downgrade subversion 1.7 to 1.6

Posted at 2012. 9. 16. 13:37 | Posted in OS/Unix/Linux

이클립스 subclipse를 깔았다가, javaHL 버전이 안맞느니 어쩌고 해서

인터넷을 뒤져 1.7.x로 업그레이드 했더니, 기존 repository와 호환이 안되는 문제 발생.

다시 1.6으로 다운그레이드 했다..


(1) 1.7 버전 제거

저장소 정보는 subversion 1.7.x로 맞춰진 상황..

시냅틱 패키지 관리자로 들어가서 subversion, libsn-java, libsvn1 을 삭제.


(2) 1.6 다운로드

패키지 다운로드: http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu/pool/main/s/subversion/


다음 3개를 다운로드 받고 순서대로 설치하면 된다.

libsvn1_1.6.5dfsg-1ubuntu1~hardy1~andersk1_amd64.deb

libsvn-java_1.6.5dfsg-1ubuntu1~hardy1~andersk1_amd64.deb

subversion_1.6.5dfsg-1ubuntu1~hardy1~andersk1_amd64.deb

 

(3) 설치

그냥 설치하면, libneon27, libdb4.6 의존성 어쩌고 하면서 안될텐데, 이 라이브러리들도 의존성 문제로 안된다.

강제로 설치해준다.


$ sudo apt-get -f install libneon27 libdb4.6


그리고, 위에서 다운 받은 3개를 순서대로 설치해준다.


$ sudo dpkg -i libsvn1_1.6.5dfsg-1ubuntu1~hardy1~andersk1_amd64.deb

$ sudo dpkg -i libsvn-java_1.6.5dfsg-1ubuntu1~hardy1~andersk1_amd64.deb

$ sudo dpkg -i subversion_1.6.5dfsg-1ubuntu1~hardy1~andersk1_amd64.deb

$ svn --version --quiet[버전 확인]

//

[linux] cpu info[linux] cpu info

Posted at 2012. 9. 16. 13:30 | Posted in OS/Unix/Linux

물리 cpu 수(설치된 소켓번호)

$ grep “physical id” /proc/cpuinfo | uniq

physical id : 1


물리 cpu 당 코어수

$ grep “cores” /proc/cpuinfo | uniq

cpu cores : 6


하이퍼쓰레딩 적용 여부: “cpu cores”수와 같으면 off, 배수 이면 on

$ grep “siblings” /proc/cpuinfo | uniq

siblings : 12


물리 cpu별 코어 id

$ grep “core id” /proc/cpuinfo | uniq

core id : 0

core id : 1

core id : 2

core id : 8

core id : 9

core id : 10

core id : 0

core id : 1

core id : 2

core id : 8

core id : 9

core id : 10


참고) http://www.richweb.com/cpu_info

//

ubuntu,centos - equinox-faenza theme installubuntu,centos - equinox-faenza theme install

Posted at 2012. 4. 15. 19:41 | Posted in OS/Unix/Linux


equinox gtk engine

* 미리 설치 할 것들

- yum install gtk2-devel   (redhat 계열)

- sudo apt-get install libgtk2.0-dev  (ubuntu)


* Install

http://gnome-look.org/content/show.php?content=121881&forumpage=1&PHPSESSID=ccac437ae6db2b803984fb3588d80cd8http://gnome-look.org/content/show.php?content=121881&forumpage=1&PHPSESSID=ccac437ae6db2b803984fb3588d80cd8

tar xzf 121881-equinox-1.50.tar.gz

cd equinox-1.50

./configure --prefix=/usr --enable-animation

./configure --prefix=/usr --libdir=/usr/lib64 --enable-animation

make

make install 



faenza icon theme

http://code.google.com/p/faenza-icon-theme/downloads/detail?name=faenza-icon-theme_1.1.tar.gz&can=2&q=

faenza-icon-theme_1.1.tar.gz 를 다운 받고 임의의 디렉토리 아래에 풀어놓고 /usr/share/icons 디렉토리로 옮겨놓으면 된다.


equinox evolution themes

http://gnome-look.org/content/show.php?content=140449

140449-equinox-themes-1.50.tar.gz 를 다운 받고, "System > Preference > Appearence" 에서 "설치" 를 눌러 다운 받은 tar.gz 파일을 선택하면 된다.

※ 설치한 테마는 ~/.themes 디렉토리에 저장된다. 잘못 설치했으면 지워주자.



//

[Ubuntu] 우분투 설치 후 할 일들[Ubuntu] 우분투 설치 후 할 일들

Posted at 2011. 6. 3. 14:11 | Posted in OS/Unix/Linux

<한글입력기>

  • "시스템 > 관리 > 언어" 에서 "키보드 입력 시스템"을 'nabi'로 변경. (왼쪽shift+space 한영전환 가능)


<Locale>

  • 기본은 LANG=ko_KR.utf8 이다. ko_KR.euckr을 사용하려면 locale을 생성해줘야 한다. 다음 순서로 한다.
    (Locale 설정을 잘못 건든 경우 아래 순서로 작업해주면 된다.)
  • $ sudo apt-get install language-pack-ko
  • $ sudo locale-gen ko_KR.EUC-KR
  • $ sudo dpkg-reconfigure locales
  • $ locale -a      --> 사용가능한 locale 확인


<Font 설정>

  • 나눔고딕, 네이버사전체 설치 (파일 풀어놓고 노틸러스에서 더블클릭하면 바로 설치할 수 있다)
  • 우분투는 안티앨리어싱이 기본으로 꺼져있으므로 켜준다.
    (http://ihoney.pe.kr/635)
    $ sudo gedit /etc/fonts/conf.d/29-language-selector-ko-kr.conf 을 열고 
    <!-- Turn off antialias and autohint for Korean fonts depending on pixelsize --> 부분과
    <!-- Turn off antialias and autohint for ttf-alee depending on pixelsize --> 부분을 주석처리
  • Monospace 폰트가 잘못 지정된 경우 폰트매핑 정보를 수정해 준다. (다른 폰트 역시 아래 방법으로 매핑 가능)

    $ sudo vi /etc/fonts/conf.d/69-language-selector-ko-kr.conf

    <match target="pattern">

        <test qual="any" name="family">

            <string>monospace</string>

        </test>

        <edit name="family" mode="prepend" binding="strong">

            <string>Liberation Mono</string>

            <string>DejaVu Sans Mono</string>

    <string>나눔고딕코딩</string>       <!-- 영문, 한글 폰트를 먼저 나온 순서로 찾으므로 원하는 폰트를 적어준다. -->

            <string>네이버사전</string>

            <string>UnDotum</string>

            <string>Guseul</string>

        </edit>

    </match>



<테마>

  • 아이콘 테마: simple (http://gnome-look.org/content/show.php/Simple?content=99470)
    - 테마 파일을 다운로드 받은 후 "시스템 > 기본설정 > 모양" 테마 탭에서 "설치..." 를 눌러 설치한다.
  • Equinox GTK Theme + Faenza Icon Theme: http://www.techdrivein.com/2010/08/equinox-gtk-theme-faenza-icon-theme.html
    $ sudo add-apt-repository ppa:tiheum/equinox && sudo apt-get update
    $ sudo apt-get install gtk2-engines-equinox equinox-theme equinox-ubuntu-theme faenza-icon-theme
    ※ 만약 설치가 안되면 "프로그램 > 우분투 소프트웨어 센터" 에서 equinox, faenza 로 찾아서 설치.
  • Equinox GTK - Light 테마 + Droid Sans/Droid Sans Mono 폰트 조합이 이쁨.


<SSH>

  • ssh 접속 오래 걸리는 문제: GSS 인증 옵션을 끈다.
    $ ssh -o GSSAPIAuthentication=no -l <id> <host> 


<Samba>


<개발환경>

  •  설치 목록
    $ sudo apt-get install gcc
    $ sudo apt-get install g++
    $ sudo apt-get install byacc
    $ sudo apt-get install libssl-dev
    $ sudo apt-get install zlib1g-dev
    $ sudo apt-get install libxml2-dev
    $ sudo apt-get install subversion
    $ sudo apt-get install libsvn-java
    $ sudo apt-get install vim

    ※ 진행이 안되는 경우 'sudo apt-get update'로 저장소 정보를 다시 읽어 오거나, 시냅틱 패키지 관리자에서 저장소 위치를 변경해 본다.

  • java 우선순위 설정 (OpenJDK, Sun/OracleJDK 선택)
    $ sudo update-alternatives --config java
  • eclipse.ini 추가 (Xms, Xmx 동일하게 두면 heap 확보를 위해 늘었다 줄었다 하지 않음)
    -XX:MaxPermSize=256m
    -Xms512m
    -Xmx512m
    -XX:PermSize=128m
    -XX:+UseParallelGC


<파일 관리>

  • 휴지통 호환 커맨드 라인 파일 삭제 도구: trash-cli (http://code.google.com/p/trash-cli/)
    - rm에 해당하는 trash-put 을 실행하면 휴지통으로 파일을 이동시킨다.
    - 노틸러스 휴지통과 호환된다. (FreeDesktop.org Trash 스펙을 구현했다)
    - alias rm='/usr/local/bin/trash-put' 으로 설정해두고 쓰면 된다. rm 옵션과 호환성을 제공하며 -f 옵션은 무시된다. 무조건 휴지통으로 이동됨.


<원격데스크탑>



<기타>


<우분투 Unity 제거>


<11.10 이후 버전>

  • synaptic package manager 설치.
    - sudo apt-get install synaptic


<Nvidia 그래픽 카드 드라이버 설치>
(주의그래픽 카드는 기본 설치된 드라이버를 잡아주길 권장하며, 강제로 설치할 경우 아래 순서로)

  • 그래픽 카드 확인
    $ lspci |grep -i -e Display -e VGA
  • Nvidia 그래픽 카드 설치
    - X를 종료한 후 터미널에서 작업
    - nvidia 드라이버를 다운로드하여 설치하면 "Nouveau kernel driver"를 사용중이어서 설치할 수 없다고 에러를 뱉는다.
    - $ sudo apt-get --purge remove xserver-xorg-video-nouveau 명령으로 nouveau 드라이버 제거
    - $ sudo ./NVIDA-Linux-버전.run 을 실행. 만약 진행이 안된다면 다음과 같이 강제 설치.
    - $ sudo ./NVIDA-Linux-버전.run -k $(uname -r) -f
    - PC 재시작
    - 부팅되면 하드웨어 드라이버 검색에서 NVIDIA 드라이버가 2개 뜨는데, (권장)으로 된것 말고 새로 설치된 것을 선택.
    - "시스템 > 관리 > NVIDIA X Server Settings" 로 들어가서 원하는 대로 설정.

  • X 종료
    $ sudo /etc/init.d/gdm stop
  • X 시작
    $ sudo /etc/init.d/gdm start
  • X 재설정
    sudo dpkg-reconfigure xserver-xorg
  • 설정파일
    /etc/X11/xorg.conf
  • 멀티 모니터 설정하기
    - NVIDIA X Server Settings 실행
    - root 권한으로 실행이 안되면 터미널에서 'sudo nvidia-settings'로 실행하면 된다.
    - X Server Display Configuration -> Display -> Configure... 에서 "TwinView"를 선택한다.
    - Make this the primary display for the X screen 체크
    - Save to X Configuration File을 눌러 변경 내용을 저장한다. 이 때 Merge with existing file 은 끈다(체크 해제).
    - 로그아웃 -> 로그인

//

CPU load 이해하기CPU load 이해하기

Posted at 2011. 4. 22. 14:11 | Posted in OS/Unix/Linux
http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages

읽고 정리하기. 
//

KT-ucloud cs 하드디스크 LV 마운트하기KT-ucloud cs 하드디스크 LV 마운트하기

Posted at 2011. 3. 14. 02:27 | Posted in OS/Unix/Linux
KT ucloud cs 서비스를 이용해보기로 했다가 사용자 매뉴얼을 보고 뭔소린지 몰라 이래저래 고생했던 내용들 정리해 본다.

참고한 곳)
http://www.anycoding.com/bbs/board.php?bo_table=acProgram_Etc&wr_id=671 :매뉴얼과 동일한 내용.. 같은분이 매뉴얼을 작성했거나 복사했거나..


KT ucloud 서비스를 사용해보고자 가장 기본 VM을 한대 신청했다. (1 cpu, 1G memory, 100G hdd(20/80))

스토리지는 기본 100GB를 신청했는데, 그림과 같이 20/80 GB로 생성된다.

매뉴얼에 PV(Physical Volume), VG(Volume Group), LV(Logical Volume)을 만들도록 가이드하고 있어 일단 자세히 모르지만 만들어 보도록 한다.(자세한 내용은 위 참고사이트 참조)

부팅된 후 터미널에서 디스크 상태를 살펴보면, /dev/xvdb 에 파티션이 할당되지 않았다고 한다.
이놈이 80GB 디스크이다. 이걸 마운트해서 써먹어야 한다. (이런 내용은 매뉴얼 어디에도 나와 있지 않다.. ;;)

[root@i-955-6459-VM ~]# fdisk -l

Disk /dev/xvdb: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/xvdb doesn't contain a valid partition table

Disk /dev/xvda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          13      104391   83  Linux
/dev/xvda2              14        2610    20860402+  8e  Linux LVM


요렇게 확인해볼 수 있다.
[root@i-955-6459-VM ~]# ls /dev/xv*
/dev/xvc0  /dev/xvda  /dev/xvda1  /dev/xvda2  /dev/xvdb


fdisk를 이용해 /dev/xvdb에 파티션을 생성해준다. (80GB 통으로 잡았고, 밑줄친 부분이 입력한 부분)
[root@i-955-6459-VM ~]# fdisk  /dev/xvdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 10443.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/xvdb: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-10443, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-10443, default 10443): 
Using default value 10443

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e  ==> VG, LV를 사용하려면 반드시 '8e' Linux LVM 타입을 선택!
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


잘 됐는지 확인.
[root@i-955-6459-VM ~]# fdisk -l

Disk /dev/xvdb: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               1       10443    83883366   8e  Linux LVM

Disk /dev/xvda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          13      104391   83  Linux
/dev/xvda2              14        2610    20860402+  8e  Linux LVM


PV 생성.
[root@i-955-6459-VM ~]# pvcreate /dev/xvdb1 
  Physical volume "/dev/xvdb1" successfully created


VG 생성: VG이름을 "DataVG"로 주었다.
[root@i-955-6459-VM ~]# vgcreate DataVG /dev/xvdb1 
  Volume group "DataVG" successfully created


VG 정보 보기.
[root@i-955-6459-VM ~]# vgdisplay 
  --- Volume group ---
  VG Name               DataVG
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               80.00 GB
  PE Size               4.00 MB
  Total PE              20479
  Alloc PE / Size       0 / 0   
  Free  PE / Size       20479 / 80.00 GB
  VG UUID               1Lgw05-rK7Y-t6M4-gm6v-Po6Y-Nktn-oScFfW
   
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               19.88 GB
  PE Size               32.00 MB
  Total PE              636
  Alloc PE / Size       636 / 19.88 GB
  Free  PE / Size       0 / 0   
  VG UUID               5UlLWB-skhS-kYkE-hg3U-TYW7-wgQ0-hfcsJ4


위 참고 사이트에서 PE 크기가 어쩌고 하는 내용이 있다. PE 크기를 16MB로 변경해보자. vgremove 후 다시 vgcreate하면 된다.(이 부분은 좀 더 공부하자.)
[root@i-955-6459-VM ~]# vgremove DataVG
  Volume group "DataVG" successfully removed
[root@i-955-6459-VM ~]# vgcreate -s 16m DataVG /dev/xvdb1
  Volume group "DataVG" successfully created
[root@i-955-6459-VM ~]# vgdisplay 
  --- Volume group ---
  VG Name               DataVG
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               79.98 GB
  PE Size               16.00 MB
  Total PE              5119
  Alloc PE / Size       0 / 0   
  Free  PE / Size       5119 / 79.98 GB
  VG UUID               bdUjjs-gxNi-0170-Gzur-H3aQ-hw2B-5Ug5AQ
   
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               19.88 GB
  PE Size               32.00 MB
  Total PE              636
  Alloc PE / Size       636 / 19.88 GB
  Free  PE / Size       0 / 0   
  VG UUID               5UlLWB-skhS-kYkE-hg3U-TYW7-wgQ0-hfcsJ4


마지막으로 LV를 만들자. 그전에 LV 확인. 기본적으로 생성돼 있는 Logical Volume 들이다.
/dev/VolGroup00/LogVol01 은 swap 파티션이다. (/etc/fstab 파일을 열어보면 알 수 있다.)
[root@i-955-6459-VM ~]# lvdisplay 
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                2EmbII-Vyhb-TkaO-iZDh-dK0c-JKyD-3K10l6
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                15.88 GB
  Current LE             508
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
   
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                EUFrRy-0UTw-3DE3-LL5b-0kKL-dIAX-Gri1kD
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1


LV를 생성해 보자. -L 옵션은 용량을 직접 적을 수 있다. PE를 16MB로 잡아서 80GB를 full로 쓸 수 없다.
[root@i-955-6459-VM ~]# lvcreate -L 80g -n data00 DataVG
  Insufficient free extents (5119) in volume group DataVG: 5120 required

-l 옵션으로 LE(=PE) 수를 직접 지정할 수 있다. 에러 메시지의 '5119'가 최대값이다. 다음과 같이 하면 순순히 만들어 준다..
[root@i-955-6459-VM ~]# lvcreate -l 5119 -n data00 DataVG
  Logical volume "data00" created


LV 정보를 보면 data00이 생성된 것을 볼 수 있다.
[root@i-955-6459-VM ~]# lvdisplay 
  --- Logical volume ---
  LV Name                /dev/DataVG/data00
  VG Name                DataVG
  LV UUID                APPToZ-SZ59-O1LT-zwni-n9zJ-5sbV-ezzJvE
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                79.98 GB
  Current LE             5119
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2
   
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                2EmbII-Vyhb-TkaO-iZDh-dK0c-JKyD-3K10l6
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                15.88 GB
  Current LE             508
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
   
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                EUFrRy-0UTw-3DE3-LL5b-0kKL-dIAX-Gri1kD
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1


이제 /dev/DataVG/data00 를 일반 스토리지처럼 사용하면 된다.

파일 시스템을 만들고,
[root@i-955-6459-VM ~]# mkfs.ext3 /dev/DataVG/data00 
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
10485760 inodes, 20967424 blocks
1048371 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
640 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
4096000, 7962624, 11239424, 20480000

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


마운트 한다.
[root@i-955-6459-VM ~]# mount /dev/DataVG/data00 /mnt/tmp


디스크 정보를 보면 이쁘게 들어와 있다.
[root@i-955-6459-VM ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       16G  1.2G   14G   8% /
/dev/xvda1             99M   14M   81M  15% /boot
tmpfs                 512M     0  512M   0% /dev/shm
/dev/mapper/DataVG-data00
                       79G  184M   75G   1% /mnt/tmp



/mnt/tmp 는 임시로 마운트한 것이고, /home 등 원하는 곳에 마운트하고 쓰면 끝.

그 뒤는 알아서..

사용자 매뉴얼 좀 부실한 듯. 쩝..

//