Storage component of Aix learning logs (1!

Source: Internet
Author: User
Tags blank page
Storage components generally include files, directories, file systems, logical storage, physical storage, and logical volume manager. Generally, users use files and directories, and the system administrator uses other components.
Traditionally, disk space is divided by partitions. You must determine the size of each partition in advance. Each file system is located in a partition. The process of changing the file system and partition size is complex and time-consuming: Back up the file system, delete partitions, create new partitions, and restore the file system.
Partition restrictions are mainly based on this fact: Each partition must be in a continuous disk space, so that a partition can only be on one physical hard disk and cannot be cross-hard disk. A file system can only be on one partition, so the size of the file system and file is limited by the maximum size of the physical hard disk.
Advantages of the logical volume manager (LVM): the logical volume can use discontinuous disk space; the logical volume can span the hard disk; the logical volume size can be dynamically expanded; the logical volume can be mirrored; hard disks can be easily added to the system storage system; logical volumes can be relocated.
Physical storage:
Physical volume (physical volume PV): physical hard disk; physical partition (physical partition): minimum allocation unit of physical volume; volume group VG: a collection of related physical volumes.
A physical volume can be a built-in or external physical hard disk. Before using a physical volume, you must create a volume group on it or add the physical volume to an existing volume group. That is to say, the physical volume must belong to a volume group before it can be used. When a physical hard disk is added to the system, a device file/dev/hdiskn is generated in the/dev directory. This file can be accessed directly, but this is generally not the case. Physical volumes are divided into physical partitions, which are the basic disk space allocation units in Aix. All physical partitions in a volume group are of the same size. A volume group is the largest storage allocation unit in Aix. Generally, a volume group is prepared for an application. A volume group consists of integer hard disks. The volume group cannot span hard disks. A volume group (such as a volume group composed of a group of external SCSI disks) can be detached from a system and attached to a system.
Volume group:
A new hard disk can be added to the volume group. An external hard disk should be included in an independent volume group. Reasons for creating a new volume group: separating the user's file system from the operating system files for security reasons, maintenance reasons, data mobility.
After the system is installed, a root volume group (rootvg) has been created on the internal hard disk, which contains the operating system file and system logical volume. Unused hard disks can be added to rootvg, or a new volume group can be created for them. External hard disks should be placed in one or more volume groups, so that the system logical volume will not be affected when these hard disks are unavailable or move other systems. Separate the file systems used by the user's file system from the operating system into different volume groups, so that the user's files will not be affected during system updates, reinstalls, or crash fixes. In terms of maintenance, you do not have to back up or restore user data before updating or reinstalling the system. In terms of security, you can use the command varyoffvg to make the volume group unavailable.
Logical Storage
Logical partition (LP): corresponds to a physical partition; logical volume (LV): a set of logical partitions, which can span physical volumes. If no image is available, each logical partition corresponds to one physical partition. Obviously, the logical partition size in the same volume group is equal to the physical partition size. A logical volume consists of one or more logical partitions. It must be in a volume group. A logical volume cannot span a volume group, but can span physical volumes, as long as the volume group contains multiple hard disks, the logical volume can use discontinuous physical space. any logical partition in the logical volume can point to any physical partition, as long as it is not used by other logical volumes. As long as the volume group has enough free space, the logical volume size can be dynamically expanded at any time. the operation procedure is basically the same as modifying the partition size on traditional UNIX storage. A volume group also contains an integer logical volume, which is a combination of physical volumes and a logical volume. The only difference is that a volume group can have no logical volume, but cannot have a physical volume. By default, the AIX storage structure is limited to a maximum of 255 volume groups per system, a maximum of 32 physical volumes per volume group, and a maximum of 256 MB of physical partitions, each physical volume can contain up to 1016 logical volumes, 256 logical volumes per volume group, and 32512 logical partitions per logical volume.
Purpose of logical volume:
A logical volume can contain a log file system (for example,/dev/hd4), a paging space (for example,/dev/hd6), and a Logging Device (for example: /dev/hd8), boot logical volume (BOOT logical volume, BLV, for example:/dev/hd5), unstructured (bare device ). After the system is installed, rootvg is automatically created, which contains a set of basic logical volumes and file systems, such as paging space, file system logs, and startup logical volumes. You can use the mklv command or Smit to create a new logical volume. AIX uses the log file system, which ensures the structure consistency of the file system through mechanisms similar to database logs. The page feed space stores data temporarily unavailable in the virtual memory. The log records the changes to the file system structure that have not been actually written to the hard disk in the logical volume. The start logical volume is a continuous space on the hard disk and is used to store the startup image. Bare devices are logical volumes of space. Some applications, such as databases, can or must directly use bare devices.
File System:
The file system is a method for storing data and has a hierarchical directory structure. The Aix file system has three types: Log File System (JFS) and CD-ROM file system (cdrfs ); network File System (NFS); different file systems are connected in a directory structure. Although different types of file systems have different physical structures, they are the same for applications and users. Multiple file systems are organized in the same hierarchical directory structure. For users, only one file directory tree is displayed in one system. The file system size is not automatically expanded. Therefore, even if the volume group has free space, the file system may be full due to insufficient space in a file system.
The purpose of establishing a file system is to physically place it anywhere on the hard disk (performance). Some tasks use a file system more efficiently, such as backup and movement; you can restrict the use of hard disk space, ensure consistency of the entire directory file tree structure, a file system is damaged without affecting other file systems, and establish a special security solution.
There are five file systems on the newly installed system:
/(Root) =/dev/hd4: This is the root of the entire file directory tree. It contains files and directories that are extremely important to system operations, including/Dev and/etc.
/Usr =/dev/hd2: operating system commands, libraries, and applications.
/Var =/dev/hda9var: Variable Buffer Pool and some record files. The file and its length of this file system change with system activity.
/Home =/dev/hd1: The main directory of the user. This is a traditional place for storing user data.
/Tmp =/dev/hd3: temporary file space that can be used by all users, which needs to be sorted regularly.
2006-4-25
1. About the/etc/filesystems File
The/etc/filesystems file stores the attributes of each file system. The information of each file system is stored in the format of a section. The beginning of each section is the resource name followed by a colon, followed by the attribute list of the resource, the format of each row is "property = value ".
The meaning of each attribute is:
Check: used to determine whether the file system is checked by default when the fsck command is used.
Dev: the path of the device file (special file) where the file system is located, or the name of another file or directory to be mounted.
Mount: whether the file system is mounted by default when Mount is used. Optional values:
Automatic mounting upon startup
True when the mount all command is used
False
Type: this parameter is used to differentiate file systems into groups, so that file systems in the same group can be mounted together with the Mount-T command.
VFS: indicates the file system type.
Vol: File System tag name.
The device used to write log information (this option is only valid for the log file system ).
Mount a File System)
A tool used to logically connect a file system to a hierarchical directory. A file system is associated with a special file (device, that is, a logical volume) in the/dev directory. After a file system is mounted, the related logical volume and its content are connected to the hierarchical directory structure.
The full path must be used when the file system is mounted. The file system can be automatically mounted when the system is started. If you use Smit to create a file system, the mount point is automatically created; you can also mount and detach a file system using Smit.
Mount the file system to an empty directory. You can mount the file system to a directory with sub-directories and files. The original files and subdirectories are "hidden" and cannot be accessed without being lost. After the file systems that overwrite them are uninstalled, these files and directories can be accessed again. Not all users have the permission to hook up any file system. To determine whether a user has the permission to mount the file system, the principle is: whether the user has the write permission in the default mount point of the file system (specified in the/etc/filesystems file. Root users can mount any file system without any of the preceding restrictions.
Display file system: LSFS can list all types of file systems that have been defined. It obtains information from the/etc/filesystems file and the logical volume of the file system.
2. Smit LVM logical volume menu Manager
Volume groups: provides a menu for volume group operations
Logical volumes: Provides menus for logical volume operations. A log file system is included. You can also create a page swap space or a logical volume for the device to be detached from the memory. However, only the underlying control of the logical volume, such as the partition allocation policy and image of the logical volume, can be found in this menu.
Physical volumes: You can configure a physical disk in this menu ).
Paging space: add, delete, activate, and display a page Feed Device.
Display volume group information:
Lsvg displays all volume groups
Lsvg-O display active volume groups
Display the volume group status:
Lsvg rootvg
Display volume groups by physical volume:
Lsvg-P vg_name displays information about all physical volumes in a volume group, including the physical volume name, physical volume status, total number of physical partitions on each volume, and number of free physical partitions on each volume, and the allocation of idle physical partitions in various locations.
Lsvg-l vg_name displays information about all logical volumes in a volume group, including the logical volume name and type (such as file system and paging space) the number of logical partitions occupied by each logical volume, the number of physical partitions occupied by each logical volume, the number of logical volumes that span several physical volumes, and the status of the logical volume. If the logical volume contains a log file system, the mount point is also displayed.
Add or delete a volume group:
The Smit mkvg command is used to create a volume group. The new volume group must contain at least one physical volume. Here, physical partition must be 2 to the Npower, in the unit of m; Smit does not have the command to delete the volume group, and the system does not have the command to delete the volume group. The normal method to delete a volume group is to use the Smit remove a physical volume from a volume group menu. When the last physical volume in a volume group is deleted, this volume group is also deleted from the system.
Modify volume group:
Smit chvg is used to modify some features of a volume group.
The extend vg_name hdiskn command adds a new physical volume to an existing volume group. The status of this physical volume device must be available.
When reducevg vg_name hdiskn deletes a physical volume, its volume group must be inactive. If the deleted physical volume is the only one in the volume group, the volume group is also deleted.
Release/activate a volume group:
Varyonvg: The command activates the volume group. The-s option enables the volume group to enter the management mode, that is, prohibit users from accessing it, but the system administrator can execute system management commands on it.
Varyoffvg: Command to remove the volume group, provided that no logical volume in the volume group is open, otherwise the command execution fails. Before deleting a physical volume from a volume group, you must make it inactive. Otherwise, errors may occur and data loss may occur.
Smit importvg import/export volume group
In either case, you need to export a volume group: migrate the volume group and its physical volumes from one system to another, or update the definition of the volume group. The premise for exporting a volume group is that it must be inactive. The essence of the volume group export operation is to delete the volume group definition from the ODM, which does not perform any write operations on the volume group itself. Rootvg volume group cannot be exported.
Command: Export vg_name
The case where you want to introduce a volume group is similar to that for export. To introduce a volume group to the system, read the volume group information from any physical volume under the volume group and add the volume group definition to the ODM. Do not try to introduce a rootvg volume group. Unless instructed by technical support personnel, do not force interruption when the import operation is being executed.
Command: importvg-y vg_name-V 50 hdisk1

2006-4-26
1. Images
In Aix, an image is a logical partition that corresponds to a physical partition in the same volume group.
Write time sequence: parallel: all physical partitions are simultaneously written (parallel)
Serial: sequential write (sequential) of each physical partition)
In Aix storage management, logical volume images mean that data in each partition of a logical volume has two to three copies, each of which occupies one physical partition. In this way, even if one or two hard disks are effective, the data in the logical volume is still complete and accessible. Generally, each copy is on a different physical volume. In Aix, each logical volume can have up to three copies.
For existing logical volumes, you can use the mklvcopy command to add an image copy. The syncvg command is used to synchronize copies when an image is just created or required. The image technology has a certain impact on the hard disk write performance, but some adjustments can be made by modifying the sequential policy during inhalation. The parallel (parallel) method can achieve the best performance, but data inconsistency may occur when the disk fails to update each copy, however, this can be done by setting the mirror write consistency option.
Logical Volume Allocation Policy:
When creating or modifying a logical volume, you can set rules for allocating physical partitions to the logical volume. These rules are related to the performance of logical volume access. The physical volume policy specifies how to store data in a logical volume. Options include center, middle, and edge. There are two main steps for the hard disk to access data that consume a relatively large amount of time: Move the head to the data disk and perform read/write operations. No matter where the data is on the hard disk, the read/write time is almost the same, but the volume of head movement is closely related to the data storage location.
For data in the center, the average time for the head to move from any location on the hard disk is the shortest, so the data access line here is the best, and the middle and edge are reduced in turn. Therefore, physical partitions in the center should be allocated to the most frequently accessed logical volumes, and physical partitions in the edge should be allocated to the least accessed logical volumes. When creating a logical volume, the internal policy of the physical volume in Aix is middle by default. The policy between physical volumes determines which physical volumes are used by the logical volume, and whether the selected physical volume is stored centrally or distributed to each physical volume as much as possible. If you choose to store the logical volume in a centralized manner, the logical volume will fill the first volume and then the next volume according to the sequence selected by the user.
Smit logical volume menu Smit LV
Show all logical volumes in the volume group: lsvg-o | lsvg-il
Displays the status information of a logical volume: lslv lv_name
Displays the distribution chart of physical partitions used by the logical volume on the physical volume: lslv-l lv_name
Display the ing between logical partitions and physical partitions used by the logical volume and the overall distribution of physical partitions on each physical volume: lslv-M lv_name
Add logical volume: Smit mklv
The mklv command is used to create a logical volume. The logical volume name can be specified or automatically generated by the system. The volume group and logical volume size (in logical partitions) of the logical volume must be specified. Other options include allocation policy, number of copies (images), and write sequence.
Delete logical volume: Smit rmlv
The rmlv command is used to delete logical volumes. Note: Do not use the rmlv command to delete logical volumes that contain log file systems or paging spaces. The information of these upper-layer structures is stored in the ODM and Related Files (for example,/etc/filesystems). If you use the rmlv command to directly Delete the logical volumes where they are located, the system configuration is inconsistent with the actual situation.
The Smit lvsc command is used to modify the logical volume feature. You can increase the logical volume space at any time, provided that the volume group has enough free physical partitions. The extendlv command can implement this function. The new physical partition allocation policy can be different from the original logical volume definition. The logical volume cannot be reduced. To achieve this goal, you must back up and delete the logical volume data, create a new logical volume that meets the size requirements, and restore the data.
The Smit mklvcopy command is used to add logical volume copies. Depending on the allocation policies for physical volumes of logical volumes, the number of free partitions on the volume group and each physical volume must be limited. After creating a new logical volume copy, execute the syncvg command on the volume group to ensure that the copied content is the same.
Smit physical volume menu
Show all physical volumes in the system: lspv
Displays the status information of a physical volume: lspv pv_name
Displays the logical volumes in a physical volume: lspv-l pv_name
Displays the usage of physical partitions in a physical volume. lspv-P pv_name
2006-4-27
1. Page feed Space
The page feed space is the backup of the real memory. The actual memory is divided into 4 kb page frame by the operating system ). Each page can have one or more 4 kb pages in the page feed space as its backup. The page boxes occupied by all programs and data installed in the real memory are displayed, it is mapped to pages in the page feed space. The operating system maintains the status of all page boxes. When the system requires some code or data, if the real memory has idle page boxes, use them directly. If no, the operating system will find the least recently used page box, and then determine whether the content is different from the content of the page feed space. The operating system writes the content of the page box to the page feed space, this is called "swap out", and then move the new code or data to a blank page. If there is a difference, the operating system will directly use the new code or data to overwrite the page content, this is called "Stealing ". When the system requires code or data that does not exist in the real memory, but there is code or data in the page feed space, the operating system still prepares Available page boxes for the space based on the above principles, then, read the code or data from the page feed space.
When the real memory is not applied, the page feed space is used as the second memory. only part of the program and data must exist in the real memory, which makes the page feed space application possible; the page feed space usage must be checked regularly. If the page feed space is greater than 70%, a new page feed space needs to be added. When the page feed space is seriously insufficient, a piece of information will be sent to the console, and new processes cannot be generated, the system may be shut down; the page feed space is not a substitute for memory, except for temporary data storage, it cannot complete other memory functions;
Data and Code temporarily unavailable in the memory of the page feed space. When the real memory in the system is insufficient, he swap out the least recently used data in the real memory to the page feed space, thus freeing up the real memory space for the program. The page feed space is not a substitute for memory. Increasing the page feed space without limit cannot make the system accommodate more applications. If most of the memory is used for the code and data that the application needs to frequently access, no matter how large the page feed space is, frequent near-swap operations will always occur, at this time, the system will be busy with the change of near-out operations, and the resources (including CPU and I/O) for normal processing will be greatly reduced. In this case, you need to expand the physical memory.
Position of the page feed space on the hard disk
The paging space is a logical volume with the attribute "Paging". The principle of maximizing the performance of the paging space is to place the logical volume of the paging space at the "center" of the physical volume; multiple paging Space Devices (logical volumes) of the same size are used, each device is on a different hard disk, and the paging space devices are placed on idle hard disks. The system cannot start because there is no paging space. During Operating System installation, the default paging space device/dev/hd6 is created on the physical volume/dev/hdisk0.
Display the dialog box definition and status
Show all page feed space size and usage: LSPs-
Show physical memory usage: lsattr-EHL sys0-A realmen
Display the device that is automatically enabled when the system starts: CAT/etc/swapspaces
Add a paging Space Device: Smit mkps. The options include: the volume group where the new paging Space Device (logical volume) is located; and the physical volume where the new paging Space Device (logical volume) is located; the size of the New Page Swap Space Device (in logical partition units) and so on. Note: A paging space device can only be on one physical volume.
Modify the page feed Space Device: Smit CHPs. You can use CHPs to expand the page feed space. The inactive page feed space can be activated at any time. The shell script/etc/rc executed at system startup has a command Swapon-, it activates the page feed space defined in the/etc/swapspaces file.
* ******** Storage component summary **********
Structure of the logical volume manager:
A volume group contains one or more physical volumes. Each physical volume is divided into physical partitions. logical partitions correspond to physical partitions;
Logical volumes can be created: Log File System, page feed space, and logical volume startup
An image is a high-availability technology that enables two to three copies of a logical volume. You can use the Smit command to add, modify, and delete volumes, physical volumes, and logical volumes; changing the page space is required to start the AIX system. You must monitor the use of changing the page space. If there is not enough, add or expand the changing page space. Changing the page space can be expanded at any time.

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.