72

When I do sudo apt-get upgrade, I have the following message:

 WARNING: PV /dev/sda3 in VG ubuntu-vg is using an old PV header,
 modify the VG to update.

What can I do?

iBug
  • 1,879

1 Answers1

116

'VG' in the warning means volume group. This is applicable to systems using logical volume management. 'PV' stands for physical volume, that is the actual partitions on disk(s). Headers contains information about the volume group's layout which can be used for data recovery.

You can try to resolve this with the tool vgck, which checks volume group metadata, and can correct it with the --updatemetadata option. You need to give the name of the volume group mentioned in your warning - in your case it says that the physical volume /dev/sda3 in volume group ubuntu-vg is using an old header, so you need to use that volume group as the argument:

sudo vgck --updatemetadata ubuntu-vg

This will issue the same warning; to prove that it fixed the issue, simply run

sudo vgck --updatemetadata ubuntu-vg

once more, and the warning should not appear.

sotirov
  • 4,455
  • 11
    Ensure that you replace ubuntu-vg with the actual volume group name from your own specific error message, as it may vary. ;-) – Ben Johnson Jan 26 '21 at 21:37
  • 1
    This answer is still relevant as I had this issue today also useful ref: https://manpages.ubuntu.com/manpages/focal/man8/vgck.8.html – Antony Feb 24 '21 at 14:14
  • 3
    Could anyone write another answer ou complete this one? Even with the man provided by @Antony , we technically don't know the drawbacks of this command, nor what it does, nor when to use it, etc. – JarsOfJam-Scheduler Mar 17 '21 at 08:11
  • @BenJohnson otherwise what would happens? Feel free to edit this answer since your comment may be important for people looking at the question. – JarsOfJam-Scheduler Mar 17 '21 at 08:12
  • 1
    @JarsOfJam-Scheduler It looks like @Zanna has improved the answer and incorporated my previous comment, but to answer your question, using a non-existent volume group name would yield two errors, Volume group "ubuntu-vg" not found and Cannot process volume group ubuntu-vg. – Ben Johnson Mar 22 '21 at 16:46
  • 2
    sudo vgscan triggers it as well. – rjt Sep 17 '22 at 08:48
  • What bad things will happen if I ignore the warning? – SomeoneElse Sep 22 '22 at 13:59
  • 1
    @SomeoneElse probably nothing; some new features may not work. This may (will, according to Murphy's law) inevitably trip up some scripts that rely on newer features over time, so it is good practice to keep up to date even though it will not have an immediate impact in the foreseeable future. – sehe Feb 09 '23 at 03:31
  • Yes, as root "vgck blah; vgck --updatemetadata blah; vgck blah" gave no output on the final "vgck". – SomeoneElse Feb 10 '23 at 20:53
  • 1
    Out of an abundance of caution, I suggest manually backing up the volume group metadata before updating it. Run vgcfgbackup, then cp -r /etc/lvm ~/my/backup/dir. – holocronweaver Apr 18 '23 at 23:21