HP-UX LVM Quick Guide (export, import)
* LVM (불변)
1. (PVRA/VGRA) Disk - userdata (k*)
 
2. Memory (LVM Kernel)
vgchange -a n vg01
vgchange -a y vg01
 
3. /etc/lvmtab (File System)
vgexport vg01 (mapfile myfs, rmyfs)
vgimport vg01
 
4. /dev/vg01/*group
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x010000
 
 
<< LVM Quick Guide >>
 
# strings /etc/lvmtab
/dev/vg00
<=:G
/dev/dsk/c2t6d0
; LVM 테이블에는 c2t6d0 디스크만 사용중

# ioscan -funC disk
Class     I  H/W Path       Driver S/W State   H/W Type     Description
=======================================================================
disk      0  10/0/15/0.5.0  sdisk CLAIMED     DEVICE       HP 73.4GST373207LC
                           /dev/dsk/c2t5d0   /dev/rdsk/c2t5d0
disk      1  10/0/15/0.6.0  sdisk CLAIMED     DEVICE       FUJITSU MAJ3182MC
                           /dev/dsk/c2t6d0   /dev/rdsk/c2t6d0
; /dev/dsk/c2t5d0 디스크가 있지만, lvmtab 에 포함되어있지 않음, LVM 에 추가해야함
  (하드웨어와 하드웨어 path 만 존재하고, 디스크를 사용할 수 없는 상황)

# pvcreate -f /dev/rdsk/c2t5d0
Physical volume "/dev/rdsk/c2t5d0" has been successfully created.

# mkdir /dev/vg01
; vg01 볼륨그룹 이름과 동일하게 /dev/* 에 만들어줌

# ll /dev/vg01
; 아무런 파일도 존재하지 않음

# mknod /dev/vg01/group c 64 0x010000
; group 파일은 항상 존재해야하며 이름은 변경되어선 안된다. Character 타잎, 주/보조 어드레스 지정

# vgcreate vg01 /dev/dsk/c2t5d0
Increased the number of physical extents per physical volume to 17501.
Volume group "/dev/vg01" has been successfully created.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
; vg01 볼륨그룹에 c2t5d0 디스크 추가 (lvmtab 파일에 적용됨)

# strings /etc/lvmtab
/dev/vg00
<=:G
/dev/dsk/c2t6d0
/dev/vg01
/dev/dsk/c2t5d0
; lvmtab 에 c2t5d0 디스크가 추가되어있다 (확인)

# lvcreate -L 32 -n myfs vg01
Logical volume "/dev/vg01/myfs" has been successfully created with
character device "/dev/vg01/rmyfs".
Logical volume "/dev/vg01/myfs" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
; 32MB 짜리 myfs 라는 로지컬볼륨을 vg01 에 생성

# newfs -F vxfs /dev/vg01/rmyfs
    version 4 layout
    32768 sectors, 32768 blocks of size 1024, log size 1024 blocks
    unlimited inodes, largefiles not supported
    32768 data blocks, 31672 free data blocks
    1 allocation units of 32768 blocks, 32768 data blocks
; JFS 파일시스템으로 /dev/dsk/myfs 포맷

# mkdir /mnt
; /mnt 마운트포인트 생성

# mount /dev/vg01/myfs /mnt
; myfs 를 /mnt 에 마운트

# cp /usr/bin/k* /mnt
; /usr/bin/ 에서 k* 로 시작되는 파일 카피 (vgimport, vgexport 때 확인할 내용)

# ls -l /mnt        
총 4248 블록입니다.
-r-xr-xr-x   1 root       sys          16384 6월  9일 02:48 kdestroy
-r-sr-sr-x   1 root       sys        1699840 6월  9일 02:48 kermit
-r-xr-xr-x   1 root       sys          12288 6월  9일 02:48 keylogin
-r-xr-xr-x   1 root       sys          12288 6월  9일 02:48 keylogout
-r-xr-xr-x   1 root       sys          16384 6월  9일 02:48 kill
-r-xr-xr-x   1 root       sys          45056 6월  9일 02:48 kinit
-r-xr-xr-x   1 root       sys          98304 6월  9일 02:48 kks
-r-xr-xr-x   1 root       sys          16384 6월  9일 02:48 kkstat
-r-xr-xr-x   1 root       sys          57344 6월  9일 02:48 klist
-r-xr-xr-x   1 root       sys          20480 6월  9일 02:48 kpasswd
-r-xr-xr-x   1 root       sys         159744 6월  9일 02:48 ksh
-r-xr-xr-x   1 root       sys          20480 6월  9일 02:48 kvno
drwxr-xr-x   2 root       root            96 6월  9일 02:48 lost+found
 
 
 
 
 
<< LVM VGEXPORT Quick Guide >>

# umount /mnt
; 마운트되었던 /mnt 언마운트

# vgchange -a n vg01
Volume group "vg01" has been successfully changed.
; vg01 볼륨그룹 비활성화

# vgexport -v -m /tmp/vg01.map vg01
Beginning the export process on Volume Group "vg01".
/dev/dsk/c2t5d0
Volume group "vg01" has been successfully removed.
; vg01 볼륨그룹을 -v, -m map_filename의 옵션으로 export한다

# strings /etc/lvmtab
/dev/vg00
<=:G
/dev/dsk/c2t6d0
; vg01 제거됨

# ll /dev/vg01
/dev/vg01이(가) 없습니다.

# rmsf -a /dev/dsk/c2t5d0
; 마운트포인터 제거 -a 옵션을 해줌으로서 캐릭터 디바이스도 제거가 된다. (dsk & rdsk)

# ioscan -funC disk
Class     I  H/W Path       Driver S/W State   H/W Type     Description
=======================================================================
disk      1  10/0/15/0.6.0  sdisk CLAIMED     DEVICE       FUJITSU MAJ3182MC
                           /dev/dsk/c2t6d0   /dev/rdsk/c2t6d0
; c2t5d0 디스크를 실제로 뺀 상황이다 (가상)
 
 
 
 
<< LVM VGIMPORT Quick Guide >>
 

# ioscan -fnC disk (다른 시스템에 디스크를 물린것처럼 시뮬레이션)
Class     I  H/W Path       Driver S/W State   H/W Type     Description
=======================================================================
disk      0  10/0/15/0.5.0  sdisk CLAIMED     DEVICE       HP 73.4GST373207LC
disk      1  10/0/15/0.6.0  sdisk CLAIMED     DEVICE       FUJITSU MAJ3182MC
                           /dev/dsk/c2t6d0   /dev/rdsk/c2t6d0
; 새로운 하드웨어 스캔하여, '10/0/15/0.5.0' 를 찾았다.

# insf
insf: Installing special files for sdisk instance 0 address 10/0/15/0.5.0
; Install Special File 로 '/dev/dsk/c2t5d0, /dev/rdsk/c2t5d0' 추가됨

# ioscan -funC disk
Class     I  H/W Path       Driver S/W State   H/W Type     Description
=======================================================================
disk      0  10/0/15/0.5.0  sdisk CLAIMED     DEVICE       HP 73.4GST373207LC
                           /dev/dsk/c2t5d0   /dev/rdsk/c2t5d0
disk      1  10/0/15/0.6.0  sdisk CLAIMED     DEVICE       FUJITSU MAJ3182MC
                           /dev/dsk/c2t6d0   /dev/rdsk/c2t6d0

# mkdir /dev/vg01
; vg01 생성

# mknod /dev/vg01/group c 64 0x010000
; group 생성

# vgimport -v -m /tmp/vg01.map vg01 /dev/dsk/c2t5d0
Beginning the import process on Volume Group "vg01".
Logical volume "/dev/vg01/myfs" has been successfully created
with lv number 1.
Volume group "/dev/vg01" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.
; vg01.map 파일을 기존시스템에서 갖고와야한다. 맵파일을 참조하여 vgimport 함

# strings /etc/lvmtab
/dev/vg00
<=:G
/dev/dsk/c2t6d0
/dev/vg01
/dev/dsk/c2t5d0
; c2t5d0 가 추가되었다.

# mount /dev/vg01/myfs /mnt (실패)
/dev/vg01/myfs: No such device or address
; vg01 볼륨활성화를 하지 않아여, 마운트가 되지 않는다

# vgchange -a y vg01
Activated volume group
Volume group "vg01" has been successfully changed.
; vg01 볼륨 활성화

# mount /dev/vg01/myfs /mnt (성공)
 ; myfs 를 /mnt 에 마운트

# lsf /mnt
kdestroy*    keylogin*    kill*        kks*         klist*       ksh*         lost+found/
kermit*      keylogout*   kinit*       kkstat*      kpasswd*     kvno*
; 파일내용 확인, 내용이 지워지지 않고 그대로 import 되었다.

이 글과 관련있는 글을 자동검색한 결과입니다 [?]

by 까나리 | 2008/06/09 21:54 | 시스템 | 트랙백 | 덧글(0)
트랙백 주소 : http://kkanari.egloos.com/tb/3778361
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]

:         :

:

비공개 덧글

◀ 이전 페이지 다음 페이지 ▶