Aix rootvg Image

Source: Internet
Author: User

Generally, backup is required at the operating system level. One of the most common backup methods for an operating system is mirroring. In practice, generally, the volume group rootvg is used as an image. Check whether rootvg has been mirrored:

1) lsvg-o

2) lsvg-l rootvg

# Lsvg-l rootvg
Rootvg:
Lv name type LPs PPs PVs LV STATE MOUNT POINT
Hd5 boot 1 2 2 closed/syncd N/
Hd6 paging 16 32 2 open/syncd N/
Hd8 jfs2log 1 2 2 open/syncd N/
Hd4 jfs2 12 24 2 open/syncd/
Hd2 jfs2 10 20 2 open/syncd/usr
Hd9var jfs2 6 12 2 open/syncd/var
Hd3 jfs2 6 12 2 open/syncd/tmp
Hd1 jfs2 400 800 2 open/syncd/home
Hd10opt jfs2 1 2 open/syncd/opt
Hd11admin jfs2 1 2 open/syncd/admin
Fwdump jfs2 2 4 2 open/syncd/var/adm/ras/platform
Lg_dumplv sysdump 3 3 1 open/syncd N/
Livedump jfs2 1 2 open/syncd/var/adm/ras/livedump

As shown in, the ratio of LPs to PPs is, which indicates that rootvg has been mirrored, that is, a copy of rootvg is made to facilitate timely restoration when problems occur at the operating system level. If the ratio of LPs to PPs is, the table name does not have a rootvg image. In addition, PVs is both 2, which indicates that the image operation is performed on two physical disks.

1. view the rootvg size.

# Lsvg rootvg
Volume group: rootvg IDENTIFIER: 00f9150300004c0000000145634ba48d
Vg state: active pp size: 1024 megabyte (s)
Vg permission: read/write TOTAL PPs: 1116 (1142784 megabytes)
MAX LVs: 256 FREE PPs: 199 (203776 megabytes)
LVs: 13 USED PPs: 917 (939008 megabytes)
OPEN LVs: 12 QUORUM: 1 (Disabled)
TOTAL PVs: 2 vg descriptors: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 auto on: yes
MAX packets per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 1024 kilobyte (s) auto sync: no
Hot spare: no bb policy: relocatable
Pv restriction: none infinite retry: no

The size of rootvg is 1142784 MB, but the actual available space is only the size of this data, that is, 571392 MB, because you have performed an image operation.

2. Check which disks are composed of rootvg.

# Lspv
Hdisk0 00f91503634b9132 rootvg active
Hdisk1 00f91503639b9dbf rootvg active
Hdisk2 00f91503747466fd datavg active
Hdisk3 00f915037474679d datavg active
Hdisk4 00f91503ac90ba5d datavg active
Hdisk5 00f91503bbd0aea1 datavg active
Hdisk6 none None

It can be seen that rootvg is composed of hisk0 and hdisk1 disks.

3. Image rootvg

Use the mirrorvg command. The mirrorvg command is used to operate the logical volume most mirrored on an existing volume group. The command for the same function is mklvcopy.

Syntax:

Purpose

Mirrors all the logical volumes that exist on a given volume group.

Syntax

Mirrorvg [-S |-s] [-Q] [-c copies] [-m] [-p copyn = Volume pool] volumegroup [physicalvolume...]

-C copies
Specifies the minimum number of copies that each logical volume must have after the mirrorvg command has finished
Executing. It may be possible, through the independent use of mklvcopy, that some logical volumes may have more
The minimum number specified after the mirrorvg command has executed. Minimum value is 2 and 3 is the maximum value.
Value of 1 is ignored.

-M exact map
Allows processing ing of logical volumes in the exact physical partition order that the original copy is ordered. This
Option requires you to specify a PhysicalVolume (s) where the exact map copy shoshould be placed. If the space is
Insufficient for an exact mapping, then the command will fail. You shoshould add new drives or pick a different set
Drives that will satisfy an exact logical volume mapping of the entire volume group. The designated disks must be
Equal to or exceed the size of the drives which are to be exactly mirrored, regardless of if the entire disk is used.
Also, if any logical volume to be mirrored is already mirrored, this command will fail.

-S Background Sync
Returns the mirrorvg command immediately and starts a background syncvg of the volume group. With this option, it is
Not obvious when the mirrors have completely finished their synchronization. However, as portions of the mirrors
Become synchronized, they are immediately used by the operating system in mirror usage.

-S Disable Sync
Returns the mirrorvg command immediately without specify Ming any type of mirror synchronization. If this option is
Used, the mirror may exist for a logical volume but is not used by the operating system until it has been synchronized
With the syncvg command.

Assume that the image of rootvg is mounted to the hdisk1 disk. The command is as follows:

Mirrorvg-S-c 2 rootvg hsisk0 hdisk1

After the operation is complete, run the following two commands:

(1) bosboot The bosboot command is required to customize the bootrec of the newly mirrored drive.

The bosboot command creates a boot file (boot image) from a RAM (Random Access Memory) disk file system and a kernel. this boot image is transferred to a participating media that the ROS boot code recognizes. when the machine is powered on or rebooted, the ROS boot code loads the boot image from the media into memory. ROS then transfers control to the loaded images kernel.

(2) bootlist The bootlist command needs to be placed med to instruct the system which disk and order you prefer the mirrored boot process to start.

The procedure is as follows:

(1) run the bosboot command

Bosboot-ad/dev/hdisk0
Bosboot-ad/dev/hdisk1

(2) run the bootlist command to set the boot sequence of the system.

Bootlist-m normal hdisk0 hdisk1 cd0

(3) view the guidance results

Bootlist-o-m normal

4. Replace the bad disk in the image volume group

When we find that there is a problem with a disk in the mirror volume group, we need to use a new disk to replace this problematic disk. The procedure is as follows:

(1) cancel the image on the hdisk7 Disk

Unmirrorvg workvg hdisk7

(2) Delete the hdisk7 disk from the volume group
Reducevg workvg hdisk7

(3) Delete hdisk7 at the system level
Rmdev-l hdisk7-d

(4) Identify new Disks

Cfgmgr-v

(5) rename a disk

The newly recognized disk must be hdisk7. The hdiskX name is stored in the underlying ODM database of the operating system. The ODM database contains all the PV, VG, and LV configuration information, this information is similar to the information in VGDA, while the ODM data is also similar to the information in the LV control block. Therefore, you need to delete the original hdisk disk from the system level, and then re-scan the disk, so that the system can identify the new scanned disk name as consistent with the previous name.

Run the following command to view a physical disk: lspv.

ID of the Disk: chdev-l hdisk7-a pv = yes

(6) Add the disk to the volume group

Extendvg workvg hdisk7

(7) view the workvg Image
Mirrorvg workvg

5. Cancel the volume group Image

Command: unmirrorvg

Purpose

Removes the mirrors that exist on volume groups or specified disks. This command only applies to AIX 4.2.1 or later.

Syntax

Unmirrorvg [-c Copies] VolumeGroup [PhysicalVolume...]

For example, cancel the workvg volume group image and keep a copy.

Command: unmirrorvg-c 1 workvg

6 remarks

When unmirrorvg workvg hdisk7 is run, hdisk7 will be the remaining drive in the volume group. This drive is not actually removed from the volume group. You must runMigratepvCommand to move the data from the disk that is to be removed from the system to disk hdisk7.

Migratepv command:

Purpose

Moves allocated physical partitions from one physical volume to one or more other physical volumes.

Syntax

Migratepv [-I] [-l LogicalVolume] SourcePhysicalVolume DestinationPhysicalVolume...

Description

The migratepv command moves allocated physical partitions and the data they contain from the SourcePhysicalVolume to one or more other physical volumes. to limit the transfer to specific physical volumes, use the names of one or more physical volumes in the DestinationPhysicalVolume parameter; otherwise, all the physical volumes in the volume group are available for the traner. all physical volumes must be within the same volume group. the specified source physical volume cannot be encoded in the list of DestinationPhysicalVolume parameters.

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.