logical volume manager solaris

41
# lspv - To view all the PV’s # lsvg To View all the VG’s # lsvg –o To view all the Active VG’s # bootinfo -s hdisk1 ( To view the capacity of the hdisk1, it’s oly for virtual disk) # bootinfo -s hdisk3 ( To view the capacity of the hdisk3, oly it’s virtual)

Upload: venkatesh-chittimeni

Post on 27-Nov-2014

148 views

Category:

Documents


1 download

DESCRIPTION

Logical Volume Manager Solaris

TRANSCRIPT

Page 1: Logical Volume Manager Solaris

# lspv - To view all the PV’s

# lsvg To View all the VG’s

# lsvg –o To view all the Active VG’s

# bootinfo -s hdisk1 ( To view the capacity of the hdisk1, it’s oly for virtual disk)

# bootinfo -s hdisk3 ( To view the capacity of the hdisk3, oly it’s virtual)

Page 2: Logical Volume Manager Solaris

# mkvg -y datavg hdisk1 (Creating VG in the Name of datavg, which linked with hdisk1)

# lsvg datavg (To View all the Description in datavg)

# lsvg –o (To View all the Active VG’s)

# lsvg -p datavg (To View PV which are attached in datavg)

Page 3: Logical Volume Manager Solaris

# lsvg datavg (To View all the Description in datavg)

# extendvg datavg hdisk3 (Adding New disk to the Existing VG) but tis command get Error

# lsvg datavg (To View all the Description in datavg)

# chvg -t 2 datavg (changing the t factor value to 2 in existing datavg)

Page 4: Logical Volume Manager Solaris

# lsvg datavg (To View all the Description in datavg) make a note on MAX PP’s and Max PV’s

# extendvg datavg hdisk3 (Adding New disk to the Existing VG) but tis command get Error

# chvg -t 4 datavg (changing the t factor value to 4 in existing datavg)

# extendvg datavg hdisk3 (Adding New disk to the Existing VG) now it’s works

Page 5: Logical Volume Manager Solaris

#lsvg -p datavg ( To View the physical volume, which are attached to datavg)

#lsvg datavg (To view the description of datavg) Make a note on Active PV’s

# chvg -B datavg ( To change the vg into BIG vg)

There are Mainly 3 VG’s.

Page 6: Logical Volume Manager Solaris

#lsvg datavg To view the Description of datavg (make a note on MAX LV’s and MAX PV’s)

# varyoffvg datavg (deactiving the datavg)

# lsvg –o ( to list all the active VG’s)

Page 7: Logical Volume Manager Solaris

# lspv (To list the Physical Volume)

# chvg -G datavg ---> -S for while mkvg ( it’s for scalable VG ) Now we are changing datavg from Big Vg to Scalable Vg – b4 changing to scalable vg when want to deactivate the vg, so oly we hav used the command varyoffvg <vgname>

# varyonvg datavg (We are activating the datavg again)

# lsvg –o ( To list the all active VG)

# lspv

Page 8: Logical Volume Manager Solaris

# lsvg datavg ( Make a note on MAX PP’s per VG, MAX PP’s per PV and MAX PV’s)

Below snapshot belongs Big Vg, b4 the converting into scalable VG, compare it with the above snapshot

# chvg -P 256 datavg (64,128,256,512,1024, . . . . .)

Page 9: Logical Volume Manager Solaris

#lsvg datavg (Compare the diff of MAX PP’s per VG and MAX PV’s)

# chvg -v 1024 datavg (max LV) (256, 512, 1024, 2048, 4096)

# lsvg datavg ( View the change in MAX LV’s)

# chvg -L 128 datavg (ltg = logical track group) We can’t change it, it vil automatically assign after 5.2 b4 5.2 v need to change it manually

Page 10: Logical Volume Manager Solaris

#lsvg datavg

Notes:

vgda, vgsa (not sure), vgcb (Descriptors are getting from these files only, these three are important for collecting vg details, it is maintain thro odm)

stale is a nothing it’s a mirror. (we can go through it while discussing Mirroring)

To change vg name

# vargoffvg datavg

#exportvg datavg (while exporting remove the entries from ODM and store it in disk itself )

Page 11: Logical Volume Manager Solaris

#importvg -y newdatavg hdisk3 (while importing take a snapshot from disk to ODM, based upon vgda)

#lsvg newdatavg

While exporting, description are removed from ODM and /etc/filesystems

How to view the exportvg

lqueryvg -p hdisk0 -v List the VG id in which the PV hdisk0 resides

lqueryvg -p hdisk0 -L List all the LV ids/names in the VG where PV hdisk0 resides

lqueryvg -p hdisk3 -P Lists all the PV ids that reside in the VG where hdisk3 resides

Page 12: Logical Volume Manager Solaris

Quorum

#lsvg newdatavg

# chvg -Q n newdatavg

Page 13: Logical Volume Manager Solaris

#lsvg newdatavg

#chvg -Q y newdatavg

#lsvg newdatavg

There are three states in quorum active, removed, missing (it’s oly for our reference)

quorum is mainly for varyoff / varyon

if quorum is in disable state, it won't active vg even single disk fails

Page 14: Logical Volume Manager Solaris

if quorum is in enable state, it vil active vg even single disk fails

Hotspare

* To enable a single disk as a hot spare (small) y is used.

* To enable all disk as a hot spare (capital) Y is used.

* Scenario: there are two hot spares, one Hot Spare capacity is 11GB, Another one is 15GB disk, if 10GB disk fails, it vil determine the which disk as a hot spare???

Ans:

It vil determine 11GB disk as a hot spare, coz failed disk size is 10gb, if it tooks 15gb as a hot spare then remaining space is wasted.

# lsvg -p newdatavg

# extendvg newdatavg hdisk2 hdisk5

# lsvg -p newdatavg

Page 15: Logical Volume Manager Solaris

# lspv hdisk2

# lspv hdisk5

# lsvg newdatavg

# chpv -h y hdisk2 (Set the Hdisk2 as Hotspare) (just we r assigning hdisk2 as a hot spare)

Page 16: Logical Volume Manager Solaris

# lspv hdisk2

#lsvg -p newdatavg

#chpv -h y hdisk5

# lspv hdisk5

Page 17: Logical Volume Manager Solaris

#lsvg -p newdatavg

#lsvg newdatavg

#chvg -h y newdatavg (one to one)

#lsvg newdatavg

Page 18: Logical Volume Manager Solaris

#chvg -h Y newdatavg (one to many)

# lsvg newdatavg

#chvg -h n newdatavg (to de-activate hotspare)

#lsvg newdatavg

Page 19: Logical Volume Manager Solaris

# lsvg –p newdatavg

# chvg -h r newdatavg (remove all the disks from hot spare pool)

# lsvg -p datavg

# lspv hdisk2

Page 20: Logical Volume Manager Solaris

BB policy: ( Bad Block - relocation )

chvg -b n newdatavg ( non - relocatable)

#chvg -b y newdatavg ( relocatable)

Auto sync:

Page 21: Logical Volume Manager Solaris

it's for sync the mirror automatically

Auto on:

chvg -a y newdatavg (auto on while booting)

#chvg -a n newdatavg (off)

Adding LV

Page 22: Logical Volume Manager Solaris

# lsvg –l newdatavg To list all the lv in newdatavg (currently there are no lv belongs to newdatavg)

# mklv –y newlv –t jfs2 newdatavg 5 hdisk5

-y for confirmation

-t type mentioning the filesystem type i.e. jfs or jfs2,

newdatavg – lv created on datavg

5 – 5 PP’s allocated for newlv ( 1 pp size 32MB the newlv size is 32MB*5 = 160MB)

Hdisk5 – that newlv is belongs to PV hdisk5

Remove LV

#lsvg -l newdatavg

#rmlv newlv ( when ever file system exist on lv don’t use rmlv to delete lv, instead use rmfs which automatically deletes file system and lv, it also removes entries from ODM as well as /etc/filesystems )

Page 23: Logical Volume Manager Solaris

# lsvg -p newdatavg

# reducevg -d datavg hdisk1 hdisk2 hdisk3 hdisk5

# lsvg

Page 24: Logical Volume Manager Solaris

Logical Volume

#mklv datavg 1G

Creating lv in datavg with the capacity 1GB

#mklv –y mylv datavg 1G ( creating lv with our own name)

Creating lv with jfs and it belongs to hdisk3

# mklv –y mylv1 –t jfs datavg 1G hdisk3

#lsvg –l datavg

#rmlv mylv1

Page 25: Logical Volume Manager Solaris

Now see the Difference between y (small) and Y (capital)

# mklv -y mylv0 datavg 10

# lsvg -l datavg

# lslv -p mylv0

# lslv -m mylv0

# rmlv mylv0

# mklv -Y mylv firstvg 20

Note: we have mentioning mylv as prefix

# rmlv -f mylv00

Page 26: Logical Volume Manager Solaris

# for i in mylv01 mylv02 mylv03 mylv04 mylv05 mylv06; do rmlv -f $i ; done

( deleting multiple lv’s using for loop)

Creating lv in the vg in datavg and also only it want to create in hdisk1

# mklv datavg 30 hdisk1

Page 27: Logical Volume Manager Solaris

Creating lv in the vg in datavg and also only it want to create in hdisk1 and hdisk2

# mklv datavg 30 hdisk1 hdisk2

Page 28: Logical Volume Manager Solaris

# lsvg lv00 or # getlvcb -AT lv00

it is stored 0th block of lv

How to create log files???

# mklv -y logvg00 -t jfs datavg 1 hdisk1 ( to create log files in the logvg00 and in the jfs file system)

#logform /dev/logvg00 (to delete the previous details from logvg00 ie formatting)

Page 29: Logical Volume Manager Solaris

Going to mirror rootvg

# lsvg rootvg

# lsvg -p rootvg (check how disks r connected)

Page 30: Logical Volume Manager Solaris

# bootinfo -s hdisk0 (to mirror it, mirror disk also in same size)

# lsattr -E -l hdisk0 | grep -i size_in_mb (not works)

# getconf -a | grep -i boot_device

# bootinfo –b to know what is ur bootdisk

# bootlist -m normal -o ( to view boot order)

# bootinfo -s hdisk3

# lsvg -l rootvg (chk the LP's and PP's size, see after mirroring)

Page 31: Logical Volume Manager Solaris

# mirrorvg rootvg hdisk3 (it vil show error, coz hdisk3 not added to rootvg )

# lsvg -p rootvg

# extendvg rootvg hdisk3

Page 32: Logical Volume Manager Solaris

# lsvg -p rootvg

# mirrorvg rootvg hdisk3

# lsvg -p rootvg (chk the free distrubtion, it also same coz of mirror - chk the LP's and PP's size)

But in below snapshot free distribution is different and also quorum is enabled, coz v r mirroring rootvg, while mirroring rootvg we want to disabled the quorum.

Page 33: Logical Volume Manager Solaris

Now ‘m going to unmirror the rootvg

#unmirrorvg rootvg

Now ‘m going to disabled the quorum

# lsvg rootvg

#chvg –Q n rootvg

Page 34: Logical Volume Manager Solaris

# mirrorvg rootvg hdisk3 (still free distribution is not same)

Now we are going unmirror the vg again and to create vg with –m option

#unmirrorvg rootvg

#mirrorvg –m rootvg hdisk3

#lsvg –p rootvg

Page 35: Logical Volume Manager Solaris

Now the free distribution is in same, now the mirror works accurately.

Now we are going to check bootlist

bootlist -m normal -o (to list)

bootlist -m normal hdisk0 hidsk3 ( Now we are going to change the boot order)

# getconf -a | grep -i boot_device

Page 36: Logical Volume Manager Solaris

# bootinfo -b

Now we are going to change the boot device from hdisk0 to hdisk3

# bosboot –ad hdisk3 (to create the boot image in hdisk3)

# shutdown –rF (now we are going to restart the system with force option)

Now the system booted through hdisk3

Page 37: Logical Volume Manager Solaris

#mirrorvg –S rootvg hdisk3

-S (capital S) – Background Sync

-s (small s) – Disable Sync

Check the stale PP’s and Stale PV’s

If u didn’t mention sync while during creating mirror, u want to use syncvg –s

Page 38: Logical Volume Manager Solaris

To view mirror

# lslv –m hd1

.

.

# lslv –m hd8

# lslv –l hd1

.

.

#lslv –l hd8

Page 39: Logical Volume Manager Solaris