• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : How to find the creation time of LVM volume

by admin

Metadata backups and archives are automatically created on every volume group and logical volume configuration change unless disabled in the /etc/lvm/lvm.conf file. 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. How long the the metadata archives stored in the /etc/lvm/archive directory are kept and how many archive files are kept is determined by parameters you can set in the lvm.conf file. A daily system backup should include the contents of the /etc/lvm directory in the backup.

Finding the creation time of logical volume

1. Multiple files for each VG are created in the directory /etc/lvm/archive for every change done and VG or LV level.

# 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

2. You can see check for the line shown below in each of the files to see what was the activity done. In below example the newlv volume has been resized by 50GB.

description = "Created *before* executing 'lvcreate -L 50g -n newlv vg_data'"

3. So to find the creation time of a particular LV you can cat the latest file (as it should contain all the LVs) and look for the line “creation_time“. For example :

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
Note : Check for the Latest archive file of the VG as it will contain all the LVs in the VG

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 5 : How to rebuild Initial Ramdisk Image
  2. How to Make User Account Read-Only in CentOS/RHEL 7
  3. aa-disable: command not found
  4. setsebool Command in Linux
  5. mount Command Examples in Linux
  6. “userdel: user xxx is currently used by process yyy” – Unable to delete an User
  7. How to Extend allowed number of loopback devices
  8. pacman –remove Command Examples in Linux
  9. cpufreq-aperf Command Examples in Linux
  10. UNIX / Linux : How to lock or disable an user account

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright