Example is a full LV for a virtual guest
pvcreate /dev/emcpowera1 vgcreate -s 32M vg{guest_name} /dev/emcpowera1 lvcreate –l 100%VG -n lv{guest_name} vg{guest_name}
If the LV will be seen by multiple hosts (i.e. clustering or Xen/KVM). Do the following on the other nodes:
sfdisk -R /dev/emcpowerN
Where N is each PV added on the first node.
vgscan -v
This only needs to be done once after all of the sfdisk commands.
lvdisplay -m /dev/vg00/lv01 | grep Type
Increase the logical volume size first: | lvextend -L 20G /dev/vg00/lv01 |
Resize filesystem: | resize2fs /dev/vg00/lv01 20G |
If the above fails: | |
Make sure no one is using filesystem: | fuser -vum /opt/appfiles |
Unmount filesystem: | umount /dev/vg00/lv01 |
Check filesystem: (with a force) | fsck -f /dev/vg00/lv01 |
Resize filesystem: | resize2fs /dev/vg00/lv01 20G |
Remount filesystem: | mount -a |
Check that filesystem is able to shrink: | df -h {mountpoint} |
Value for 'Used' must not be more than target to shrink filesystem to | |
Make sure no one is using filesystem: | fuser -vum /opt/appfiles |
Unmount filesystem: | umount /dev/vg00/lv01 |
Check filesystem: (with a force) | fsck -f /dev/vg00/lv01 |
Resize filesystem: | resize2fs /dev/vg00/lv01 20G |
Test LV resize: | lvresize -L 5G -t /dev/vg00/lv01 |
If above has no errors, commit LV resize: | lvresize -L 5G /dev/vg00/lv01 |
Remount filesystem: | mount -a |
Edit /etc/lvm/lvm.conf filter for EMC SAN RHEL5:
filter = [ "a/sda[1-9$/", "r/sd.*/", "r/disk.*/", "r/ram.*/", "a/.*/" ]
RHEL4:
filter = [ "a/sda[1-9$/" "a/emcpower.*/" "r/.*/" "r|/dev/cdrom|" ]
The following must be done to optimize LUN configuration for the EMC Clarion.
# fdisk /dev/emcpowera n # new partition p # primary partition 1 # partition number 1 <enter> # accept default start=1 <enter> # accept default end=<last block> t # change disk type 8e # value for Linux LVM x # expert mode b # adjust starting block number 1 # choose partition 1 128 # set it to 128, our stripe element size w # write the new partition
vgroot
is your root VG and hostname
is the node name in /etc/cluster/cluster.confvolume_list = [ "vgroot", "@hostname"
mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)
To view the LVM tags, where hostname
matches one of the nodes in /etc/cluster/cluster.conf
lvs @hostname
Or to view all tags
vgs -o vg_name,vg_tags
To see whether or not volume_list
is enabled in initrd:
mkdir /root/tmp;cd /root/tmp cp /boot/initrd-$(uname -r).img ./initrd.gz gunzip initrd.gz cpio -id < initrd grep volume_list etc/lvm/lvm.conf cd rm -rf /root/tmp
vgchange --addtag {tag_name} {vg_name} vgchange -v -ay {vg_name}