Category Archives: Lvm,Pv,Vg,Snapshot

LVM Cache

TweetLVM labels and volume group (VG) metadata stored inside physical volume. On Linux system startup vgscan command scan block devices of system and looking for LVM lables. Physical Volume(PV) scanned and Volume Group(VG) list prepared from VG metadata stored in PV. Name of Physical Volumes are stored in /etc/lvm/.cache, subsequent command read /etc/lvm/.cache instead of… Read More »

ReSize Disk Partition in Linux

TweetResizing disk is a very hot topic of discussion among the system administrators. A few admins agree and many disagree with the idea of resizing disk partitions. I am sharing my piece of knowledge on this. I have been in a situation where /tmp partition of disk has to be resized. My disk was of… Read More »

Missing PVs

TweetI have a situation where LVM raid 1 is mirror is configured using two physical volume /dev/sdc1 and /dev/sdd1. Here /dev/sdc1 is a local disk and /dev/sdd1 is iscsi block device. Due to some reasons iscsi block device /dev/sdd1 went down. I brought iscsi block device (/dev/sdd1) up, so both physical volumes are available now… Read More »

LVM online shrinking

TweetMany Linux system administrators have wrong assumption that LVM does not support online shrinking. Fact is reverse of that, Linux LVM fully support online device shrink. But yes we know that when we need to shrink LVM device we unmount the subjected device. The reason to bring device in unmounted state before shrink lies in… Read More »

>LVM Snapshots

Tweet> First of all some of important facts about LVM Snapshots A snapshot volume does not have to be as large as the source volume LVM snapshots use a copy on write (CoW) technology The snapshot volume only needs to be large enough to accommodate the maximum number of changes that might occur to the… Read More »

>Recover LVM from Corrupted physical volume

Tweet>I had Volume Group /dev/vg1 that consist two physical volumes /dev/sdb1 and /dev/sdc1 . One of physical volume /dev/sdc1, corrupted due to disk problem , now the challenge was to recover LVM. I decided to use pvremove command, in following way    root#pvremove /dev/sdc1Above command displayed error couldn’t find device uuid ‘xxxxxxx’Then issue tried forcefully   root#pvremove… Read More »

>Extend logical volume

Tweet>Today i decided to extend size of one of logical volume in my RHEL 5.2server. My volume group vg1 has 100Gb free space and i want to allocate10Gb to lv1. First of all i unmounted lv1 volume which to beincreased. root# umount /dev/vg1/lv1 root# lvextend -L +10G /dev/vg1/lv1Now resize the file system root# resize2fs /dev/vg1/lv1ext2online… Read More »

>Move LVM Volume Group to another computer

Tweet> To move a volume group form one system to another, perform the following steps: Make sure that no users are accessing files on the active volumes in the volume group, then unmount the logical volumes. Use the -a n argument of the vgchange command to mark the volume group as inactive, which prevents any… Read More »

>Best Practices deploying LVM

Tweet>1. Use multiple volume groups to define classes of storage. 2. Use full disk physical volumes over partitions. 3. I like unique naming of volume groups just so that ifa drive lands else where, and it presents itself to the system,it will not collide with existing volume group names.(but there is good reason for not… Read More »