Saturday, August 22, 2009

MIRRORING A LOGICAL VOLUME

MIRRORING A LOGICAL VOLUME

Step 1: Check whether there are sufficient disks for mirroring

# vgdisplay -v /dev/vg01 | grep "PV Name"

PV Name /dev/dsk/c0t9d0

PV Name /dev/dsk/c0t10d0

# lvdisplay /dev/vg01/lvol01 | grep Mirror

Mirror copies 0

# lvextend -m 1 /dev/vg01/lvol01

The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait ....

Logical volume "/dev/vg01/lvol01" has been successfully extended.

Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

Step 2: Check Mirror Copies

# lvdisplay /dev/vg01/lvol01 | grep Mirror

Mirror copies 1

EXTENDING A LOGICAL VOLUME

EXTENDING A LOGICAL VOLUME

Step 1: Identify whether there are Free Physical Extents available to extend the Logical Volume

# vgdisplay /dev/vg01_renamed | grep "Free PE"

Free PE 483

Step 2: Check the current size of the Logical Volume

# lvdisplay /dev/vg01/lvol01 | grep “LV Size”

LV Size (Mbytes) 100

# lvextend -L 120 /dev/vg01/lvol01

Logical volume "/dev/vg01/lvol01" has been successfully extended.

Volume Group configuration for /dev/vg01_renamed has been saved in /etc/lvmconf/vg01.conf

[Note : Always mention the new Logical Volume size to extend]

# lvdisplay /dev/vg01/lvol01 | grep "LV Size"

LV Size (Mbytes) 120

Step 3: Extend the Filesystem

# bdf /opt/test

Filesystem kbytes used avail %used Mounted on

/dev/vg01_renamed/lvol01

102400 1133 94945 1% /opt/test

# fsadm -b 120m -F vxfs /opt/test

fsadm: /dev/vg01_renamed/rlvol01 is currently 102400 sectors - size will be increased

EXTENDING A VOLUME GROUP

EXTENDING A VOLUME GROUP

Step 1: Confirm that the free disk identified is not in any of the already volume groups

# strings /etc/lvmtab > /tmp/lvm

# grep c0t10d0 /tmp/lvm

Step 2: Initialize the Physical Volume which has been identified as free

# pvcreate /dev/rdsk/c0t10d0

Physical volume "/dev/rdsk/c0t10d0" has been successfully created.

Step 3: Extend the Volume group to the initialized disk

# vgextend /dev/vg01 /dev/dsk/c0t10d0

Volume group "/dev/vg01" has been successfully extended.

Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

Step 4: Check the disk has been added to the Volume Group

# vgdisplay -v /dev/vg01 | grep "PV Name"

PV Name /dev/dsk/c0t9d0

PV Name /dev/dsk/c0t10d0

CREATING A LOGICAL VOLUME AND FILESYSTEM

CREATING A LOGICAL VOLUME AND FILESYSTEM

Step 1: Identify whether the Volume group has sufficient space to create a logical volume

#vgdisplay -v vg01

--- Volume groups ---

VG Name /dev/vg01

VG Write Access read/write

VG Status available

Max LV 255

Cur LV 0

Open LV 0

Max PV 16

Cur PV 1

Act PV 1

Max PE per PV 1016

VGDA 4

PE Size (Mbytes) 4

Total PE 508

Alloc PE 0

Free PE 508

Total PVG 0

Total Spare PVs 0

Total Spare PVs in use 0


#lvcreate -L 100 -n lvol01 /dev/vg01

Logical volume "/dev/vg01/lvol01" has been successfully created with

character device "/dev/vg01/rlvol01".

Logical volume "/dev/vg01/lvol01" has been successfully extended.

Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

#newfs -F vxfs /dev/vg01/rlvol01

version 3 layout

102400 sectors, 102400 blocks of size 1024, log size 1024 blocks

unlimited inodes, 102400 data blocks, 101280 free data blocks

4 allocation units of 32768 blocks, 32768 data blocks

last allocation unit has 4096 data blocks

first allocation unit starts at block 0

overhead per allocation unit is 0 blocks

#cp -p /etc/fstab /etc/fstab.$(date +%d%h%y)

[Note : Make a backup copy of /etc/fstab file before modifying it]

# ll /etc/fstab*

-rw-r--r-- 1 root sys 412 Nov 5 12:05 /etc/fstab

-rw-r--r-- 1 root sys 412 Nov 5 12:05 /etc/fstab.05Nov08

# echo "/dev/vg01/lvol01 /opt/test vxfs delaylog 0 2" >> /etc/fstab

#mount /opt/test

#bdf /opt/test

Filesystem kbytes used avail %used Mounted on

/dev/vg01/lvol01 102400 1133 94945 1% /opt/test

CREATING A VOLUME GROUP

CREATING A VOLUME GROUP

Step 1: Identify free disks to create the volume group

#ioscan -fnCdisk

Class I H/W Path Driver S/W State H/W Type Description

=====================================================================

disk 0 8/4.5.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC

/dev/dsk/c0t5d0 /dev/rdsk/c0t5d0

disk 1 8/4.8.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC

/dev/dsk/c0t8d0 /dev/rdsk/c0t8d0

disk 2 8/4.9.0 sdisk CLAIMED DEVICE SEAGATE ST32272WC

/dev/dsk/c0t9d0 /dev/rdsk/c0t9d0

disk 3 8/4.10.0 sdisk CLAIMED DEVICE SEAGATE ST32272WC

/dev/dsk/c0t10d0 /dev/rdsk/c0t10d0

disk 4 8/4.11.0 sdisk CLAIMED DEVICE SEAGATE ST32171W

/dev/dsk/c0t11d0 /dev/rdsk/c0t11d0

disk 5 8/16/5.1.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM XM-5701TA

/dev/dsk/c1t1d0 /dev/rdsk/c1t1d0

disk 6 8/16/5.2.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM XM-5701TA

/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0

Step 2: Confirm that the free disk identified is not in any of the already volume groups

#strings /etc/lvmtab > /tmp/lvm

#grep c0t9d0 /tmp/lvm

Step 3: Initialize the identified free disk

#pvcreate /dev/rdsk/c0t9d0

Physical volume "/dev/rdsk/c0t9d0" has been successfully created.

#mkdir /dev/vg01

#ll /dev/*/group

crw-r----- 1 root sys 64 0x000000 Oct 31 13:15 /dev/vg00/group

#mknod /dev/vg01/group c 64 0x010000

#vgcreate /dev/vg01 /dev/dsk/c0t9d0

Volume group "/dev/vg01" has been successfully created.

Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf