[AIX 운영 체제와 장치 관리 35] 논리 볼륨 저장소 — 장치 설치 준비, 광 드라이브·이동식 매체 추가, 많은 장치 구성, PV·VG·PP·LV·LP 개념과 한도
https://archive.horanglab.com/posts/aix-osdev-35
핵심 정리
- 디스크는 물리 볼륨(PV)이 되어 볼륨 그룹(VG)에 속하고, VG 안의 PV는 같은 크기의 물리 파티션(PP)으로 나뉩니다. 논리 볼륨(LV)은 논리 파티션(LP)으로 이루어지며 LP 하나는 미러 사본 수만큼 PP 1~3개에 대응합니다.
- 각 PV는 할당용으로 outer_edge, outer_middle, center, inner_middle, inner_edge 다섯 영역으로 나뉩니다. rootvg는 가져오기·내보내기를 할 수 없습니다.
- 장치가 많으면 ODM 공간과 i-node가 더 필요하며, 부팅 때 쓰는 RAM 파일 시스템은 메모리의 25%(최대 128MB, KB당 i-node 하나)라 장치가 너무 많으면 부팅하지 못할 수 있습니다. 대략 25,000개 장치까지 구성할 수 있습니다.
- 표준·big·scalable VG의 PV 최대는 32·128·1024, LV 최대는 255·511·4095입니다. 표준·big VG는 PV당 PP 1016×factor이며
chvg -t로 바꾸면 그만큼 최대 디스크 수가 줄어듭니다. - 64비트 커널에서 원래 VG의 PV 한도는 15.9TB, LV는 31.8TB, big VG는 PV 63.5TB·LV 127TB, scalable VG는 256PB이며, 불량 블록 재배치가 필요하면 PV는 128GB 이하여야 합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 6.1 (5.3판과 거의 같음, 크기 한도 절 추가) |
| 원문 | Operating system and device management — 5.3판 2328쪽, 6.1판 375382쪽 |
| 관련 명령어 | mkdev, cfgmgr, lsdev, smit makcdr, mkvg, extendvg, chvg -t, reducevg, migratepv, mklv, chlv, extendlv, crfs |
| 관련 파일 | /usr/lib/drivers |
논리 볼륨은 물리 볼륨에 있는 정보 묶음입니다.
디스크 저장소는 구조 계층으로 관리합니다. 물리 볼륨(PV)이라는 각 디스크 드라이브에는 /dev/hdisk0 같은 이름이 있습니다. 사용 중인 모든 물리 볼륨은 볼륨 그룹(VG)에 속합니다. 볼륨 그룹의 모든 물리 볼륨은 같은 크기의 물리 파티션(PP)으로 나뉩니다. 공간 할당을 위해 각 물리 볼륨은 다섯 영역(outer_edge, inner_edge, outer_middle, inner_middle, center)으로 나뉩니다. 각 영역의 물리 파티션 수는 디스크 드라이브의 총 용량에 따라 다릅니다.
각 볼륨 그룹 안에 논리 볼륨(LV)을 하나 이상 정의합니다. 논리 볼륨의 데이터는 사용자에게 연속된 것처럼 보이지만 물리 볼륨에서는 연속되지 않을 수 있습니다. 그래서 파일 시스템, 페이징 공간, 다른 논리 볼륨의 크기를 바꾸거나 옮기거나, 여러 물리 볼륨에 걸치게 하거나, 내용을 복제해 데이터 저장의 유연성과 가용성을 높일 수 있습니다.
각 논리 볼륨은 논리 파티션(LP) 하나 이상으로 이루어집니다. 각 논리 파티션은 적어도 하나의 물리 파티션에 대응합니다. 논리 볼륨에 미러링을 지정하면 각 논리 파티션의 추가 사본을 저장하도록 물리 파티션을 더 할당합니다. 논리 파티션은 연속 번호가 매겨지지만, 그 아래 물리 파티션이 반드시 연속되거나 붙어 있는 것은 아닙니다.
논리 볼륨은 페이징 같은 여러 시스템 용도로 쓸 수 있지만, 각 논리 볼륨은 한 가지 용도로만 씁니다. 많은 논리 볼륨에는 저널 파일 시스템(JFS나 JFS2)이 하나 들어 있습니다. 각 JFS는 페이지 크기(4KB) 블록 풀로 이루어집니다. 파일에 데이터를 쓸 때 그 파일에 블록이 하나 이상 더 할당됩니다. 이 블록은 서로나 파일에 이미 할당된 블록과 붙어 있지 않을 수 있습니다. 파일 시스템의 조각(fragment) 크기는 4KB보다 작게(512바이트, 1KB, 2KB) 정의할 수 있습니다.
설치 뒤 시스템에는 시스템을 시작하는 데 필요한 기본 논리 볼륨 묶음과 설치 스크립트에 지정한 다른 논리 볼륨으로 이루어진 볼륨 그룹(rootvg 볼륨 그룹) 하나가 있습니다. 시스템에 연결한 다른 물리 볼륨은 extendvg 명령으로 볼륨 그룹에 더할 수 있습니다. 물리 볼륨은 rootvg 볼륨 그룹이나 mkvg 명령으로 정의한 다른 볼륨 그룹에 더할 수 있습니다. 논리 볼륨은 명령, 메뉴 방식의 SMIT 인터페이스, Web-based System Manager로 맞출 수 있습니다.
관련 작업
- 물리 볼륨 내용 옮기기, 물리 볼륨이 빠졌을 때 관리자에게 알리기, 볼륨 그룹에서 미러 디스크 떼어 내기
- 루트 볼륨 그룹의 파일 시스템 크기 줄이기 — 모든 파일 시스템을 최소 크기로 줄이는 가장 간단한 방법은 백업에서 기본 운영 체제를 복원할 때 SHRINK 옵션을 yes로 설정하는 것입니다.
영어 원문
Logical volume storage
Logical volumes are groups of information located on physical volumes.
A hierarchy of structures is used to manage disk storage. Each individual disk drive, called a physical volume (PV) has a name, such as /dev/hdisk0. Every physical volume in use belongs to a volume group (VG). All of the physical volumes in a volume group are divided into physical partitions (PPs) of the same size. For space-allocation purposes, each physical volume is divided into five regions (outer_edge, inner_edge, outer_middle, inner_middle and center). The number of physical partitions in each region varies, depending on the total capacity of the disk drive.
Within each volume group, one or more logical volumes (LVs) are defined. Data on logical volumes appears to be contiguous to the user but can be discontiguous on the physical volume. This allows file systems, paging space, and other logical volumes to be resized or relocated, to span multiple physical volumes, and to have their contents replicated for greater flexibility and availability in the storage of data.
Each logical volume consists of one or more logical partitions (LPs). Each logical partition corresponds to at least one physical partition. If mirroring is specified for the logical volume, additional physical partitions are allocated to store the additional copies of each logical partition. Although the logical partitions are numbered consecutively, the underlying physical partitions are not necessarily consecutive or contiguous.
Logical volumes can serve a number of system purposes, such as paging, but each logical volume serves a single purpose only. Many logical volumes contain a single journaled file system (JFS or JFS2). Each JFS consists of a pool of page-size (4 KB) blocks. When data is to be written to a file, one or more additional blocks are allocated to that file. These blocks might not be contiguous with one another or with other blocks previously allocated to the file. A given file system can be defined as having a fragment size of less than 4 KB (512 bytes, 1 KB, 2 KB).
After installation, the system has one volume group (the rootvg volume group) consisting of a base set of logical volumes required to start the system and any other logical volumes you specify to the installation
script. Any other physical volumes you have connected to the system can be added to a volume group (using the extendvg command). You can add the physical volume either to the rootvg volume group or to another volume group (defined by using the mkvg command). Logical volumes can be tailored using the commands, the menu-driven System Management Interface Tool (SMIT) interface, or Web-based System Manager.
Related tasks
Migrating the contents of a physical volume Notifying the administrator when a physical volume is missing Although AIX logs an error when a physical volume becomes inaccessible, there are circumstances in which an error can go undetected. Splitting a mirrored disk from a volume group Snapshot support helps you protect the consistency of your mirrored volume groups from potential disk failure. Reducing the size of a file system in your root volume group The simplest way to reduce all file systems to their minimum size is to set the SHRINK option to yes when restoring the base operating system from backup.
장치 설치 준비
시스템에 장치를 설치하는 일은 장치를 붙일 곳을 정하고, 장치를 물리적으로 연결하고, Web-based System Manager, 구성 관리자, SMIT로 장치를 구성하는 것으로 이루어집니다.
참고: 다음 절차는 장치를 설치하려고 시스템을 종료해야 합니다. 모든 장치 설치가 시스템 종료를 요구하지는 않습니다. 특정 장치와 함께 온 문서를 봅니다.
이 항목은 모든 장치에 공통인 설치 작업을 설명합니다. 설치할 수 있는 장치가 아주 다양하므로 일반 절차만 제공합니다. 더 구체적인 정보는 특정 장치와 함께 온 설치 지침을 봅니다.
- 시스템 장치에서 실행 중인 모든 응용 프로그램을 멈추고 shutdown 명령으로 시스템 장치를 종료합니다.
- 시스템 장치와 연결된 모든 장치의 전원을 끕니다.
- 시스템 장치와 연결된 모든 장치의 플러그를 뽑습니다.
- 장치의 설정·운영 안내서에 설명된 절차로 새 장치를 시스템에 연결합니다.
- 시스템 장치와 연결된 모든 장치의 플러그를 꽂습니다.
- 시스템 장치는 끈 채 연결된 모든 장치의 전원을 켭니다.
- 모든 장치가 전원 켜기 자체 시험(POST)을 마치면 시스템 장치의 전원을 켭니다.
구성 관리자가 연결된 장치를 자동으로 훑어 감지한 새 장치를 구성합니다. 새 장치는 기본 속성으로 구성되고 사용자 정의 구성 데이터베이스에 기록되어 Available 상태가 됩니다.
Web-based System Manager(wsm을 실행하고 Devices 선택)나 SMIT 빠른 경로 smit dev로 장치를 직접 구성할 수 있습니다. 장치 속성을 맞춰야 하거나 장치를 자동으로 구성할 수 없으면 장치와 함께 온 문서에서 구성 요구 사항을 봅니다.
관련 개념
- 장치 구성 데이터베이스와 장치 관리 — 장치 정보는 장치 구성 데이터베이스를 이루는 미리 정의된 데이터베이스나 사용자 정의 데이터베이스에 있습니다.
영어 원문
Preparing to install a device
Installing devices on your system consists of identifying where the device is to be attached, connecting the device physically, and configuring the device with Web-based System Manager, the Configuration Manager, or SMIT.
Note: The following procedure requires a shutdown of your system to install the device. Not all device installations require a shutdown of your system. Refer to the documentation shipped with the specific device.
This topic documents installation tasks that are common to all devices. Because of the wide variety of devices that you can install on your system, only a general procedure is provided. For more specific information, see the installation instructions shipped with the specific device.
Stop all applications running on the system unit and shut down the system unit using the shutdown command.
Turn off the system unit and all attached devices.
Unplug the system unit and all attached devices.
Connect the new device to the system using the procedure described in the setup and operator guide for the device.
Plug in the system unit and all attached devices.
Turn on all the attached devices leaving the system unit turned off.
Turn on the system unit when all the devices complete power-on self-tests (POST).
The Configuration Manager automatically scans the attached devices and configures any new devices it detects. The new devices are configured with default attributes and recorded in the customized configuration database placing the device in Available state.
You can manually configure a device using Web-based System Manager (wsm, then select Devices), or the SMIT fast path, smit dev. If you need to customize the device attributes or if the device cannot be configured automatically, see the device documentation that shipped with the device for specific configuration requirements.
Related concepts
Device configuration database and device management Device information is contained in a predefined database or a customized database that makes up the device configuration database.
읽기·쓰기 광 드라이브 구성
읽기·쓰기 광 드라이브를 구성하는 방법은 두 가지입니다.
읽기·쓰기 광 드라이브가 시스템에 연결돼 전원이 켜져 있어야 합니다.
방법 1
방법 1이 둘 가운데 더 빠릅니다. 지정한 읽기·쓰기 광 드라이브만 구성합니다. 이 방법을 쓰려면 다음 정보가 있어야 합니다.
| 정보 | 뜻 |
|---|---|
| Subclass | 드라이브가 연결되는 방식 |
| Type | 읽기·쓰기 광 드라이브의 형 |
| Parent Name | 드라이브가 연결된 시스템 부착점 |
| Where Connected | 드라이브의 논리 주소 |
다음 명령을 입력해 읽기·쓰기 광 드라이브를 구성합니다.
mkdev -c rwoptical -s Subclass -t Type -p ParentName -w WhereConnected
다음은 SCSI ID 6, 논리 장치 번호 0이고 셋째(scsi3) SCSI 버스에 연결된 읽기·쓰기 광 드라이브의 예입니다.
mkdev -c rwoptical -s scsi -t osomd -p scsi3 -w 6,0 -a pv=yes
방법 2
방법 2는 구성 관리자로 현재 구성을 훑어 새 장치를 감지하고 자동으로 구성합니다. 읽기·쓰기 광 드라이브에 관해 아는 정보가 적을 때 씁니다.
- 다음을 입력해 구성 관리자로 시스템에서 새로 감지한 모든 장치(읽기·쓰기 광 드라이브 포함)를 구성합니다.
cfgmgr
- 다음 명령을 입력해 현재 구성된 모든 읽기·쓰기 광 드라이브의 이름, 위치 코드, 형을 나열합니다.
lsdev -C -c rwoptical
- 더하는 드라이브의 위치와 맞는 위치 코드로 새로 구성한 읽기·쓰기 광 드라이브의 이름을 알아냅니다.
영어 원문
Configuring a read/write optical drive
There are two methods for configuring a read/write optical drive.
The read/write optical drive must be connected to the system and powered on.
Method 1
Method one is the faster of the two methods. It only configures the read/write optical drive specified. To use this method, you must provide the following information:
- Subclass — Defines how the drive is attached.
- Type — Specifies the type of read/write optical drive.
- Parent Name — Specifies the system attachment the drive is connected to.
- Where Connected — Specifies the logical address of the drive.
Enter the following command to configure the read/write optical drive:
mkdev -c rwoptical -s Subclass -t Type -p ParentName -w WhereConnected
The following is an example of a read/write optical drive that has a SCSI ID of 6, a logical unit number of zero, and is connected to the third (scsi3) SCSI bus:
mkdev -c rwoptical -s scsi -t osomd -p scsi3 -w 6,0 -a pv=yes
Method 2
Method two uses the Configuration Manager, searching the current configuration, detecting any new devices, and automatically configuring the devices. This method is used when little information is known about the read/write optical drive.
- Use the configuration manager to configure all newly detected devices on the system (including the read/write optical drive) by typing:
cfgmgr
- Type the following command to list the names, location codes, and types of all currently configured read/write optical drives:
lsdev -C -c rwoptical
- Determine the name of the newly configured read/write optical drive using the location code that matches the location of the drive being added.
많은 장치의 구성
장치에는 프린터, 드라이브, 어댑터, 버스, 인클로저 같은 하드웨어와 error 특수 파일, null 특수 파일 같은 의사 장치가 있습니다. 장치 드라이버는 /usr/lib/drivers 디렉터리에 있습니다.
AIX가 지원할 수 있는 장치 수는 여러 중요한 요인에 따라 시스템마다 다릅니다. 다음 요인이 장치를 지원하는 파일 시스템에 영향을 줍니다.
- 장치를 많이 구성하면 ODM 장치 구성 데이터베이스에 정보를 더 저장해야 하고 장치 특수 파일도 더 필요할 수 있습니다. 그 결과 파일 시스템에 공간과 i-node가 더 필요합니다.
- 어떤 장치는 ODM 장치 구성 데이터베이스에서 다른 장치보다 공간을 더 씁니다. 쓰는 특수 파일이나 i-node 수도 장치마다 다릅니다. 그래서 파일 시스템에 필요한 공간과 i-node 양은 시스템의 장치 종류에 따라 다릅니다.
- 다중 경로 I/O(MPIO) 장치는 장치 자체와 장치로 가는 각 경로의 정보를 ODM에 저장하므로 MPIO가 아닌 장치보다 공간을 더 씁니다. 대략 경로 하나가 장치 하나의 5분의 1 공간을 차지한다고 봅니다. 예를 들어 경로가 다섯인 MPIO 장치는 MPIO가 아닌 장치 둘만큼의 공간을 씁니다.
- AIX는 ODM 장치 구성 데이터베이스에 논리 장치와 물리 장치를 모두 넣습니다. 논리 장치에는 볼륨 그룹, 논리 볼륨, 네트워크 인터페이스 등이 있습니다. 논리 장치와 물리 장치의 관계가 지원되는 전체 장치 수에 크게 영향을 줄 수 있습니다. 예를 들어 시스템에 붙은 물리 디스크마다 논리 볼륨 둘인 볼륨 그룹을 정의하면 디스크마다 AIX 장치가 넷이 됩니다. 반면 물리 디스크마다 논리 볼륨 여섯인 볼륨 그룹을 정의하면 디스크마다 AIX 장치가 여덟이 됩니다. 그래서 붙일 수 있는 디스크는 절반이 됩니다.
- 장치 속성을 기본값에서 바꾸면 ODM 장치 구성 데이터베이스가 커져 지원할 수 있는 장치가 줄어들 수 있습니다.
- 장치가 많으면 실제 메모리가 더 필요합니다.
AIX는 장치를 지원하는 데 파일 시스템 두 개를 씁니다.
- RAM 파일 시스템은 페이징 공간도 마운트된 디스크 파일 시스템도 없는 부팅 환경에서 씁니다. RAM 파일 시스템 크기는 시스템 메모리 크기의 25%이며 최대 128MB입니다. RAM 파일 시스템에서는 1KB마다 i-node가 하나 할당됩니다. AIX 운영 체제의 최소 시스템 메모리 요구는 256MB이며, 이는 i-node 65536개인 최소 64MB RAM 파일 시스템이 됩니다. 시스템 메모리가 512MB 이상이면 RAM 파일 시스템은 i-node 131072개인 최대 크기 128MB가 됩니다. 연결된 장치를 지원하는 데 필요한 RAM 파일 시스템 공간이나 i-node 수가 RAM 디스크에 할당된 것을 넘으면 시스템이 부팅하지 못할 수 있습니다. 그러면 일부 장치를 빼야 합니다.
- 디스크의 루트 파일 시스템(rootvg) 공간과 i-node는 rootvg에 할당되지 않은 파티션이 있는 한 늘릴 수 있습니다. RAM 파일 시스템이 최대 크기이면 AIX 장치를 25,000개 정도까지 구성할 수 있을 것입니다. 이 수에는 물리 장치와 논리 장치가 모두 포함됩니다. 이 절에서 말한 여러 요인에 따라 이보다 많거나 적은 장치를 구성할 수 있습니다.
참고: 시스템에 장치가 많으면 구성 시간이 길어져 부팅 시간도 길어집니다.
관련 개념
- BSD 시스템 관리자를 위한 AIX 소개
영어 원문
Configuration of a large number of devices
Devices include hardware components such as, printers, drives, adapters, buses, and enclosures, as well as pseudo-devices, such as the error special file and null special file. Device drivers are located in the /usr/lib/drivers directory.
The number of devices that AIX can support can vary from system to system, depending on several important factors. The following factors have an impact on the file systems that support the devices:
Configuring a large number of devices requires storage of more information in the ODM device-configuration database. It can also require more device special files. As a result, more space and more i-nodes are required of the file system.
Some devices require more space than others in the ODM device-configuration database. The number of special files or i-nodes used also varies from device to device. As a result, the amount of space and i-nodes required of the file system depends on the types of devices on the system. • Multipath I/O (MPIO) devices require more space than non-MPIO devices because information is stored in the ODM for the device itself as well as for each path to the device. As a rough guideline, assume that each path takes up the space of one-fifth of a device. For example, an MPIO device with five paths will have the space equivalent to two non-MPIO devices.
AIX includes both logical devices and physical devices in the ODM device-configuration database. Logical devices include volume groups, logical volumes, network interfaces, and so on. In some cases, the relationship between logical and physical devices can greatly affect the total number of devices supported. For example, if you define a volume group with two logical volumes for each physical disk that is attached to a system, this will result in four AIX devices for each disk. On the other hand, if you define a volume group with six logical volumes for each physical disk, there will be eight AIX devices for each disk. Therefore, only half as many disks could be attached.
Changing device attributes from their default settings results in a larger ODM device-configuration database and could lead to fewer devices that can be supported.
More devices require more real memory.
Two file systems are used by AIX to support devices:
The RAM file system is used during boot in an environment that has no paging space and no disk file systems mounted. The size of the RAM file system is 25% of the system memory size up to a maximum of 128 MB. One i-node is allocated for every KB in the RAM file system. The minimum system memory requirement for the AIX operating system is 256 MB, which translates into a minimum RAM file system size of 64 MB with 65536 i-nodes. If the system memory size is 512 MB or larger, then the RAM file system will be at its maximum size of 128 MB with 131072 i-nodes. If either the amount of RAM file system space or number of i-nodes needed to support the attached devices exceeds what has been allocated to the RAM disk, the system might not boot. If this is the case, you must remove some of the devices.
The space and i-nodes of the root file system (rootvg) on the disk can be increased as long as there are unallocated partitions in the rootvg. With the maximum RAM file system size, it is likely that up to 25,000 AIX devices can be configured. These numbers include both physical and logical devices. Depending on the various factors mentioned in this section, your system might be able to configure more or fewer devices than this number.
Note: With a large number of devices in the system, the longer configuration time contributes to a longer boot time.
Related concepts
Introduction to AIX for BSD system managers The following are tips to help Berkeley Software Distribution (BSD) system managers get started managing AIX.
이동식 매체 드라이브 추가
이동식 매체 드라이브를 더할 수 있습니다.
다음 절차는 SMIT로 시스템에 CD-ROM 드라이브를 더합니다. 다른 종류의 이동식 매체 드라이브는 다른 빠른 경로를 쓰지만 모두 같은 일반 절차를 따릅니다. Web-based System Manager, 구성 관리자, mkdev 명령으로도 이동식 매체 드라이브를 더할 수 있습니다.
이 시나리오의 정보는 특정 AIX 버전으로 시험했습니다. AIX 버전과 수준에 따라 결과가 크게 다를 수 있습니다.
- 시스템에 CD-ROM 드라이브를 더하려면 시스템과 함께 온 문서에 따라 하드웨어를 설치합니다.
- root 권한으로 다음 SMIT 빠른 경로를 입력합니다.
smit makcdr
- 다음 화면에서 지원하는 드라이브 목록 가운데 드라이브 형을 고릅니다.
- 다음 화면에서 목록 가운데 부모 어댑터를 고릅니다.
- 다음 화면에서 적어도 연결 주소를 목록에서 고릅니다. 이 화면에서 다른 옵션도 고를 수 있습니다. 끝나면 Enter를 누르며, SMIT가 새 CD-ROM 드라이브를 더합니다.
이제 시스템이 새 CD-ROM 드라이브를 인식합니다. 읽기·쓰기 광 드라이브를 더하려면 smit makomd 빠른 경로를, 테이프 드라이브를 더하려면 smit maktpe 빠른 경로를 씁니다.
자세한 내용은 Commands Reference, Volume 3의 mkdev 명령 설명을 봅니다.
영어 원문
Adding a removable media drive
You can add a removable media drive.
The following procedure uses SMIT to add a CD-ROM drive to your system. Other types of removable media drives are added using different fast paths but all follow the same general procedure. You can also add a removable media drive using Web-based System Manager, the Configuration Manager, or the mkdev command.
The information in this how-to scenario was tested using specific versions of AIX. The results you obtain might vary significantly depending on your version and level of AIX.
To add a CD-ROM drive to your system, install the hardware according to the documentation that came with your system.
With root authority, type the following SMIT fast path:
smit makcdr
In the next screen, select the drive type from the available list of supported drives.
In the next screen, select the parent adapter from the available list.
In the next screen, at minimum, select the connection address from the available list. You can also use this screen to select other options. When you are finished, press Enter, and then SMIT adds the new CD-ROM drive.
At this point, the new CD-ROM drive is recognized by your system. To add a read/write optical drive, use the smit makomd fast path. To add a tape drive, use the smit maktpe fast path.
See the mkdev command description in the Commands Reference, Volume 3 for more information.
논리 볼륨 저장소 개념
(물리 볼륨에 걸칠 수 있는) 논리 볼륨은 물리 파티션에 할당된 논리 파티션으로 이루어집니다.
원문의 그림이 기본 논리 저장소 개념 사이의 관계를 보여 줍니다.
물리 볼륨
디스크를 볼륨 그룹에 할당하려면 먼저 물리 볼륨으로 지정하고 쓸 수 있는 상태로 둬야 합니다.
물리 볼륨에는 일정한 구성과 식별 정보가 기록됩니다. 이 정보에는 시스템에서 고유한 물리 볼륨 식별자가 들어 있습니다.
LVM은 LUN과 연결된 물리 볼륨에 물리 파티션을 더해, RAID가 논리 장치 번호(LUN)에 더할 수 있는 추가 공간을 쓸 수 있습니다.
볼륨 그룹
볼륨 그룹은 크기와 형이 여러 가지인 물리 볼륨 1~32개의 모음입니다. 원문 그림 1은 물리 볼륨 셋으로 이루어진 볼륨 그룹을 보여 줍니다.
big 볼륨 그룹은 물리 볼륨을 1~128개 가질 수 있습니다. scalable 볼륨 그룹은 물리 볼륨을 1024개까지 가질 수 있습니다. 물리 볼륨은 시스템마다 한 볼륨 그룹에만 속할 수 있으며 활성 볼륨 그룹은 255개까지 있을 수 있습니다.
물리 볼륨을 볼륨 그룹에 할당하면 그 저장 매체의 물리 블록은 볼륨 그룹을 만들 때 지정한 크기의 물리 파티션으로 짜입니다.
시스템을 설치하면 볼륨 그룹 하나(rootvg라는 루트 볼륨 그룹)가 자동으로 만들어지며, 시스템을 시작하는 데 필요한 기본 논리 볼륨 묶음과 설치 스크립트에 지정한 다른 논리 볼륨이 들어갑니다. rootvg에는 페이징 공간, 저널 로그, 부트 데이터, 덤프 저장소가 각각 별도 논리 볼륨으로 들어 있습니다. rootvg는 사용자 정의 볼륨 그룹과 다른 속성이 있습니다. 예를 들어 rootvg는 가져오거나 내보낼 수 없습니다. rootvg에 명령이나 절차를 실행할 때는 그 고유한 특성을 알아야 합니다.
볼륨 그룹은 mkvg 명령으로 만듭니다. extendvg 명령으로 볼륨 그룹에 물리 볼륨을 더하고, chvg 명령으로 물리 볼륨의 바뀐 크기를 쓰고, reducevg 명령으로 볼륨 그룹에서 물리 볼륨을 뺍니다. 볼륨 그룹에 쓰는 다른 명령으로 나열(lsvg), 제거(exportvg), 설치(importvg), 재구성(reorgvg), 동기화(syncvg), 사용 가능하게(varyonvg), 사용 불가능하게(varyoffvg)가 있습니다.
작은 시스템은 시스템에 붙은 모든 물리 볼륨을 담는 볼륨 그룹 하나만 필요할 수 있습니다. 그러나 볼륨 그룹마다 보안 권한을 따로 가질 수 있으므로 보안을 위해 볼륨 그룹을 나눌 수 있습니다. 볼륨 그룹을 나누면 정비 중인 그룹 말고 다른 그룹은 활성으로 남을 수 있어 유지 보수도 쉬워집니다. rootvg는 늘 온라인이어야 하므로 시스템 운영에 필요한 최소한의 물리 볼륨만 담습니다.
migratepv 명령으로 같은 볼륨 그룹 안에서 한 물리 볼륨의 데이터를 다른 물리 볼륨으로 옮길 수 있습니다. 이 명령으로 물리 볼륨을 비워 볼륨 그룹에서 뺄 수 있습니다. 예를 들어 교체할 물리 볼륨의 데이터를 옮길 수 있습니다.
작은 물리·논리 볼륨 한도로 만든 볼륨 그룹은 물리 볼륨과 논리 볼륨을 더 많이 담을 수 있는 형식으로 바꿀 수 있습니다. 이 작업을 하려면 볼륨 그룹의 모든 물리 볼륨에 볼륨 그룹 설명자 영역(VGDA) 확장을 위한 빈 파티션이 충분해야 합니다. 필요한 빈 파티션 수는 현재 VGDA 크기와 물리 파티션 크기에 따라 다릅니다. VGDA는 디스크 가장자리에 있고 연속 공간이 필요하므로 빈 파티션은 디스크 가장자리에 있어야 합니다. 그 파티션이 사용자용으로 할당돼 있으면 같은 디스크의 다른 빈 파티션으로 옮겨집니다. 나머지 물리 파티션은 VGDA용으로 쓴 파티션만큼 번호가 다시 매겨집니다. 이 재번호는 이 볼륨 그룹의 모든 물리 볼륨에서 논리-물리 파티션 대응을 바꿉니다. 복구에 대비해 논리 볼륨 대응을 저장해 두었다면 변환을 마친 뒤 대응을 다시 만듭니다. 또 맵 옵션으로 볼륨 그룹을 백업했고 그 맵으로 복원할 계획이면, (줄어든 탓에) 파티션 번호가 더 이상 없을 수 있어 복원이 실패할 수 있습니다. 맵 옵션을 쓴다면 변환 전과 변환 직후에 백업하는 것이 좋습니다. VGDA 공간이 크게 늘었으므로 모든 VGDA 갱신 작업(논리 볼륨 만들기, 바꾸기, 물리 볼륨 더하기 등)이 훨씬 오래 걸릴 수 있습니다.
관련 개념
- 물리 파티션
물리 파티션
물리 볼륨을 볼륨 그룹에 더하면 물리 볼륨은 물리 파티션이라는 연속되고 크기가 같은 공간 단위로 나뉩니다. 물리 파티션은 저장 공간 할당의 가장 작은 단위이며 물리 볼륨의 연속 공간입니다.
물리 볼륨은 볼륨 그룹의 물리 파티션 크기를 물려받으며, 이 크기는 볼륨 그룹을 만들 때만(예: mkvg -s 명령) 설정할 수 있습니다. 원문 그림이 물리 볼륨의 물리 파티션과 볼륨 그룹의 관계를 보여 줍니다.
관련 개념
- 볼륨 그룹
논리 볼륨
볼륨 그룹을 만든 뒤 그 안에 논리 볼륨을 만들 수 있습니다.
논리 볼륨은 연속되지 않은 물리 파티션이나 여러 물리 볼륨에 있을 수 있지만, 사용자와 응용 프로그램에는 연속되고 늘릴 수 있는 하나의 디스크 볼륨으로 보입니다. mklv 명령으로 논리 볼륨을 더 만들 수 있습니다. 이 명령으로 논리 볼륨 이름을 지정하고, 할당할 논리 파티션의 수와 위치를 포함한 특성을 정의합니다.
논리 볼륨을 만든 뒤 chlv 명령으로 이름과 특성을 바꾸고, extendlv 명령으로 할당된 논리 파티션 수를 늘릴 수 있습니다. 만들 때 논리 볼륨의 기본 최대 크기는 더 크게 지정하지 않는 한 논리 파티션 512개입니다. chlv 명령으로 이 한도를 덮어씁니다.
참고: 논리 볼륨을 만든 뒤 lslv 명령으로 볼 수 있는 LV STATE 특성은 closed입니다. 예를 들어 논리 볼륨에 파일 시스템을 만들고 마운트하면 open이 됩니다.
논리 볼륨은 cplv 명령으로 복사하고, lslv 명령으로 나열하고, rmlv 명령으로 지우고, mklvcopy와 rmlvcopy 명령으로 유지하는 사본 수를 늘리거나 줄일 수도 있습니다. 볼륨 그룹을 재구성할 때 논리 볼륨이 옮겨질 수도 있습니다. 원문 그림 2는 물리 볼륨 셋을 담은 볼륨 그룹을 보여 줍니다.
시스템은 표준 볼륨 그룹마다 논리 볼륨을 255개(big 볼륨 그룹은 511개, scalable 볼륨 그룹은 4095개)까지 정의할 수 있게 하지만, 실제로 정의할 수 있는 수는 그 볼륨 그룹에 정의된 총 물리 저장 공간과 정의하는 논리 볼륨의 크기에 달려 있습니다.
논리 파티션
논리 볼륨을 만들 때 논리 볼륨의 논리 파티션 수를 지정합니다.
논리 파티션은 유지하려는 데이터 인스턴스 수에 따라 물리 파티션 하나, 둘, 셋입니다. 인스턴스 하나를 지정하면 논리 볼륨의 사본이 하나뿐(기본값)이라는 뜻입니다. 이때 논리 파티션 하나가 물리 파티션 하나에 바로 대응합니다. 첫째를 포함해 각 인스턴스를 사본이라고 합니다. 물리 파티션이 어디에 있는지(물리적으로 서로 얼마나 가까운지)는 논리 볼륨을 만들 때 지정하는 옵션이 정합니다.
파일 시스템
논리 볼륨은 디스크 공간 할당을 물리 파티션 수준까지 정의합니다. 더 세밀한 데이터 관리는 가상 메모리 관리자나 파일 시스템 같은 상위 소프트웨어 구성 요소가 합니다. 그래서 디스크 발전의 마지막 단계는 파일 시스템을 만드는 것입니다.
논리 볼륨마다 파일 시스템을 하나 만들 수 있습니다. 파일 시스템을 만들려면 crfs 명령을 씁니다.
관련 개념
- 파일 시스템 — 파일 시스템은 파일과 디렉터리의 계층 구조(파일 트리)입니다.
논리 저장소 관리의 한도
다음 표는 논리 저장소 관리의 한도입니다.
볼륨 그룹당 기본 최대 물리 볼륨 수는 32개(big 볼륨 그룹은 128개, scalable 볼륨 그룹은 1024개)이지만, mkvg 명령을 쓸 때 사용자 정의 볼륨 그룹의 최대값을 설정할 수 있습니다. 그러나 rootvg는 설치할 때 시스템이 이 값을 자동으로 최대로 설정합니다.
| 항목 | 한도 |
|---|---|
| 볼륨 그룹 | 32비트 커널은 255개, 64비트 커널은 4096개. 참고: 64비트 커널의 장치 표는 활성 주 번호를 1024개로 제한하므로 활성 볼륨 그룹 수는 1024개보다 적습니다. |
| 물리 볼륨 | 볼륨 그룹당 (MAXPVS/볼륨 그룹 인수). MAXPVS는 표준 볼륨 그룹 32, big 볼륨 그룹 128, scalable 볼륨 그룹 1024입니다. |
| 물리 파티션 | 표준과 big 볼륨 그룹: 물리 볼륨당 (1016 × 볼륨 그룹 인수)개, 각 크기 최대 1024MB. scalable 볼륨 그룹: 2097152개, 각 최대 128GB. scalable 볼륨 그룹에는 볼륨 그룹 인수가 없습니다. |
| 논리 볼륨 | 볼륨 그룹당 MAXLVS. 표준 볼륨 그룹 255, big 볼륨 그룹 511, scalable 볼륨 그룹 4095입니다. |
물리 볼륨당 물리 파티션 1016개 제한을 시행하기 전에 만든 볼륨 그룹이 있으면, 볼륨 그룹을 지원되는 상태로 바꾸지 않는 한 볼륨 그룹의 stale 파티션(최신 데이터가 아닌 파티션)을 올바르게 추적하지 못합니다. chvg -t 명령으로 볼륨 그룹을 바꿀 수 있습니다. 기본적으로 볼륨 그룹에서 가장 큰 디스크를 수용할 알맞은 인수 값이 골라집니다.
예를 들어 9GB 디스크와 4MB 파티션 크기로 볼륨 그룹을 만들었다면 이 볼륨 그룹의 파티션은 약 2250개입니다. 변환 인수 3(1016 × 3 = 3048)을 쓰면 2250개 파티션을 모두 올바르게 추적할 수 있습니다. 표준이나 big 볼륨 그룹을 더 큰 인수로 바꾸면 1016 × 인수 개 파티션까지의 더 큰 디스크를 넣을 수 있습니다. 작은 파티션 크기로 큰 디스크를 수용하려고 볼륨 그룹을 만들 때 더 큰 인수를 지정할 수도 있습니다.
이 작업은 볼륨 그룹에 더할 수 있는 총 디스크 수를 줄입니다. 새 최대 디스크 수는 MAXPVS/인수입니다. 예를 들어 일반 볼륨 그룹에서 인수 2는 최대 디스크 수를 16(32/2)으로 줄입니다. big 볼륨 그룹에서 인수 2는 최대 디스크 수를 64(128/2)로 줄입니다.
LVM 장치 크기 한도
다음은 LVM 구조상 한도입니다. LVM 불량 블록 재배치가 필요하면 PV 크기는 128GB를 넘을 수 없습니다. 특정 저장 장치의 크기 한도는 저장 장치 문서를 봅니다.
다음은 64비트 커널의 크기 한도입니다.
| VG 종류 | PV 한도 | LV 한도 |
|---|---|---|
| 원래(Original) VG | 1GB(PP) × 16256(PV당 PP, factor=16) = 15.9TB | 1GB(PP) × 32512(VG당 PP) = 31.8TB |
| big VG | 1GB(PP) × 65024(PV당 PP, factor=64) = 63.5TB | 1GB(PP) × 130048(VG당 PP) = 127TB |
| scalable VG(SVG) | 128GB(PP) × 2048K(PV당 PP) = 256PB | 128GB(PP) × 2048K = 256PB |
다음은 32비트 커널의 크기 한도입니다.
| VG 종류 | PV 한도 | LV 한도 |
|---|---|---|
| 모든 VG 형 | 1TB 미만 | 1TB 미만 |
영어 원문
Logical volume storage concepts
The logical volume (which can span physical volumes) is composed of logical partitions allocated onto physical partitions.
The following figure illustrates the relationships among the basic logical storage concepts.
Physical volumes
A disk must be designated as a physical volume and be put into an available state before it can be assigned to a volume group.
A physical volume has certain configuration and identification information written on it. This information includes a physical volume identifier that is unique to the system.
The LVM can make use of the additional space that a redundant array of identical disks (RAID) can add to a logical unit number (LUN), by adding physical partitions to the physical volume associated with the LUN.
Volume groups
A volume group is a collection of 1 to 32 physical volumes of varying sizes and types. Figure 1. Volume Group. This illustration shows a volume group composed of three physical volumes with the
A big volume group can have from 1 to 128 physical volumes. A scalable volume group can have up to 1024 physical volumes. A physical volume can belong to only one volume group per system; there can be up to 255 active volume groups.
When a physical volume is assigned to a volume group, the physical blocks of storage media on it are organized into physical partitions of a size you specify when you create the volume group.
When you install the system, one volume group (the root volume group, called rootvg) is automatically created that contains the base set of logical volumes required to start the system, as well as any other logical volumes you specify to the installation script. The rootvg includes paging space, the journal log, boot data, and dump storage, each in its own separate logical volume. The rootvg has attributes that differ from user-defined volume groups. For example, the rootvg cannot be imported or exported. When performing a command or procedure on the rootvg, you must be familiar with its unique characteristics.
You create a volume group with the mkvg command. You add a physical volume to a volume group with the extendvg command, make use of the changed size of a physical volume with the chvg command, and remove a physical volume from a volume group with the reducevg command. Some of the other commands that you use on volume groups include: list (lsvg), remove (exportvg), install (importvg), reorganize (reorgvg), synchronize (syncvg), make available for use (varyonvg), and make unavailable for use (varyoffvg).
Small systems might require only one volume group to contain all the physical volumes attached to the system. You might want to create separate volume groups, however, for security reasons, because each volume group can have its own security permissions. Separate volume groups also make maintenance easier because groups other than the one being serviced can remain active. Because the rootvg must always be online, it contains only the minimum number of physical volumes necessary for system operation.
You can move data from one physical volume to other physical volumes in the same volume group with the migratepv command. This command allows you to free a physical volume so it can be removed from the volume group. For example, you could move data from a physical volume that is to be replaced.
A volume group that is created with smaller physical and logical volume limits can be converted to a format which can hold more physical volumes and more logical volumes. This operation requires that there be enough free partitions on every physical volume in the volume group for the volume group descriptor area (VGDA) expansion. The number of free partitions required depends on the size of the current VGDA and the physical partition size. Because the VGDA resides on the edge of the disk and it requires contiguous space, the free partitions are required on the edge of the disk. If those partitions are allocated for a user's use, they are migrated to other free partitions on the same disk. The rest of the physical partitions are renumbered to reflect the loss of the partitions for VGDA usage. This renumbering changes the mappings of the logical to physical partitions in all the physical volumes of this volume group. If you have saved the mappings of the logical volumes for a potential recovery operation, generate the maps again after the completion of the conversion operation. Also, if the backup of the volume group is taken with map option and you plan to restore using those maps, the restore operation might fail because the partition number might no longer exist (due to reduction). It is recommended that backup is taken before the conversion and right after the conversion if the map option is used. Because the VGDA space has been increased substantially, every VGDA update operation (creating a logical volume, changing a logical volume, adding a physical volume, and so on) might take considerably longer to run.
Related concepts
Physical partitions When you add a physical volume to a volume group, the physical volume is partitioned into contiguous, equal-sized units of space called physical partitions. A physical partition is the smallest unit of storage space allocation and is a contiguous space on a physical volume.
Physical partitions
When you add a physical volume to a volume group, the physical volume is partitioned into contiguous, equal-sized units of space called physical partitions. A physical partition is the smallest unit of storage space allocation and is a contiguous space on a physical volume.
Physical volumes inherit the volume group's physical partition size, which you can set only when you create the volume group (for example, using the mkvg -s command). The following illustration shows the relationship between physical partitions on physical volumes and volume groups.
Related concepts
Volume groups A volume group is a collection of 1 to 32 physical volumes of varying sizes and types.
Logical volumes
After you create a volume group, you can create logical volumes within that volume group.
A logical volume, although it can reside on noncontiguous physical partitions or even on more than one physical volume, appears to users and applications as a single, contiguous, extensible disk volume. You can create additional logical volumes with the mklv command. This command allows you to specify the name of the logical volume and define its characteristics, including the number and location of logical partitions to allocate for it.
After you create a logical volume, you can change its name and characteristics with the chlv command, and you can increase the number of logical partitions allocated to it with the extendlv command. The default maximum size for a logical volume at creation is 512 logical partitions, unless specified to be larger. The chlv command is used to override this limitation.
Note: After you create a logical volume, the characteristic LV STATE, which can be seen using the lslv command, is closed. It becomes open when, for example, a file system has been created in the logical volume and the logical volume is mounted.
Logical volumes can also be copied with the cplv command, listed with the lslv command, removed with the rmlv command, and have the number of copies they maintain increased or decreased with the mklvcopy and the rmlvcopy commands, respectively. Logical Volumes can also be relocated when the volume group is reorganized. Figure 2. A Volume Group Containing Three Physical Volumes. This illustration shows three physical volumes, each
The system allows you to define up to 255 logical volumes per standard volume group (511 for a big volume group and 4095 for a scalable volume group), but the actual number you can define depends on the total amount of physical storage defined for that volume group and the size of the logical volumes you define.
Logical partitions
When you create a logical volume, you specify the number of logical partitions for the logical volume.
A logical partition is one, two, or three physical partitions, depending on the number of instances of your data you want maintained. Specifying one instance means there is only one copy of the logical volume (the default). In this case, there is a direct mapping of one logical partition to one physical partition. Each instance, including the first, is termed a copy. Where physical partitions are located (that is, how near each other physically) is determined by options you specify when you create the logical volume.
File systems
The logical volume defines allocation of disk space down to the physical-partition level. Finer levels of data management are accomplished by higher-level software components such as the Virtual Memory Manager or the file system. Therefore, the final step in the evolution of a disk is the creation of file systems.
You can create one file system per logical volume. To create a file system, use the crfs command.
Related concepts
File systems A file system is a hierarchical structure (file tree) of files and directories.
Limitations for logical storage management
The following table shows the limitations for logical storage management.
Although the default maximum number of physical volumes per volume group is 32 (128 for a big volume group, 1024 for a scalable volume group), you can set the maximum for user-defined volume groups when you use the mkvg command. For the rootvg, however, this variable is automatically set to the maximum by the system during the installation.
- Volume group — • 255 volume groups for the 32 bit kernel • 4096 volume groups for the 64 bit kernel Note: The device table on the 64 bit kernel restricts the number of active major numbers to 1024. Consequently, the number of active volume groups is restricted to less than 1024 volume groups.
- Physical volume — (MAXPVS/volume group factor) per volume group. MAXPVS is 32 for a standard volume group, 128 for a big volume group, and 1024 for a scalable volume group.
- Physical partition — Normal and Big Volume groups: (1016 x volume group factor) per physical volume up to 1024 MB each in size. Scalable volume groups: 2097152 partitions up to 128 GB in size. There is no volume group factor for scalable volume groups.
- Logical volume — MAXLVS per volume group, which is 255 for a standard volume group, 511 for a big volume group, and 4095 for a scalable volume group.
If you previously created a volume group before the 1016 physical partitions per physical volume restriction was enforced, stale partitions (no longer containing the most current data) in the volume group are not correctly tracked unless you convert the volume group to a supported state. You can convert the volume group with the chvg -t command. A suitable factor value is chosen by default to accommodate the largest disk in the volume group.
For example, if you created a volume group with a 9 GB disk and 4 MB partition size, this volume group will have approximately 2250 partitions. Using a conversion factor of 3 (1016 * 3 = 3048) allows all 2250 partitions to be tracked correctly. Converting a standard or big volume group with a higher factor enables inclusion of a larger disk of partitions up to the 1016* factor. You can also specify a higher factor when you create the volume group in order to accommodate a larger disk with a small partition size.
These operations reduce the total number of disks that you can add to a volume group. The new maximum number of disks you can add would be a MAXPVS/factor. For example, for a regular volume group, a factor of 2 decreases the maximum number of disks in the volume group to 16 (32/2). For a big volume group, a factor of 2 decreases the maximum number of disks in the volume group to 64 (128/2).
LVM device size limits
The following limits are the LVM architectural limits. If LVM Bad Block Relocation is required, then PV sizes cannot be larger than 128 GB. For size limitations of specific storage devices, refer to the storage device documentation.
The following size limits are for a 64–bit kernel:
Original VG
PV Limit: 1GB (PP) * 16256 (PPs/PV, factor=16) = 15.9 TB
LV Limit: 1GB (PP) * 32512 (PPs/VG) = 31.8 TB
Big VG
PV Limit: 1GB (PP) * 65024 (PPs/PV, factor=64) = 63.5 TB
LV Limit: 1GB (PP) * 130048 (PPs/VG) = 127 TB
SVG PV & LV Limit: 128GB (PP) * 2048K (PPs/PV) = 256 PB
The following size limits are for a 32–bit kernel:
All VG Types
PV Limit: < 1 TB
LV Limit: < 1 TB