I have an old drive with exiting LVM data. The drive is plugged in as /dev/sdb.
So the two volumes on sdb are currently inactive. The easiest way to tell if its just the logical volumes are inactive, or if the entire volume group is inactive, is by checking if the volume group directory exists in /dev.
". This is typically the case in a system recovery.
Now you can confirm that it is enabled, by again checking in /dev.
Lets check the status of the Logical Volumes:[root@bt ~]# fdisk -l /dev/sdb Disk /dev/sdb: 300.1 GB, 300069052416 bytes 255 heads, 63 sectors/track, 36481 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x92fc9607 Device Boot Start End Blocks Id System /dev/sdb1 * 1 13 104391 83 Linux /dev/sdb2 14 36481 292929210 8e Linux LVM [root@bt ~]#
[root@bt ~]# lvscan -a inactive '/dev/VolGroup00/LogVol00' [278.78 GiB] inherit inactive '/dev/VolGroup00/LogVol01' [576.00 MiB] inherit ACTIVE '/dev/VolGroup/lv_root' [50.00 GiB] inherit ACTIVE '/dev/VolGroup/lv_home' [315.22 GiB] inherit ACTIVE '/dev/VolGroup/lv_swap' [5.88 GiB] inherit [root@bt ~]#
So the two volumes on sdb are currently inactive. The easiest way to tell if its just the logical volumes are inactive, or if the entire volume group is inactive, is by checking if the volume group directory exists in /dev.
As you can see, you only see the ones that are already marked active. So we know the volume group is what is inactive. Lets go ahead and enable it.[root@bt ~]# ls -l /dev/VolGroup* /dev/VolGroup: total 0 lrwxrwxrwx 1 root root 7 May 9 17:11 lv_home -> ../dm-2 lrwxrwxrwx 1 root root 7 May 9 17:11 lv_root -> ../dm-0 lrwxrwxrwx 1 root root 7 May 9 17:11 lv_swap -> ../dm-1 [root@bt ~]#
Had the volume group been active, but the logical volumes not been active, then you would use "lvchange -a y[root@bt ~]# vgchange -a y VolGroup00 2 logical volume(s) in volume group "VolGroup00" now active [root@bt ~]#
And subsequently, our Logical Volumes are active now too:[root@bt ~]# ls -l /dev/VolGroup* /dev/VolGroup: total 0 lrwxrwxrwx 1 root root 7 May 9 17:11 lv_home -> ../dm-2 lrwxrwxrwx 1 root root 7 May 9 17:11 lv_root -> ../dm-0 lrwxrwxrwx 1 root root 7 May 9 17:11 lv_swap -> ../dm-1 /dev/VolGroup00: total 0 lrwxrwxrwx 1 root root 7 May 19 11:42 LogVol00 -> ../dm-3 lrwxrwxrwx 1 root root 7 May 19 11:42 LogVol01 -> ../dm-4 [root@bt ~]#
[root@bt ~]# lvscan -a ACTIVE '/dev/VolGroup00/LogVol00' [278.78 GiB] inherit ACTIVE '/dev/VolGroup00/LogVol01' [576.00 MiB] inherit ACTIVE '/dev/VolGroup/lv_root' [50.00 GiB] inherit ACTIVE '/dev/VolGroup/lv_home' [315.22 GiB] inherit ACTIVE '/dev/VolGroup/lv_swap' [5.88 GiB] inherit [root@bt ~]#
