|
Veritas Information Page.Moving/Re-building Veritas disk groupsYou can rebuild the whole database structure using the output from the vxprint command.This could be very useful for not only rebuilding the complete structure,but for renaming disk groups and moving,say,rootdg to another disk group!! The important commands are: vxprint -hmQq [-g diskgroup] [volumes ... ] > /tmp/movers vxmake [-g diskgroup] -d /tmp/movers I've done a couple of tests and found that vxmake complains if the file contains any disk-group (dg) or disk (dm) information, so make sure that its only volumes (vol), plexes (plex), and sub-disks (sd) in there. Also, there are references to the physical disk address (c#t#d#s#) and the major & minor numbers for the disks (e.g. dev=118/132), so you must ensure consistency on the replacement hardware. All you have to do is initialise the new disks you want to use under Veritas and then run the 'vxmake' command to rebuild the structure. Creating a Simple rootdg Disk Group
DISABLE TRANSACTIONS
node0# vxconfigd -m disable
node0# ps -ef | grep vxconfigd
root 58 1 80 10:08:39 ? 0:01 vxconfigd
root 520 328 4 10:35:09 pts/0 0:00 grep vxconfigd
INITIALIZE DATABASE
node0# vxdctl init
MAKE A NEW ROOTDG GROUP
node0# vxdg init rootdg
ADD SIMPLE SLICE
node0# vxdctl add disk c0t1d0s7 type=simple
vxvm:vxdctl: WARNING: Device c0t1d0s7: Not currently in the configuration
(NOTE THIS WARNING IS NORMAL)
ADD DISK RECORDS
node0# vxdisk -f init c0t1d0s7 type=simple
ADD DISK NAME TO ROOTDG DISK GROUP
node0# vxdg adddisk c0t1d0s7
ENABLE TRANSACTIONS
node0# vxdctl enable
REMOVE FILE IF PRESENT
node0# cd /etc/vx/reconfig.d/state.d:ls
node0#install-db
node0#rm install-db
NOTE: if the file install-db is there remove it. If it isn't
don't worry about it.
node0#reboot
Installing Veritas Volume Manager.
node0# vxinstall
Volume Manager Installation
Menu: VolumeManager/Install
The Volume Manager names disks on your system using the controller
and disk number of the disk, substituting them into the following
pattern:
c<controller>t<disk>d<disk>
Some examples would be:
c0t0d0 - first controller, first target, first disk
c1t0d0 - second controller, first target, first disk
c1t1d0 - second controller, second target, first disk
The Volume Manager has detected the following controllers on your system:
c0: io-unit@f,e0200000/sbi@0,0/dma@0,81000/esp@0,80000
c1: io-unit@f,e0200000/sbi@0,0/SUNW,soc@3,0/SUNW,pln@a0000000,74127a
c2: io-unit@f,e1200000/sbi@0,0/SUNW,soc@3,0/SUNW,pln@a0000000,740f85
Hit RETURN to continue.
Volume Manager Installation
Menu: VolumeManager/Install
You will now be asked if you wish to use Quick Installation or
Custom Installation. Custom Installation allows you to select how
the Volume Manager will handle the installation of each disk
attached to your system.
Quick Installation examines each disk attached to your system and
attempts to create volumes to cover all disk partitions that might
be used for file systems or for other similar purposes.
If you do not wish to use some disks with the Volume Manager, or if
you wish to reinitialize some disks, use the Custom Installation
option Otherwise, we suggest that you use the Quick Installation
option.
Hit RETURN to continue.
Volume Manager Installation Options
Menu: VolumeManager/Install
1 Quick Installation
2 Custom Installation
? Display help about menu
?? Display help about the menuing system
q Exit from menus
Select an operation to perform: 2
Volume Manager Custom Installation
Menu: VolumeManager/Install/Custom
The c0t0d0 disk is your Boot Disk. You can not add it as a new
disk. If you encapsulate it, you will make your root filesystem
and other system areas on the Boot Disk into volumes. This is
required if you wish to mirror your root filesystem or system
swap area.
Encapsulate Boot Disk [y,n,q,?] (default: n) y
Enter disk name for c0t0d0 [<name>,q,?] (default: rootdisk)
The c0t0d0 disk has been configured for encapsulation.
Hit RETURN to continue.
Volume Manager Custom Installation
Menu: VolumeManager/Install/Custom/c0
Generating list of attached disks on c0....
<excluding root disk c0t0d0>
The Volume Manager has detected the following disks on controller c0:
c0t1d0
Hit RETURN to continue.
Installation options for controller c0
Menu: VolumeManager/Install/Custom/c0
1 Install all disks as pre-existing disks. (encapsulate)
2 Install all disks as new disks. (discards data on disks!)
3 Install one disk at a time.
4 Leave these disks alone.
? Display help about menu
?? Display help about the menuing system
q Exit from menus
Select an operation to perform: 4
Volume Manager Custom Installation
Menu: VolumeManager/Install/Custom/c1
Generating list of attached disks on c1....
The Volume Manager has detected the following disks on controller c1:
c1t0d0 c1t0d1 c1t1d0 c1t1d1 c1t2d0 c1t3d0 c1t4d0 c1t4d1 c1t5d0
Hit RETURN to continue.
Installation options for controller c1
Menu: VolumeManager/Install/Custom/c1
1 Install all disks as pre-existing disks. (encapsulate)
2 Install all disks as new disks. (discards data on disks!)
3 Install one disk at a time.
4 Leave these disks alone.
? Display help about menu
?? Display help about the menuing system
q Exit from menus
Select an operation to perform: 4
Volume Manager Custom Installation
Menu: VolumeManager/Install/Custom/c2
Generating list of attached disks on c2....
The Volume Manager has detected the following disks on controller c2:
c2t0d0 c2t0d1 c2t1d0 c2t1d1 c2t2d0 c2t2d1 c2t3d0 c2t4d0 c2t4d1 c2t5d0
Hit RETURN to continue.
Installation options for controller c2
Menu: VolumeManager/Install/Custom/c2
1 Install all disks as pre-existing disks. (encapsulate)
2 Install all disks as new disks. (discards data on disks!)
3 Install one disk at a time.
4 Leave these disks alone.
? Display help about menu
?? Display help about the menuing system
q Exit from menus
Select an operation to perform: 4
Volume Manager Custom Installation
Menu: VolumeManager/Install/Custom
The following is a summary of your choices.
c0t0d0 Encapsulate
Is this correct [y,n,q,?] (default: y)
The system now must be shut down and rebooted in order to continue
the reconfiguration.
Shutdown and reboot now [y,n,q,?] (default: n) y
Shutdown started. Tue Jul 25 15:13:08 EDT 1995
Broadcast Message from root (console) on node1 Tue Jul 25 15:13:09...
THE SYSTEM IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged
showmount: node0: RPC: Program not registered
Changing to init state 6 - please wait
node0#
INIT: New run level: 6
The system is coming down. Please wait.
Rebooting with command:
Boot device: /io-unit@f,e0200000/sbi/dma@0,81000/esp@0,80000/sd@0,0 File and
args:
SunOS Release 5.4 Version Generic_101945-33 [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1994, Sun Microsystems, Inc.
configuring network interfaces: le0.
Hostname: node0
Configuring the /devices directory
soc0: port 0: Fibre Channel is ONLINE
soc1: port 0: Fibre Channel is ONLINE
Configuring the /dev directory
Configuring the /dev directory (compatibility devices)
The Volume Manager is now reconfiguring (partition phase)...
Volume Manager: Partitioning c0t0d0 as an encapsulated disk.
The Volume Manager is now reconfiguring (initialization phase)...
Volume Manager: Adding rootdisk (c0t0d0) as an encapsulated disk.
The Volume Daemon has been enabled for transactions.
Adding volumes for c0t0d0...
Starting new volumes...
Updating /etc/vfstab...
Remove encapsulated partitions...
The Volume Manager will now set up your Boot Disk as a managed disk.
Saving original configuration...
4 blocks
The system will now be rebooted.
syncing file systems... [22] [18] [9] done
rebooting...
Resetting...
Chaning the WWN after contoller replacement.UPDATE: If booting from Solaris 2.5 HW 1/96 or higher you will NOT need to mount /usr or /opt. [ And you don't even have to mount "/", if you remember the old WWN.] Just use /usr/sbin/ssaadm. 1) Boot from the cdrom and mount O/S. ok boot cdrom -sw ; boot the single-user cdrom shell # mount -o ro /dev/dsk/c0t0d0s0 /a ; provides RO access to "root"NOTE: In the case of a single large / (no separate /usr, /opt, etc) this is all you need to mount. Otherwise, also mount 'usr' and 'opt' on /a/usr and /a/opt. Use the /a/etc/vfstab for reference. NOTE2: Use of the "-o ro" mount will prevent superblock consistency problems in the case of mirrored system disks. 2) Obtain the old WWN value. List one (any one) of the disks in the storage array. For example: # cd /a/dev/rdsk # ls -l c2t1d3s0In this example, the "c2" is the OLD controller. You will get an output that looks like the following:
lrwxrwxrwx 1 root root 94 Mar 19 10:28 c2t1d3s0 ->
../../devices/iommu@0,10000000/sbus@0,10001000/SUNW,soc@2,0/
SUNW,pln@a0008000,78cf18/ssd@1,3:a
^^^^ ^^^^^^
xxxx yyyyyy
The WWN is 12 digits long, and is in the form xxxx00yyyyyy .
The 4 characters immediately before the comma are the first 4
characters of the WWN. The 6 numbers after the comma are the
last 6 digits of the WWN. Place two zeros between these values.
For the above example, the WWN would be 80000078cf18.
3) Locate the new array controller.
# ls -l /dev/dsk/c*t0d0s2 | grep NWWN ; where NWWN is the four digits ; appearing in the SSA display a match will come from controller N4) Download the old address to the new controller. /a/opt/SUNWssa/bin/ssacli -s -w 80000078cf18 download cNOR /a/usr/sbin/ssaadm download -w 80000078cf18 cNUPDATE: If booting from Solaris 2.5 HW 1/96 or higher /usr/sbin/ssaadm download -w 80000078cf18 cN5) Reset the system. # umount Upgrading the SSA Firmware.1. Check the current firmware level. ssaadm display c? (controller number ie "c2")If Firmware level is 2.4 or below:- # /usr/sbin/ssaadm fast_write -se2. Download the SPARCstorage Array firmware to your SPARCstorage Array. If the host is booted off the SSA, the host MUST be rebooted for this operation from another device. This device can be either another SSA that is not to have it's firmware updated, another disc or a CDROM. If the host is being rebooted only the steps 'e' and 'f' below need to be executed. The following steps must be completed on each SSA to download the firmware safely: a) Stop all I/O activity on the SPARCstorage Array. b) Perform a sync_data to the SSA:
# /usr/sbin/ssaadm sync_cache
c) Unmount any filesystems residing on the SSA disks.
d) Stop all Veritas Volume manager (VxVA) volumes and/or Solstice Disk Suite
(SDS) metadevices (if any) running on the SSA. Also insure that ownership
of any SDS diskset metadevices have been released since an implicit I/O
stream exists while ownership of a diskset is maintained.
Please refer to the metaset(1M) manpage for details on taking/releasing
ownership of disksets.
e) Execute the ssaadm download command to download the new firmware:
# /usr/sbin/ssaadm download -f /usr/lib/firmware/ssa/ssafirmware
CAUTION: This operation may take a few minutes to complete. Do NOT
interrupt the operation before it is finished or the system
may not be able to communicate with the SPARCstorage Array.
f) The SSA(s) will now need to be reset for the changes to take effect. If the
host is booted off an SSA then the host MUST be shutdown at this point.
g) Restart the Veritas Volume manager (VxVA) and/or SDS metadevices and
reclaim ownership of any SDS diskset metadevices that were relinquished.
h) Remount the filesystems that reside on the SSA disks.
3. The firmware download is now complete. I/O activity on the SPARCstorage
Array can be restarted.
Booting from the SSA.To Boot from the SSA you require the following:- Solaris 2.4 hardware 3/95 or later. Fcode 1.33 or later on the SOC card in the host. Firmware 1.9 or above in the SSA. These are all minimum requirements for boot support. To update or check the Fcode revision there is a program called "fc_update" which is supplied on the Storage Array 2.1 CD, in it's own sub-directory. If the system has no other boot media, and you need to check the Fcode then you will need either a second cdrom drive to mount the SSA cd while booted from the Solaris media, or a tape copy of this sub-directory. With a new system this should not be an issue. This is used as follows: fc_update [return] will check for SOC cards and bring them all to the current fcode revision, asking for confirmation on each one. fc_update -v [return] will go through the system looking for SOC cards and reporting the fcode revision levels it finds. No changes are made to the system. Once you have installed the OS onto the SSA disk, or set up the mirror, you willneed to configure a device alias in the PROM. This is probably the one part mostopen to error, and there's a nice little gotcha that can stop the whole thing booting. First you will need to get the full path to the boot device. I suggest that before you reboot after the install, you should go into /dev/dsk, and do an"ls -l" on the boot device. This will show the full symlink to the /devices entry for the boot disk. Remove everything before the "/iommu" stuff and the tailing ":a" (for slice 0), and this is ALMOST your boot device. Now you need toadd a "SUNW," prefix to the "ssd" device. Fail to do this, and you won't boot. To store the boot device as an alias, use "nvedit" in the boot prom. eg, for example ss1000, booting from an array connected to the SOC in sbus slot 3 on the first system board, with the world address "a0000000,740d10" : nvedit [return] 0 devalias ssa /io-unit@f,e0200000/sbi@0,0/SUNW,soc@3,0/ SUNW,pln@a0000000,740d10/SUNW,ssd@0,0 [return] ^^^^^ ||||| (Note the prefix added here) 1 [ctrl-c] nvstore [return] setenv use-nvramrc? true [return] reset [return]Alternativley,If you want to make the change **PERMANENT**:-
nvalias ssa /io-unit@f,e0200000/sbi@0,0/SUNW,soc@3,0/
SUNW,pln@a0000000,740d10/SUNW,ssd@0,0 [return]
^^^^^
|||||
(Note the prefix added here)
Then you can "boot ssa" to start the system. It should be noted that the SSA
device will take longer to start to boot than a normal disk device, but once it
starts there should be no noticeable difference.
Upgrading Veritas and/or Solaris.Ther are two methods to upgrading!! Method 1:- Using Scripts.CAUTION: Do not do boot cdrom and hit the upgrade button. NOTE: First log in as root and back up the data on your system. Stop all the processes (database or other applications) that are accessing Volume Manager volumes except /, swap, /usr and /opt. Unmount all file systems mounted on Volume Manager volumes except /, swap, /usr and /opt. Comment out any Volume Manager entries in /etc/vfstab except for /, /swap, /usr and /opt If the disk is encapsulated(/, /usr and swap), go to the /cdrom/ cdrom0, and there are two scripts, upgrade_start and upgrade_finish. Do the following.... 1. Run the upgrade_start. 2. Remove any VM patches. 3. Remove VM packages. 4. Upgrade OS. 5. Install VM packages. 6. Install VM patches. 7. Run the upgrade_finish script. Method 2:-By Hand!!rootdev:/pseudo/vxio@0:0 set vxio:vol_rootdev_is_volume=1 Understanding & using CLI CommandsSometimes just using the GUI and menu based CLI is not good enough!! You may wish to do something special,or you may be presented with a terminal or be simply logging in through a modem link.In these cases an in depth knowledge of CLI commands can be very useful.This section gives the main commands and useage. The most widely used is:-vxprint -Ath Usage:-vxdg -g [diskgroup] rmdisk disk1 disk2 ....etc... Example:-vxdg -g datadg rmdisk disk01 disk02 Usage:-vxdg init [diskgroup] [diskname=c1t0d0s2] Example:-vxdg init datadg datadg01=c2t0d0s2 vxdisksetup -i c2t0d0 Usage:-vxdg -g datadg adddisk [diskname=disk] Example:-vxdg -g datadg adddisk datadg02=c2t0d0 datadg02=c2t3d0... Usage:-vxmake -g [diskgroup] sd [diskname-01] [size] Example:-vxmake -g datadg sd datadg01-01 datadg01,0,500m vxmake -g datadg sd datadg01-02 datadg01,1024000,500m Example:-vxmake -g datadg plex pl-02 comment="Concatenated plex" sd=datadg01-01,datadg02-01 Example:-vxmake -g datadg plex p101 layout=STRIPE st_width=64 ncolumn=2 sd=eng01-01,eng01-01 Example:-vxmake -g datadg -Ufsgen vol vol01 plex=p101 Example:-vxvol -g datadg start vol01 Examplevxassist -g datadg mirror vol01 datadg02 datadg03 Example:-vxassist -g datadg make vol02 10m layout=stripe datadg01 datadg02 Usage:-vxassist -g [diskgroup] make [volume name] [size] layout=raid5,log nstripe=[number of disks] stripeunit=32 [diskname1] [diskname2] Example:-vxassist -g datadg make vol03 10m layout=raid5,log nstripe=4 stripeunit=32 datadg01 datadg02 datadg03 datadg04 Example:-vxedit -g datadg -fr rm vol03 Hot Swapping and Hot Relocation.Example:-vxvol -g datadg start vol01 Examplevxassist -g datadg mirror vol01 datadg02 datadg03 Example:-vxassist -g datadg make vol02 10m layout=stripe datadg01 datadg02 Usage:-vxassist -g [diskgroup] make [volume name] [size] layout=raid5,log nstripe=[number of disks] stripeunit=32 [diskname1] [diskname2] Example:-vxassist -g datadg make vol03 10m layout=raid5,log nstripe=4 stripeunit=32 datadg01 datadg02 datadg03 datadg04 Example:-vxedit -g datadg -fr rm vol03 Rebuilding Disk groups from The Private RegeonThis works very well with simple volumes but not so well with complicated ones!**This method should only be used as a last resort** ie if there is no backup etc.. /etc/vx/diag.d/vxprivutil dumpconfig /dev/dsk/c0t0d0s4 > /tmp/file cat /tmp_file|vxprint -D - -hmvps > /tmp/config_file grep dm (disk media name) /tmp/file grep last_da_name (c0t4d0) vxdg init [disk group] [logical disk name] vxdg -g [disk group] adddisk [logical name]=c0t4d0 vxvol -g [disk group]init active [volname] |
© R. Davies. 1999, Grenville Consulting Ltd.