logical volume manager solaris

Post on 27-Nov-2014

148 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Logical Volume Manager Solaris

TRANSCRIPT

# 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)

# 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)

# 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)

# 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

#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.

#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)

# 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

# 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, . . . . .)

#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

#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 )

#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

Quorum

#lsvg newdatavg

# chvg -Q n newdatavg

#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

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

# lspv hdisk2

# lspv hdisk5

# lsvg newdatavg

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

# lspv hdisk2

#lsvg -p newdatavg

#chpv -h y hdisk5

# lspv hdisk5

#lsvg -p newdatavg

#lsvg newdatavg

#chvg -h y newdatavg (one to one)

#lsvg newdatavg

#chvg -h Y newdatavg (one to many)

# lsvg newdatavg

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

#lsvg newdatavg

# lsvg –p newdatavg

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

# lsvg -p datavg

# lspv hdisk2

BB policy: ( Bad Block - relocation )

chvg -b n newdatavg ( non - relocatable)

#chvg -b y newdatavg ( relocatable)

Auto sync:

it's for sync the mirror automatically

Auto on:

chvg -a y newdatavg (auto on while booting)

#chvg -a n newdatavg (off)

Adding LV

# 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 )

# lsvg -p newdatavg

# reducevg -d datavg hdisk1 hdisk2 hdisk3 hdisk5

# lsvg

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

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

# 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

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

# mklv datavg 30 hdisk1 hdisk2

# 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)

Going to mirror rootvg

# lsvg rootvg

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

# 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)

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

# lsvg -p rootvg

# extendvg rootvg hdisk3

# 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.

Now ‘m going to unmirror the rootvg

#unmirrorvg rootvg

Now ‘m going to disabled the quorum

# lsvg rootvg

#chvg –Q n rootvg

# 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

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

# 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

#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

To view mirror

# lslv –m hd1

.

.

# lslv –m hd8

# lslv –l hd1

.

.

#lslv –l hd8

top related