Starting with VERITAS Volume Manager (tm) 4.0, there is now the ability to create separate bootable disk groups
Details:
The
instructions below are designed for users who want to make major changes to
their systems, and have the ability to back out those changes in minutes
rather than hours. For example, a user is installing many patches on the
production machine and wants to have the ability to go back to the original
setup without reloading the operating system and software. Other examples
would be: Upgrading, disaster recovery, trying a new software product,
etc.
Perform a full
and verified backup of your system before attempting to use the procedure
outlined below.
1.
Confirm bootdisk has been mirrored and that it is possible to boot from the
mirror disk
There are a
number of ways to mirror the bootdisk. In this example, vxdiskadm option 6 was
used to mirror all the volumes in rootdg onto the disk called
"rootmir".
Check Volume
Manager configuration:
vxprint
-qthg rootdg
dg
rootdg
default default 75000 1098832475.101.sptsunserv1
dm
rootdg01 c0t0d0s2 auto
7181 17674902 -
dm
rootmir c0t1d0s2 auto
7181 17674902 -
v opt - ENABLED ACTIVE
3149307 ROUND
- fsgen
pl
opt-01
opt ENABLED ACTIVE
3149307 CONCAT - RW
sd
rootdg01-04 opt-01 rootdg01
5968241 3149307 0 c0t0d0
ENA
pl
opt-02
opt ENABLED ACTIVE
3149307 CONCAT - RW
sd
rootmir-04 opt-02
rootmir 5968242 3149307 0
c0t1d0 ENA
v rootvol - ENABLED ACTIVE
718200 ROUND
- root
pl
rootvol-01 rootvol ENABLED ACTIVE
718200
CONCAT - RW
sd
rootdg01-B0 rootvol-01 rootdg01 17674901
1 0 c0t0d0
ENA
sd
rootdg01-02 rootvol-01 rootdg01
0 718199 1
c0t0d0 ENA
pl
rootvol-02 rootvol ENABLED ACTIVE
718200
CONCAT - RW
sd
rootmir-01 rootvol-02
rootmir 0 718200
0 c0t1d0 ENA
v swapvol - ENABLED ACTIVE
1052163 ROUND
- swap
pl
swapvol-01 swapvol ENABLED ACTIVE
1052163 CONCAT - RW
sd
rootdg01-01 swapvol-01 rootdg01 718199
1052163 0 c0t0d0
ENA
pl
swapvol-02 swapvol ENABLED ACTIVE
1052163 CONCAT - RW
sd
rootmir-02 swapvol-02 rootmir 718200
1052163 0 c0t1d0
ENA
v usr - ENABLED ACTIVE
4197879 ROUND
- fsgen
pl
usr-01
usr ENABLED ACTIVE
4197879 CONCAT - RW
sd
rootdg01-05 usr-01 rootdg01
1770362 4197879 0 c0t0d0
ENA
pl
usr-02
usr ENABLED ACTIVE
4197879 CONCAT - RW
sd
rootmir-03 usr-02
rootmir 1770363 4197879 0
c0t1d0 ENA
v var - ENABLED ACTIVE
2100735 ROUND
- fsgen
pl
var-01
var ENABLED ACTIVE
2100735 CONCAT - RW
sd
rootdg01-03 var-01 rootdg01
9117548 2100735 0 c0t0d0
ENA
pl
var-02
var ENABLED ACTIVE
2100735 CONCAT - RW
sd
rootmir-05 var-02
rootmir 9117549 2100735 0
c0t1d0 ENA
2. Determine
the plexes which are associated with "rootmir":
vxprint
-g rootdg -F %pl_name -se sd_dm_name=\"rootmir\"
swapvol-02
rootvol-02
opt-02
usr-02
var-02
3. Now begin
the steps to create a separate bootable disk group. Use will be made of the
DiskGroup Split and Join (DGSJ) feature once the plexes identified in the last
step have been dissociated. Refer to the following TechNote for more detailed
usage of
DGSJ:
http://support.veritas.com/docs/240026
vxplex
-g rootdg dis swapvol-02
vxplex
-g rootdg dis rootvol-02
vxplex
-g rootdg dis opt-02
vxplex
-g rootdg dis usr-02
vxplex
-g rootdg dis var-02
4. Confirm all
plexes associated to the rootmir disk have been disassociated:
vxprint
-thg rootdg
dg
rootdg
default default 75000 1098832475.101.sptsunserv1
dm
rootdg01 c0t0d0s2 auto
7181 17674902 -
dm
rootmir c0t1d0s2 auto
7181 17674902 -
pl
opt-02 - DISABLED - 3149307 CONCAT - RW
sd
rootmir-04 opt-02 rootmir 5968242 3149307 0 c0t1d0 ENA
pl
rootvol-02 - DISABLED - 718200 CONCAT - RW
sd
rootmir-02 rootvol-02 rootmir 0 718200 0 c0t1d0 ENA
pl
swapvol-02 - DISABLED - 1052163 CONCAT - RW
sd
rootmir-01 swapvol-02 rootmir 718200 1052163 0 c0t1d0 ENA
pl
usr-02 - DISABLED - 4197879 CONCAT - RW
sd
rootmir-03 usr-02 rootmir 1770363 4197879 0 c0t1d0 ENA
pl
var-02 - DISABLED - 2100735 CONCAT - RW
sd
rootmir-05 var-02 rootmir 9117549 2100735 0 c0t1d0 ENA
v opt
- ENABLED ACTIVE 3149307 ROUND -
fsgen
pl
opt-01 opt ENABLED
ACTIVE 3149307 CONCAT - RW
sd
rootdg01-04 opt-01 rootdg01 5968241 3149307 0 c0t0d0
ENA
v rootvol - ENABLED ACTIVE
718200 ROUND - root
pl
rootvol-01 rootvol ENABLED ACTIVE
718200 CONCAT - RW
sd
rootdg01-B0 rootvol-01 rootdg01 17674901 1
0 c0t0d0 ENA
sd
rootdg01-02 rootvol-01 rootdg01 0
718199 1 c0t0d0 ENA
v swapvol
- ENABLED ACTIVE
1052163 ROUND - swap
pl
swapvol-01 swapvol ENABLED ACTIVE
1052163 CONCAT - RW
sd
rootdg01-01 swapvol-01 rootdg01
718199 1052163 0 c0t0d0 ENA
v usr
- ENABLED ACTIVE
4197879 ROUND - fsgen
pl
usr-01 usr ENABLED ACTIVE 4197879 CONCAT -
RW
sd
rootdg01-05 usr-01 rootdg01 1770362 4197879 0
c0t0d0 ENA
v var
- ENABLED ACTIVE
2100735 ROUND - fsgen
pl
var-01 var ENABLED ACTIVE
2100735 CONCAT - RW
sd
rootdg01-03 var-01 rootdg01
9117548 2100735 0 c0t0d0 ENA
5. Using the
DiskGroup and Split feature, split the rootmir disk (c0t1d0) into new dis-group
(rootmirdg):
vxdg
split rootdg rootmirdg c0t1d0s2
6. Create
volume containers for the plex volumes:
vxmake
-g rootmirdg -U root vol rootvol plex=rootvol-02
vxmake
-g rootmirdg -U swap vol swapvol plex=swapvol-02
vxmake
-g rootmirdg -U fsgen vol opt plex=opt-02
vxmake
-g rootmirdg -U fsgen vol var plex=var-02
vxmake
-g rootmirdg -U fsgen vol usr plex=usr-02
7. Confirm that
all plexes are associated to volumes in the rootmirdg disk group:
vxprint
-qthg rootmirdg
dg
rootmirdg default default 55000 1098998778.102.sptsunserv1
dm
rootmir c0t1d0s2 auto
7181 17674902 -
v opt - DISABLED
EMPTY 3149307 ROUND
- fsgen
pl
opt-02 opt DISABLED
EMPTY
3149307 CONCAT - RW
sd
rootmir-04 opt-02
rootmir 5968242 3149307 0
c0t1d0 ENA
v rootvol - DISABLED
EMPTY 718200 ROUND
- root
pl
rootvol-02 rootvol DISABLED EMPTY
718200
CONCAT - RW
sd
rootmir-01 rootvol-02
rootmir 0 718200
0 c0t1d0 ENA
v swapvol - DISABLED
EMPTY 1052163 ROUND
- swap
pl
swapvol-02 swapvol DISABLED EMPTY
1052163 CONCAT - RW
sd
rootmir-02 swapvol-02 rootmir 718200
1052163 0 c0t1d0
ENA
v usr - DISABLED
EMPTY 4197879 ROUND
- fsgen
pl
usr-02 usr DISABLED
EMPTY
4197879 CONCAT - RW
sd
rootmir-03 usr-02
rootmir 1770363 4197879 0
c0t1d0 ENA
v var - DISABLED
EMPTY 2100735 ROUND
- fsgen
pl
var-02 var DISABLED
EMPTY
2100735 CONCAT - RW
sd
rootmir-05 var-02
rootmir 9117549 2100735 0
c0t1d0 ENA
8. Start all
volumes in the rootmirdg disk group:
vxrecover
-g rootmirdg -bsE
9. Before a
boot using this alternative disk is possible, changes need to be made to the
minor numbers, and the bootdg entry needs to be relinked. Fsck the root volume
in rootmirdg:
fsck
[-y] /dev/vx/rdsk/rootmirdg/rootvol
10. Mount
/dev/vx/dsk/rootmirdg/rootvol onto a temporary mount point:
mount
/dev/vx/dsk/rootmirdg/rootvol /mnt
11. Create the
major and minor numbers for rootmirdg. First, establish the major number for
vxio:
grep
vxio /etc/name_to_major
vxio
272
and then
establish the minor numbers for each of the volumes in rootmirdg from the
diskgroup configuration:
# vxprint -g rootmirdg -mpvsh
swapvol|grep
minor
minor=55003
forceminor=off
minor=-1
minor=-1
#
vxprint -g rootmirdg -mpvsh rootvol|grep
minor
minor=0
forceminor=on
minor=-1
minor=-1
#
vxprint -g rootmirdg -mpvsh usr|grep
minor
minor=55000
forceminor=off
minor=-1
minor=-1
#
vxprint -g rootmirdg -mpvsh var|grep
minor
minor=55001
forceminor=off
minor=-1
minor=-1
#
vxprint -g rootmirdg -mpvsh opt|grep
minor
minor=55002
forceminor=off
minor=-1
minor=-1
e.g. for
swapvol, minor was 55003, so to recreate the device files, run "mknod swapvol b
272 55003" and "mknod swapvol c 272 55003" in directories
/mnt/dev/vx/rdsk/rootmirdg and /mnt/dev/vx/dsk/rootmirdg
respectively:
cd
/mnt/dev/vx/rdsk/rootmirdg (note that the rootmirdg directory may have to be
created first. If so, the rm commands won't be needed)
rm
swapvol
rm
opt
rm
usr
rm
var
rm
rootvol
mknod
swapvol c 272 55003
mknod
opt c 272 55002
and
also mknod commands for usr, var, rootvol
cd
../../dsk
rm
swapvol
rm
opt
rm
usr
rm
var
rm
rootvol
mknod
opt b 272 55002
mknod
swapvol b 272 55003
and
also mknod commands for usr, var, rootvol
After the mknod
commands, the following or similar should be seen:
pwd:
/mnt/dev/vx/dsk/rootmirdg
brw-------
1 root root 272,55002 Oct 29 11:10
opt
brw-------
1 root root 272, 0 Oct 29 09:01
rootvol
brw-------
1 root root 272,55003 Oct 29 11:10
swapvol
brw-------
1 root root 272,55000 Oct 29 10:31
usr
brw-------
1 root root 272,55001 Oct 29 11:10
var
pwd:
/mnt/dev/vx/rdsk/rootmirdg
crw-------
1 root root 272,55002 Oct 29 11:20
opt
crw-------
1 root root 272, 0 Oct 29 09:20
rootvol
crw-------
1 root root 272,55003 Oct 29 11:19
swapvol
crw-------
1 root root 272,55000 Oct 29 11:04
usr
crw-------
1 root root 272,55001 Oct 29 11:19
var
Note: rootvol
minor numbers needs to stay as zero (more info below)
12. Point
"bootdg" to "rootmirdg":
cd
/mnt/dev/vx/rdsk
rm
bootdg
ln
-s rootmirdg bootdg
cd
../dsk
rm
bootdg
ln
-s rootmirdg bootdg
and to
verify:
lrwxrwxrwx
1 root root 9 Oct 29 11:19
bootdg -> rootmirdg
drwxr-xr-x
2 root root 512 Oct 29 11:19
rootdg
drwxr-xr-x
2 root root 512 Oct 29 11:19
rootmirdg
13. Ensure that
all relevant volumes point to "bootdg" in /etc/vfstab:
#
pg /etc/vfstab
#device
device mount
FS fsck mount
mount
#to
mount to fsck
point type pass at
boot options
#
#/dev/dsk/c1d0s2
/dev/rdsk/c1d0s2 /usr ufs
1 yes -
fd -
/dev/fd fd -
no -
/proc
- /proc proc -
no -
/dev/vx/dsk/bootdg/swapvol -
- swap -
no -
/dev/vx/dsk/bootdg/rootvol /dev/vx/rdsk/bootdg/rootvol
/ ufs
1
no -
/dev/vx/dsk/bootdg/usr /dev/vx/rdsk/bootdg/usr
/usr ufs 1
no
-
/dev/vx/dsk/bootdg/var /dev/vx/rdsk/bootdg/var
/var ufs 1
no
-
/dev/vx/dsk/bootdg/opt /dev/vx/rdsk/bootdg/opt
/opt ufs 2
yes
-
swap -
/tmp tmpfs - yes
-
14. Confirm you
have devalias configured:
vxeeprom
devalias
vx-rootdg01
/sbus@2,0/SUNW,socal@d,10000/sf@0,0/ssd@w2100002037262b4b,0:a
vx-rootmir
/sbus@2,0/SUNW,socal@d,10000/sf@0,0/ssd@w21000020372ba03c,0:a
15. Unmount the /dev/vx/rdsk/rootmirdg/rootvol:
umount /mnt
16.
Reboot or shut down to the OK prompt for an interactive boot in case you want
the old rootdg disk to remain your default boot device
Note: During
reboot you might see the following message on console, which may be
ignored:
------------------------------------------------------------------------------------------------------------------------
Mar
26 08:59:35 vxvm:vxconfigd: V-5-1-663 Group rootdg: Duplicate virtual device
number(s):
Mar 26 08:59:35
vxvm:vxconfigd: Volume rootvol remapped from 272,0
to
272,131070
------------------------------------------------------------------------------------------------------------------------
This
is because both rootdg as well as rootmirdg have the rootvol minor number set as
0.
17.
dumpadm
Once the system
has booted from the 'rootmirdg' disk you will need to change the dump device to
reflect this. Remember that the original rootdg configuration used c0t0d0 as the
boot disk and the old configuration is still held, so needs to be updated to
correctly reference the current boot disk: c0t1d0. The dumpadm utility can be
used to update the /etc/dumpadm.conf file. Refer to the manpage for the usage of
dumpadm.
E.g. prior to
change:
#
dumpadm
Dump
content: kernel pages
Dump device: /dev/dsk/c0t0d0s1 (dedicated)
Savecore
directory: /var/crash/sptsunserv1
Savecore
enabled: yes
after
change:
#
dumpadm -d /dev/dsk/c0t1d0s1
Dump
content: kernel pages
Dump device: /dev/dsk/c0t1d0s1 (dedicated)
Savecore
directory: /var/crash/sptsunserv1
Savecore
enabled: yes