Please login or register. August 18, 2019, 09:41:49 PM

Author Topic: lvm - pvid creation date  (Read 7064 times)

0 Members and 1 Guest are viewing this topic.

fourth_username

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
lvm - pvid creation date
« on: November 03, 2011, 11:29:22 AM »
I've been googling this for weeks.  When a physical volume is added to the system, a PVID is assigned.  This contains the first 4 bytes of the machine id, and then a value that is derived from the creation date.  Other than being described as a sort of "special algorithm" that embeds the creation date, does anyone know how to determine the creation date of the PV from this field?  It's not seconds since the epoch, and I've not been able to see any pattern among various PVIDs.   (And failing that, I don't see anything inside the headers on the drive that would otherwise indicate the creation date).  So anyone know how to tell when a disk was created?

Thanks.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1139
  • Karma: +0/-0
Re: lvm - pvid creation date
« Reply #1 on: November 10, 2011, 06:56:09 AM »
I'll see if I can get a direct answer to this. The goal, as I recall, was to make it impossible for two disks to ever have the same PVID. By having the machine serial number be one part, and LVM serialized enough such that only one disk will be given a PVID, and that it is expected to take at least one second, no disk PVID should ever be the same.

Once the PVID is made, it does not matter where or when it was made - only that it has the correct length and is unique in both the system and the volume groups (if any) it is used in.

Just guessing - but the time() might be used as a seed to random() - which could explain why it is not as simple as the delta from epoch.

fourth_username

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
Re: lvm - pvid creation date
« Reply #2 on: November 10, 2011, 11:46:00 AM »
It sure seems like something like that.  Given a physical volume, it's hard to imagine there is no trail of crumbs that shows the creation time/date of that PV.  Never seen it discussed, though, either.  For maintenance purposes, I'm trying to document when a given drive was put into service (when built from mksysb).  The mksysb restore passes the old VG and LV information via the image.data file, but creates the PVID on the target drive before it starts restoring such data (correct me if I'm wrong).  Such PV data is not in image.data, etc. so I'm just trying to backtrack for the physical device.

Thanks.


Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1139
  • Karma: +0/-0
Re: lvm - pvid creation date
« Reply #3 on: November 11, 2011, 08:06:32 PM »
For mksysb there is pvid data in the bosinst.data file. Don't recall from memory what the file name is for a data volume group (made via savevg).

Not had time to research it. Next week, er soon ;)