문 제
어떻게 Online JFS를 이용해서 루트 파일시스템을 확장할 수 있습니까?
fsadm을 사용합니까?
설 정
HP-UX 10.20, 11.X
해 결
HP-UX 버전 10.20 이상의 경우, 루트 파일시스템 "/"는 기본값으로 운영체제가 설치된 후에 VxFS(JFS) 파일시스템으로 설정됩니다.
시스템이 이전 버전의 OS에서 업그레이드되었다면, 다른 경우가 됩니다.
fsadm을 사용하면 대체 부트 디스크를 재설치, 이그나이트(ignite, make*recovery),
또는 생성하지 않고 루트 파일시스템을 확장할 수 있습니다.
이 방법이 성공하기 위해서는 다음 범주를 만족해야 됩니다:
1) 루트 파일시스템은 JFS이어야 합니다.
- 이것은 루트 논리볼륨에서 fstyp 명령을 사용하면 확인할 수 있습니다:
# bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 86016 38741 44347 47% /
# fstyp /dev/vg00/lvol3
vxfs
2) Online JFS 번들이 로드되어야 합니다.
- 이것은 swlist 명령으로 확인할 수 있고, 또한 커널에 로드된 드라이버들을 확인해서 검증되어야 합니다.
11i (11.11)의 경우:
# swlist -l product|grep -i online
OnlineJFS B.11.11 Online features of the VxFS File System
커널에 로드된 드라이버들을 검증하기 위해서:
# /usr/lbin/sysadm/system_prep -s /tmp/system.out;grep ^vx /tmp/system.out
vxdmp_q4
vxfs
vxportal
vxvm_q4
vxvm
vxdmp
vxfs와 vxportal은 11i에서 필요한 드라이버이고 위의 출력에 표시되어야 합니다. 만약 표시되지 않았다면 Online 제품이 정상적으로 로드되지 않았거나 현재 부팅된 시스템의 커널에 존재하지 않는 것입니다.
11.00의 경우:
# swlist|grep -i online
B3929BA B.11.00 HP OnLineJFS (Advanced VxFS)
커널에 로드된 드라이버들을 검증하기 위해서:
# /usr/lbin/sysadm/system_prep -s /tmp/system.out;grep ^vx /tmp/system.out
vxfs
vxfs33_q4_syms
vxportal33
-또는-
vxbase
vxadv
주: 11.00에서 Online 드라이버는 JFS 버전 3.1의 경우 vxadv이고 JFS 버전 3.3의 경우 vxfs와 vxportal33이 될 수 있습니다.
10.20의 경우:
# swlist|grep -i online
B3929BA B.10.20 HP OnLineJFS (Advanced VxFS)
커널에 로드된 드라이버들을 검증하기 위해서:
# /usr/lbin/sysadm/system_prep -s /tmp/system.out;grep ^vx /tmp/system.out
vxadv
vxbase
3) 루트 논리볼륨은 연속적이어야 하고 여러개의 디스크에 걸쳐 존재할 수 없기 때문에 루트 논리볼륨 이후의 디스크에 여유공간이 존재합니다.
- 루트 논리볼륨은 시스템이 LVM 관련 문제발생을 대비해서 LVM 유지모드로 부팅될 수 있어야되기 때문에 연속적이어야 합니다.
디스크의 루트 논리볼륨 이후에 바로 다른 논리볼륨이 있을 수 있기 때문에, 이 다른 논리볼륨은 vg00의 다른 디스크로 이동되어야 합니다.
이것은 pvmove 명령으로 수행될 수 있습니다. 먼저 루트 논리볼륨이 존재하는 디스크를 찾으십시오:
# lvlnboot -v|grep ^Root
Root: lvol3 on: /dev/dsk/c1t6d0
그런다음, 루트 논리볼륨을 증가시키기 위해서 이동될 논리볼륨을 위치시킬 공간을 포함하는 논리볼륨을 찾으십시오:
# pvdisplay -v /dev/dsk/c1t6d0|more
...
0066 current /dev/vg00/lvol3 0013
0067 current /dev/vg00/lvol3 0014
0068 current /dev/vg00/lvol3 0015
0069 current /dev/vg00/lvol3 0016
0070 current /dev/vg00/lvol3 0017
0071 current /dev/vg00/lvol3 0018
0072 current /dev/vg00/lvol3 0019
0073 current /dev/vg00/lvol3 0020
0074 current /dev/vg00/lvol4 0000
0075 current /dev/vg00/lvol4 0001
0076 current /dev/vg00/lvol4 0002
0077 current /dev/vg00/lvol4 0003
0078 current /dev/vg00/lvol4 0004
0079 current /dev/vg00/lvol4 0005
0080 current /dev/vg00/lvol4 0006
0081 current /dev/vg00/lvol4 0007
0082 current /dev/vg00/lvol7 0000
0083 current /dev/vg00/lvol7 0001
0084 current /dev/vg00/lvol7 0002
0085 current /dev/vg00/lvol7 0003
0086 current /dev/vg00/lvol7 0004
...
위와 같은 경우, lvol4이 lvol3(루트) 뒤에 존재하므로 lvol4는 vg00의 다른 디스크로 이동되어야 합니다. 이동을 시키면 이용가능한 물리적 크기(Physical Extent, PE) 74 부터 81까지의 공간만큼 lvol3이 확장될 수 있습니다. 각 PE는 기본값이 4MB이므로, 이 시스템의 lvol3는 32MB 만큼 확장될 수 있습니다. 만약 더 많은 공간이 필요하다면, lvol7이 이동되어야 합니다. vgdisplay 명령은 PE의 크기를 보여줍니다.
lvol4를 이동시키는 명령:
# pvmove -n /dev/vg00/lvol4 /dev/dsk/c1t6d0 /dev/dsk/c1t3d0
Transferring logical extents of logical volume "/dev/vg00/lvol4"...
Physical volume "/dev/dsk/c1t6d0" has been successfully moved.
Volume Group configuration for /dev/vg00 has been saved
in /etc/lvmconf/vg00.conf
/dev/dsk/c1t6d0은 lvol4이 원래 위치했던 디스크이고 /dev/dsk/c1t3d0은 여유공간이 있어서 lvol4이 이동되는 디스크입니다.
논리볼륨이 이동되었는지 확인하고 루트 논리 볼륨 이후에 이용가능한 PE가 존재하는지 확인하십시오:
# pvdisplay -v /dev/dsk/c1t6d0|more
...
0066 current /dev/vg00/lvol3 0013
0067 current /dev/vg00/lvol3 0014
0068 current /dev/vg00/lvol3 0015
0069 current /dev/vg00/lvol3 0016
0070 current /dev/vg00/lvol3 0017
0071 current /dev/vg00/lvol3 0018
0072 current /dev/vg00/lvol3 0019
0073 current /dev/vg00/lvol3 0020
0074 free 0000
0075 free 0000
0076 free 0000
0077 free 0000
0078 free 0000
0079 free 0000
0080 free 0000
0081 free 0000
0082 current /dev/vg00/lvol7 0000
0083 current /dev/vg00/lvol7 0001
0084 current /dev/vg00/lvol7 0002
0085 current /dev/vg00/lvol7 0003
0086 current /dev/vg00/lvol7 0004
...
사용가능한 공간이 존재하기 때문에 루트 논리볼륨은 확장될 수 있습니다.
4) 11.00의 경우 PHKL_19202은 반드시 로드되어야 합니다.
그렇지 않으면, 시스템 장애가 발생합니다.
****************
주:
만약 모든 범주가 만족되지 않는다면, 이 과정은 실패할 것이고 시스템은 불안정한 상태가 됩니다.
****************
파일시스템을 확장하기위해서는, 먼저 논리볼륨을 원하는 크기만큼 확장하십시오.
위의 경우, 이용가능한 32MB 전체가 사용됩니다. 즉, 8만큼의 물리적 크기가 현재 크기에 추가됩니다. 현재 크기를 알기위해서는 다음 명령을 사용하십시오:
# lvdisplay /dev/vg00/lvol3|grep "Allocated PE"
Allocated PE 21
8 PE 만큼을 확장하는 방법:
# lvextend -l 29 /dev/vg00/lvol3
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved
in /etc/lvmconf/vg00.conf
루트 파일시스템의 크기를 섹터단위로 계산하십시오.
섹터의 크기는 KB단위입니다. fsadm 명령은 섹터 단위의 크기를 이용합니다.
위의 경우, 현재 크기는 84MB입니다:
# bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 86016 38749 44340 47% /
주: MB단위의 크기는 다음과 같이 계산합니다. 86016 / 1024 = 84
위의 경우 8MB가 추가되면 새로운 섹터 단위 크기는 다음과 같이 됩니다:
92 * 1024 = 94208
이제 파일시스템을 확장하십시오:
# fsadm -F vxfs -b 94208 /
fsadm: /dev/vg00/rlvol3 is currently 86016 sectors - size will be increased
정상적으로 수행되었는지 확인하십시오:
# bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 94208 38749 52020 43% /
*************************************************************************************
Extending the root file system with Online JFS - fsadm
Current Path Home
Score : 0
Document Type : EN
Date : 2001 Apr 21
Description : Extending the root file system with Online JFS - fsadm
Document Id : KBRC00006582
Search String : KBRC00006582
You may provide feedback on this document
View the printer friendly version of this document
--------------------------------------------------------------------------------
Extending the root file system with Online JFS - fsadm DocId: KBRC00006582 Updated: 4/24/01 4:54:00 AM
PROBLEM
How can the root file system be extended using Online JFS - fsadm?
CONFIGURATION
HP-UX 10.20, 11.X
RESOLUTION
On HP-UX version 10.20 and higher, the root filesystem "/" will be a VxFS (JFS)
filesystem, by default, after an install of the operating system. If the
system was upgraded from an earlier revision of the OS, this might not be the
case. This allows the use of fsadm to extend the root filesystem
without having to reinstall, ignite (make*recovery) or create an alternate boot
disk. The criteria that has to be met for this to succeed are:
1) The root filesystem has to be JFS.
- This can be verified with the fstyp command on the
root logical volume:
# bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 86016 38741 44347 47% /
# fstyp /dev/vg00/lvol3
vxfs
2) The Online JFS bundle has to be loaded
- This can be verified with swlist and should also be verified
by making sure the drivers are loaded in the kernel:
For 11i (11.11):
# swlist -l product|grep -i online
OnlineJFS B.11.11 Online features of the VxFS File System
to verify the drivers are, indeed, in the kernel:
# /usr/lbin/sysadm/system_prep -s /tmp/system.out;grep ^vx /tmp/system.out
vxdmp_q4
vxfs
vxportal
vxvm_q4
vxvm
vxdmp
The vxfs and vxportal are the required drivers for 11i and should appear in
the output. If not, the Online product is not successfully loaded or not in
the kernel that the system is currently booted from.
For 11.00:
# swlist|grep -i online
B3929BA B.11.00 HP OnLineJFS (Advanced VxFS)
to verify the drivers are, indeed, in the kernel:
# /usr/lbin/sysadm/system_prep -s /tmp/system.out;grep ^vx /tmp/system.out
vxfs
vxfs33_q4_syms
vxportal33
-OR-
vxbase
vxadv
NOTE: For 11.00 the Online drivers can either be vxadv for JFS
version 3.1 *or* vxfs and vxportal33 for JFS version 3.3.
For 10.20:
# swlist|grep -i online
B3929BA B.10.20 HP OnLineJFS (Advanced VxFS)
to verify the driver is in the kernel:
# /usr/lbin/sysadm/system_prep -s /tmp/system.out;grep ^vx /tmp/system.out
vxadv
vxbase
3) There is free space on the disk after the root logical volume because
the root logical volume has to be contiguous and it cannot span across multiple
disks.
- The root logical volume must be contiguous so that the system can be booted
into LVM maintenance mode if there are ever any LVM related problems.
There will probably already be another logical volume directly after the root
logical volume on the disk so it will have to be moved to another disk in
vg00. This can be done with pvmove. First find out the disk that the
root logical volume is on:
# lvlnboot -v|grep ^Root
Root: lvol3 on: /dev/dsk/c1t6d0
Then find the logical volume(s) that has to be moved to accomodate the space
that is needed to grow the root logical volume:
# pvdisplay -v /dev/dsk/c1t6d0|more
...
0066 current /dev/vg00/lvol3 0013
0067 current /dev/vg00/lvol3 0014
0068 current /dev/vg00/lvol3 0015
0069 current /dev/vg00/lvol3 0016
0070 current /dev/vg00/lvol3 0017
0071 current /dev/vg00/lvol3 0018
0072 current /dev/vg00/lvol3 0019
0073 current /dev/vg00/lvol3 0020
0074 current /dev/vg00/lvol4 0000
0075 current /dev/vg00/lvol4 0001
0076 current /dev/vg00/lvol4 0002
0077 current /dev/vg00/lvol4 0003
0078 current /dev/vg00/lvol4 0004
0079 current /dev/vg00/lvol4 0005
0080 current /dev/vg00/lvol4 0006
0081 current /dev/vg00/lvol4 0007
0082 current /dev/vg00/lvol7 0000
0083 current /dev/vg00/lvol7 0001
0084 current /dev/vg00/lvol7 0002
0085 current /dev/vg00/lvol7 0003
0086 current /dev/vg00/lvol7 0004
...
In this case, lvol4 is after lvol3 (root) and it will have to be moved to
another disk in vg00 that has the space. This will free up Physical Extent
(PE) 74 through 81 so that lvol3 can be extended that much. Each PE, by
default, is 4Mbs so lvol3 on this system can be extended by another 32Mb. If
more space is required, lvol7 would have to be moved also. vgdisplay will show
the PE size.
The command to move lvol4 is:
# pvmove -n /dev/vg00/lvol4 /dev/dsk/c1t6d0 /dev/dsk/c1t3d0
Transferring logical extents of logical volume "/dev/vg00/lvol4"...
Physical volume "/dev/dsk/c1t6d0" has been successfully moved.
Volume Group configuration for /dev/vg00 has been saved
in /etc/lvmconf/vg00.conf
/dev/dsk/c1t6d0 is the disk that lvol4 is moving from and /dev/dsk/c1t3d0
is the disk that it's moving to since it has free space.
Verify that the lvol has been moved and there are free PEs after the root
logical volume:
# pvdisplay -v /dev/dsk/c1t6d0|more
...
0066 current /dev/vg00/lvol3 0013
0067 current /dev/vg00/lvol3 0014
0068 current /dev/vg00/lvol3 0015
0069 current /dev/vg00/lvol3 0016
0070 current /dev/vg00/lvol3 0017
0071 current /dev/vg00/lvol3 0018
0072 current /dev/vg00/lvol3 0019
0073 current /dev/vg00/lvol3 0020
0074 free 0000
0075 free 0000
0076 free 0000
0077 free 0000
0078 free 0000
0079 free 0000
0080 free 0000
0081 free 0000
0082 current /dev/vg00/lvol7 0000
0083 current /dev/vg00/lvol7 0001
0084 current /dev/vg00/lvol7 0002
0085 current /dev/vg00/lvol7 0003
0086 current /dev/vg00/lvol7 0004
...
There is free space so the root lvol can be extended.
4) On 11.00 PHKL_19202 must be loaded or the system will panic.
****************
NOTE
If all of these criteria are not met, this procedure will fail and could
leave the system in an unusable state.
****************
To extend the filesystem, first extend the logical volume to the desired
amount. In this case, the full 32Mb that is available will be used. That is 8
physical extents that will be added to the current size. Get the current size:
# lvdisplay /dev/vg00/lvol3|grep "Allocated PE"
Allocated PE 21
Extend it by 8 extents:
# lvextend -l 29 /dev/vg00/lvol3
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved
in /etc/lvmconf/vg00.conf
Now get the size in sectors, that the root filesystem will
become. The sector size is in Kbytes. The fsadm command
requires the size in sectors. In this case, the current size is 84Mb:
# bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 86016 38749 44340 47% /
note: 86016 / 1024 = 84 which is the size in Mbs
In this case 8Mbs are being added to / so the new size in sectors would be:
92 * 1024 = 94208
Now extend the filesystem:
# fsadm -F vxfs -b 94208 /
fsadm: /dev/vg00/rlvol3 is currently 86016 sectors - size will be increased
Verify it worked:
# bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 94208 38749 52020 43% /
HP-UX/Operating System
[HP-UX] HP-UX 파일시스템 확장
반응형
반응형