2

How can I find out the date and time of LVM volume group creation and how it was created?

According to ComptTIA LPIC-1 manual the LVM volume group metadata contains such information but I don't know how to extract it?

1 Answer 1

1

This blog post titled: CentOS / RHEL : How to find the creation time of LVM volume shows how to go about it.

...By default, the metadata backup is stored in the /etc/lvm/backup directory. Each Volume group backup is stored in this directory with file name same as the VG name. The metadata archives are stored in the /etc/lvm/archive directory....

Method #1 - lvdisplay

This command shows you when the LV's were created.

$ sudo lvdisplay
 --- Logical volume ---
  LV Path                /dev/vg/vol
  LV Name                vol
  VG Name                vg
  LV UUID                9M1Hxw-X4bN-t7t4-7auG-qOnb-WHh1-WJVcne
  LV Write Access        read/write
  LV Creation host, time name, 2015-08-20 11:42:33 +0530
  LV Status              available
  # open                 1
  LV Size                18.62 GiB
  Current LE             4768
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

Method #2 - Finding logical volumes creation time via files

# ls -lrt
total 36
-rw------- 1 root root 1332 Mar 11  2016 data_vg_00000-348356217.vg
-rw------- 1 root root 1736 Mar 11  2016 vg_os_00000-841042346.vg
-rw------- 1 root root 1330 Apr 26  2016 data_vg_00001-957076245.vg
-rw------- 1 root root 1743 Apr 26  2016 data_vg_00002-1897075856.vg
-rw------- 1 root root 2744 Mar 14 10:27 data_vg_00003-447171210.vg
-rw------- 1 root root 2917 May 19 15:13 data_vg_00004-1853760200.vg

If you look in these files you'll see when the LV was created:

$ cat data_vg_00004-1853760200.vg
....
    logical_volumes {

        lv_data {
            id = "lG8ZJR-K11q-Lho5-df6n-lSse-eDE5-HJFeAF"
            status = ["READ", "WRITE", "VISIBLE"]
            flags = []
            creation_host = "localhost"
            creation_time = 1457695889  # 2016-03-11 17:01:29 +0530
            segment_count = 1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .