Clone rootvg (alt_disk_copy)

List all rootvg disks

1
2
3
root@temp02:/ # lspv
hdisk1 00c21251fa668def rootvg active
hdisk0 00c21251f4de5f81 rootvg active

List all file system across rootvg, hdisk0, and hdisk1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
root@temp02:/ # lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 2 4 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 20 40 2 open/syncd /
hd2 jfs2 10 20 2 open/syncd /usr
hd9var jfs2 1 2 2 open/syncd /var
hd3 jfs2 28 56 2 open/syncd /tmp
hd1 jfs2 1 2 2 open/syncd /home
hd10opt jfs2 20 40 2 open/syncd /opt
hd11admin jfs2 1 2 2 open/syncd /admin
lg_dumplv sysdump 4 4 1 open/syncd N/A
livedump jfs2 1 2 2 open/syncd /var/adm/ras/livedump
lvsource jfs2 72 72 1 closed/syncd /source

root@temp02:/ # lspv -l hdisk0
hdisk0:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
livedump 1 1 00..01..00..00..00 /var/adm/ras/livedump
hd11admin 1 1 00..00..01..00..00 /admin
lg_dumplv 4 4 00..04..00..00..00 N/A
hd10opt 20 20 00..00..20..00..00 /opt
hd3 28 28 00..00..28..00..00 /tmp
hd1 1 1 00..00..01..00..00 /home
hd2 10 10 00..00..10..00..00 /usr
hd9var 1 1 00..00..01..00..00 /var
hd8 1 1 00..00..01..00..00 N/A
hd4 20 20 00..00..20..00..00 /
hd5 1 1 01..00..00..00..00 N/A
hd6 2 2 00..02..00..00..00 N/A

root@temp02:/ # lspv -l hdisk1
hdisk1:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
livedump 1 1 00..01..00..00..00 /var/adm/ras/livedump
lvsource 72 72 00..72..00..00..00 /source
hd11admin 1 1 00..00..01..00..00 /admin
hd10opt 20 20 00..00..20..00..00 /opt
hd3 28 28 00..00..28..00..00 /tmp
hd1 1 1 00..00..01..00..00 /home
hd2 10 10 00..00..10..00..00 /usr
hd9var 1 1 00..00..01..00..00 /var
hd8 1 1 00..00..01..00..00 N/A
hd4 20 20 00..00..20..00..00 /
hd5 1 1 01..00..00..00..00 N/A
hd6 2 2 00..02..00..00..00 N/A

Unmirror rootvg (remove hdisk0)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@temp02:/ # unmirrorvg rootvg hdisk0
0516-1246 rmlvcopy: If hd5 is the boot logical volume, please run 'chpv -c <diskname>'
as root user to clear the boot record and avoid a potential boot
off an old boot image that may reside on the disk from which this
logical volume is moved/removed.
0516-1804 chvg: The quorum change takes effect immediately.
0516-1144 unmirrorvg: rootvg successfully unmirrored, user should perform
bosboot of system to reinitialize boot records. Then, user must modify
bootlist to just include: hdisk1.

root@temp02:/ # lspv
hdisk1 00c21251fa668def rootvg active
hdisk0 00c21251f4de5f81 rootvg active

root@temp02:/ # bosboot -ad hdisk1

bosboot: Boot image is 61489 512 byte blocks.

Verify the file system in hdisk0

1
2
3
4
5
6
7
8
9
10
11
12
# lspv -l hdisk0
hdisk0:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
lg_dumplv 4 4 00..04..00..00..00 N/A

# mklvcopy lg_dumplv 2 hdisk0 hdisk1

# syncvg -l lg_dumplv

# rmlvcopy lg_dumplv 1 hdisk0

# lspv -l hdisk0

Remove hdisk0 from rootvg

1
2
3
4
5
# reducevg rootvg hdisk0

# lspv
hdisk1 00c21251fa668def rootvg active
hdisk0 00c21251f4de5f81 None

Clone rootvg from hdisk1 -> hdisk0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# alt_disk_copy -d  hdisk0
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5.
Creating logical volume alt_hd6.
Creating logical volume alt_hd8.
Creating logical volume alt_hd4.
Creating logical volume alt_hd2.
Creating logical volume alt_hd9var.
Creating logical volume alt_hd3.
Creating logical volume alt_hd1.
Creating logical volume alt_hd10opt.
Creating logical volume alt_hd11admin.
Creating logical volume alt_lg_dumplv.
Creating logical volume alt_livedump.
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/ras/livedump file system.
Generating a list of files
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the alternate file system...
Modifying ODM on cloned disk.
Building boot image on cloned disk.
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
Bootlist is set to the boot disk: hdisk0 blv=hd5

Verify the boot order

1
# bootlist -m normal hdisk[1]

Destroy altinst_rootvg / old_rootvg

1
2
3
4
5
6
7
8
9
10
# lspv
hdisk0 00c86220cabdc88c rootvg active
hdisk1 00c86220d9e58aff altinst_rootvg

# alt_rootvg_op -X altinst_rootvg
Bootlist is set to the boot disk: hdisk0 blv=hd5

# lspv
hdisk0 00c86220cabdc88c rootvg active
hdisk1 00c86220d9e58aff None

Re-form AIX mirror

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# extendvg -f rootvg hdisk1

# mirrorvg '-S' rootvg hdisk0 hdisk1
0516-1804 chvg: The quorum change takes effect immediately.
0516-1126 mirrorvg: rootvg successfully mirrored, user should perform
bosboot of system to initialize boot records. Then, user must modify
bootlist to include: hdisk0 hdisk1.

# bosboot -a -d hdisk0
trustchk: Verification of attributes failed: /etc/vfs
: mode

bosboot: Boot image is 61489 512 byte blocks.

# bosboot -a -d hdisk1
trustchk: Verification of attributes failed: /etc/vfs
: mode

bosboot: Boot image is 61489 512 byte blocks.

# bootlist -m normal hdisk0 hdisk1
# bootlist -m normal -o
hdisk0 blv=hd5 pathid=0
hdisk1 blv=hd5 pathid=0

# mklvcopy lg_dumplv 2 hdisk0 hdisk1

# syncvg -l lg_dumplv

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 4 8 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 96 192 2 open/syncd /
hd2 jfs2 80 160 2 open/syncd /usr
hd9var jfs2 80 160 2 open/syncd /var
hd3 jfs2 80 160 2 open/stale /tmp
hd1 jfs2 40 80 2 open/stale /home
hd10opt jfs2 80 160 2 open/stale /opt
hd11admin jfs2 40 80 2 open/stale /admin
lg_dumplv sysdump 44 88 2 open/syncd N/A
livedump jfs2 8 16 2 open/stale /var/adm/ras/livedump
lvsource jfs2 560 1120 2 open/stale /source
paging00 paging 192 384 2 open/stale N/A
lvu01 jfs2 784 1568 2 open/stale /u01
auditlv jfs2 16 32 2 open/stale /audit
lvnmon jfs2 16 32 2 open/stale /nmon

* wait until all LV STATE = synced