Go to: AIx disk management

Source: Internet
Author: User

Starting from the question, I have never been in touch with AIX before, and Linux is just a fake application. After installing DB2 on the server, install was and find that the default installation directory space is not enough. I don't know how to do this. I only know that there are four hard disks on the test machine, the last two are just inserted, and the total space is certainly enough, but I don't know how to use partition and mount effectively. I did not dare to blind myself, so I decided to make it clear from the ground up and continue.

1. Hard Disk Type and physical GEOMETRIC STRUCTURE
Hard Disks are mainly SCSI, IDE, and popular SATA; any hard disk must be produced according to certain standards; with the upgrade of the corresponding standards, hard Disk production technology is also upgrading; such as SCSI standards have gone through the SCSI-1, SCSI-2, SCSI-3; which we often see in the server site is based on Ultral-160 standards; the IDE follows the ATA standard, while the popular Sata is the upgraded version of the ATA standard. The IDE is a parallel device, while the Sata is a serial port. The development purpose of Sata is to replace the IDE;

The physical geometric structure of a hard disk is composed of a disk, a disk surface, a cylindrical disk, and a sector. A hard disk is enclosed by several discs, forming a decent bar; each disc has an upper/lower surface. The head is in contact with the disk surface to read data;

2. Hard Disk Partition criteria
Hard Disk Partitions are composed of primary partitions, extended partitions, and logical partitions. Therefore, we must follow this standard for Hard Disk Partitions. the maximum number of primary partitions (including extended partitions) is four, the number of hard disks in the primary partition (including extended partitions) is determined by the Master Boot recorder (MBR). MBR stores startup management programs (grub, Lilo, ntloarder, etc.) and Partition Table records. The extended partition is also a primary partition. The extended partition can contain more logical partitions. Therefore, the range of the primary partition (including extended partitions) is from 1 to 4, logical partitions start from 5;
MBR (Master Boot Record), that is, the Master Boot Record, located in the whole hard disk's 0 track 0 cylindrical 1 sector. However, in a total of 512 bytes of the primary Boot Sector, MBR only occupies 446 of the bytes (offset 0 -- offset 1bdh ), the other 64 bytes (offset 1beh -- offset 1fdh) are handed over to the DPT (Disk Partition Table), and the last two bytes "55, AA" (offset 1feh-offset 1ffh) is the end mark of the partition. This constitutes the primary Boot Sector of the hard disk. Structure.

Main root record

446 bytes for the Main Boot Program

Partition Information 1 (16 bytes)
Partition Information 2 (16 bytes)
Partition Information 3 (16 bytes)
Partition information 4 (16 bytes)

 

For example:

Quote:
Device boot start end blocks ID system
/Dev/hda1*1 765 6144831 7 HPFs/NTFS
/Dev/hda2 766 2805 16386300 C w95 FAT32 (LBA)
/Dev/hda3 2806 9729 55617030 5 extended
/Dev/hda5 2806 3825 8193118 + 83 Linux
/Dev/hda6 3826 5100 10241406 83 Linux
/Dev/hda7 5101 5198 787153 + 82 Linux swap/Solaris
/Dev/hda8 5199 6657 11719386 83 Linux
/Dev/hda9 6658 7751 8787523 + 83 Linux
/Dev/hda10 7752 9729 15888253 + 83 Linux

Through this example, we can see that the primary partition has 3, from the hda1-hda3, the extended partition by the hda5-hda10; this hard disk does not have the primary partition 4, so it does not show the primary partition hda4; but the logical partition cannot start from 4, because it is the location of the primary partition.

 

3. Representation of hard drive devices (including mobile storage devices) on Linux or other UNIX-like systems

IDE Hard Disks are generally expressed as HD * in Linux or other UNIX-like systems, such as hda, HDB ......, you can view it through fdisk-L. Sometimes you only have one hard disk, but HDB is displayed in the operating system, which is related to the hard disk jumper. In addition, most HDC devices are optical drive devices; if you have two hard disks: hda and HDB. It is useless to say too much in this regard. It is better to use fdisk-L as the standard;

SCSI and SATA hard disks are usually represented as SD * in Linux, for example, SDA and SDB ...... take fdisk-L as the standard.

The mobile storage device is represented as SD * in Linux, for example, SDA, SDB... is subject to fdisk-L.
 

4. AIX Disk System

A. Basic concepts:
PV physical volume: A common direct access storage device, which can be fixed or movable. The representative is the hard disk.
VG volume group:AIXA volume group consists of a group of physical hard disks, that is, one or more physical volumes.
PP physical partition: physical partitions are divided into consecutive storage units of the same size. The physical partitions in a volume group are of the same size.
LP logical partition: the logical unit mapped to a physical partition. A logical partition can correspond to one or more physical partitions.
LV logical volume: a set of logical partitions in a volume group. The logical partitions in a logical volume are continuous, but the physical partitions are discontinuous, it can be on one disk or different disks.
FS File System: refers to the user-oriented storage space in the AIX system. A logical volume can only create one file system. That is to say, a file system corresponds to one logical volume. If a logical volume is deleted, the file system is also deleted.

B. Storage Structure:
The logical Volume LV cannot be accessed directly. It is a raw device (bare device). A file system is built on the logical volume, and the file system can be accessed by users. Create a directory in the file system and a file in the directory.

Physical volumes, Volume groups, physical partitions, logical volumes, logical partitions, and logical volumesOperating SystemConcept
File Systems, directories, and files are user-oriented concepts.

 

C. configuration data of LVM
Volume group description area (vgda): Describes the correspondence between all physical and logical volumes in the volume group.
Vgsa: records the status information of physical volumes and physical partitions in the volume group. When the volume group is activated, determines which physical partitions are available.
Logical volume control block (lvcb): it is located at the beginning of each logical volume and contains information about the logical volume, occupying hundreds of bytes.

The LVM management command updates the vgda content. When a hard disk becomes PV, the hard disk begins to retain a part of the space to store the vgda information. When it is added to the volume group, the volume group information is written to the vgda region. When the volume group is deleted, the vgda data is also cleared. The data is also stored in the ODM database of the AIX system, when importing a volume group, write the vgda information to the ODM and delete it when exporting it.

 

D. Disk Quorum
Each physical volume in a volume group contains at least one vgda and vgsa. When a volume group has only one hard disk, the hard disk contains two copies of vgda and vgsa. When the volume group consists of two hard disks, one has two copies, and the other has one copy, when the volume group consists of more than three hard disks, each disk has one copy. If the disk quorum exists, ensure that more than 51% of vgda/vgsa in the volume group can be accessed normally. You can also disable the disk quorum.

 

E. Restrictions on logical Storage Management
VG count: a maximum of 255 VG IDs per System
PV count: for a common volume group, each VG can have up to 32 PVS. For a large VG, each volume group can have up to 128 PVS.
PP count: Each PV can have a maximum of 1016 PP
LV count: for common VG, each volume group can have a maximum of 255 LV, and for large VG, each VG can have a maximum of 512 LV
Number of LP: Each LV can have a maximum of 32512 lp
PP and LP size: 1 m to 1024 m must be the power of 2
Number of LP mapped PP: One LP can map 1-3 pp

F. Physical region distribution
Outer-edge: stores infrequently accessed data.
Outer-middle: default location when creating a logical volume
Center: the fastest and fastest disk search time.
Inner-middle: A little slower than the middle
Inner-edge stores infrequently accessed Data

 

5. Adjust the file system size when the VG space is sufficient

The procedure is generally as follows:

1. First determine the volume group you are using
========================================================== ============================================

# Lsvg-o
Rootvg
#
========================================================== ============================================

Because my machine has only one rootvg volume group, I only need to operate on it.
.

2. view the volume group information
========================================================== ============================================

# Lsvg rootvg
Volume group: rootvg identifier: 00098d9f00004c0000000
0f9b120700b
VG state: Active pp size: 64 megabyte (s)
VG permission: read/write total PPS: 542 (34688 megabytes)

Max LVS: 256 free PPS: 390 (24960 megabytes)

LVS: 9 used PPS: 152 (9728 megabytes)

Open LVS: 8 quorum: 2
Total PVs: 1 VG descriptors: 2
Stale PVs: 0 stale PPS: 0
Active PVs: 1 auto on: Yes
Max PPS per PV: 1016 Max PVs: 32
LTG size: 128 kilobyte (s) Auto Sync: No
Hot spare: No
#
========================================================== ============================================

Total PPS: 542 (34688 megabytes) indicates the total disk space of your machine, or
The size of physical space that can be identified by the system. My hard disk is 36 GB.
Free PPS: 390 (24960 megabytes) indicates how much hard disk space is not used.
You can add space to your file system. I have around 24 GB of space left.
Used PPS: 152 (9728 megabytes) physical usage of the existing file system, I used around 9 GB.

3. Before adding space, you can view the size and usage of the following existing file systems.
========================================================== ============================================

# DF-TK
Filesystem 1024-blocks used free % used mounted on
/Dev/hd4 131072 17452 113620 14%/
/Dev/hd2 3211264 1288216 1923048 41%/usr
/Dev/hd9var 589824 23800 566024 5%/var
/Dev/hd3 589824 18684 571140 4%/tmp
/Dev/hd1 3145728 2023192 1122536 65%/home
/Proc---/proc
/Dev/hd10opt 65536 9000 56536 14%/OPT
/Dev/cd0 638662 638662 0 100%/CDROM
#
========================================================== ============================================

The-k parameter indicates that 1024 bytes/block is used for viewing. Therefore, the/home directory has about 3 GB space.

4. To increase the space of my/Home file system, you can use Smitty FS or the following command, but increase the number
The amount is limited by the amount of free PPS. Because it is easy to increase the file system capacity, but it is difficult to reduce the size, because
We recommend that you create a new file system so that you can delete the file system to recycle space after it is used up.

========================================================== ============================================

# Chfs-a size = + 2000000/home
Filesystem size changed to 8388608
#
========================================================== ============================================

It adds 2000000 blocks, each of which is 512 bytes. Therefore, it increases by about 1048576 kb and 1 GB.

5. Check the file system again.
========================================================== ============================================

# DF-TK
Filesystem 1024-blocks used free % used mounted on
/Dev/hd4 131072 17452 113620 14%/
/Dev/hd2 3211264 1288216 1923048 41%/usr
/Dev/hd9var 589824 23800 566024 5%/var
/Dev/hd3 589824 18684 571140 4%/tmp
/Dev/hd1 4194304 2056608 2137696 50%/home
/Proc---/proc
/Dev/hd10opt 65536 9000 56536 14%/OPT
/Dev/cd0 638662 638662 0 100%/CDROM
#
========================================================== ============================================

OK, the/Home file system capacity has changed to 4 GB, and the file system capacity has been increased successfully.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.