Pages

Thursday, 19 September 2013

How to add New LUN to Veritas Volume Manager on Solaris

After LUN is allocated to a Solaris server

1: Scan HBA ( Host Bus Adapters) to detect new LUNs
 
Ex:
  #cfgadm -c configure c3    ---  ( c3 is a HBA port)

 If the server has dual port HBA, you need to scan that port too.
 Ex: #cfgadm -c configure c5

2: Run devfasadm to rebuild device tree.

#devfsadm

3: Label the disks using format command.

4: Now its time to let the veritas volume Manager  to know about new LUN.

   #vxdctl enable
   # vxdisk list    -- This will show all the disks and new disk shows as Online invalid

 5: Setup new disk.

    #vxdisksetup -i (device name)

 6:  If you want to create new Disk Group

      #vxdg init (new-dg) (disk-name=devicename)

     If you want disks to add existing DG

      #vxdg -g ( existing-dg) adddisk (diskname=devicename)

   7: If you want to create new volume

       #vxassist -g ( existing-dg) make (new-vol) 10g fstype=vxfs
     
        To resize volume;
        #vxresize -g (dg-name) (vol-name) 63g

   8: Create new-file system on the volume

       #mkfs -F vxfs /dev/vx/rdsk/existing-dg/new-vol

   9:    Create directory to mount new volume
          ex: mkdir /new-mount-point
 
  10:  Mount the new Volume
       
        #mount /dev/vx/rdsk/existing-dg/new-vol (mount-point)

  11:  To mount the new file automatically on reboot, make an entry in /etc/vfstab


Monday, 9 September 2013

Resizing Veritas File system on Solaris

Scanning for new LUNs and resizing Veritas File systems.

After LUN is assigned to a server.
1: scan for new LUN:
#devfsadm -v

2: format and label

3: #cfgadm -c configure c2   ( This will rescan HBA)

4: #vxdctl enable  ( Veritas will scan for new disks)


5:Bring them under the vx control
 #vxdisksetup -if <diskname> format=cdsdisk

6:Add the disk to existing Disk Group.
 #vxdg -g <DG-Name> adddisk <disk-Nmae>=Device-Name
 #vxassist -g <dg_name> maxsize

7: Resize the file system
#vxresize -g <dg_name> <vol-Name> +10G

Friday, 6 September 2013

Mirroring Root File System in Volume Manager

cp -p /etc/system /etc/system.orig."date"
 
cp -p /etc/vfstab /etc/vfstab.orig."date

The VTOC (volume table of contents) on the root disk and root mirror must be the same. Copy the VTOC using prtvtoc and fmthard.
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c1t0d0s2


Create metadatabases on the small slice created on rootdisk:
# metadb -f -a -c3 c0t0d0s6 (Slice 6 is my small slice here)
# metadb -a -c3 c1t0d0s6 (Slice 6 on rootmirror


# metainit d51 1 1 c0t0d0s2
d51: Concat/Stripe is setup
# metainit d52 1 1 c1t0d0s2
d52: Concat/Stripe is setup
# metainit d50 -m d51
d50: Mirror is setup

# metaroot d50   ( this will update the /etc/vfstab)

Make the following entry in the /etc/system file, in the mdd info section:
set md:mirrored_root_flag=1




#init 6

Once the system comes up, attach the other submirror:
# metattach d50 d52
d50: Submirror d52 is attached

To see whether the FS syncing is done or not, do this:
metastat | grep progress 
 
 
 Determine the device path to the boot devices for both the primary and mirror:
ls -l /dev/dsk/c1t1d0s0 /dev/dsk/c1t0d0s0
lrwxrwxrwx 1 root root 43 Dec 23 17:51 /dev/dsk/c1t0d0s0 -> \
   ../../devices/pci@1c,600000/scsi@2/sd@0,0:a
lrwxrwxrwx 1 root root 43 Dec 23 17:51 /dev/dsk/c1t1d0s0 -> \
   ../../devices/pci@1c,600000/scsi@2/sd@1,0:a
 
# eeprom "nvramrc=devalias rootdisk /pci@1c,600000/scsi@2/disk@1,0 
devalias rootmirror /pci@1c,600000/scsi@2/disk@0,0"
(Please note the change "sd" to "disk" in using ls -l output.)
# eeprom "use-nvramrc?=true"
You can also change the boot-device values so that the system tries to boot from the mirror in case one of them is not available.
# eeprom boot-device="rootdisk rootmirror net"

 Once the syncing is complete, test your system by removing the root disk