Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'vgchange --systemid' doesn't work with '--select vg_uuid=<uuid>' #93

Closed
lignumqt opened this issue Oct 27, 2022 · 5 comments
Closed

'vgchange --systemid' doesn't work with '--select vg_uuid=<uuid>' #93

lignumqt opened this issue Oct 27, 2022 · 5 comments

Comments

@lignumqt
Copy link

Hello! I have version lvm2 2.03.07.
If I have two VG devices with same name, then I can't change systemid by VG_UUID, but the 'vgchange' offers it, but doesn't work

vgdisplay 
  --- Volume group ---
  VG Name               test
  System ID             node1
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               <1.75 TiB
  PE Size               4.00 MiB
  Total PE              457854
  Alloc PE / Size       62978 / <246.01 GiB
  Free  PE / Size       394876 / <1.51 TiB
  VG UUID               I0NywW-P77Q-t0I8-RRh7-wXWN-ffKO-T8JA8Y
   
  --- Volume group ---
  VG Name               test
  System ID             node1
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               745.21 GiB
  PE Size               4.00 MiB
  Total PE              190774
  Alloc PE / Size       62978 / <246.01 GiB
  Free  PE / Size       127796 / 499.20 GiB
  VG UUID               4Pya72-0QM4-IuiL-2cr2-oWkp-fkc1-tewrG9

vgchange test --systemid node2
  Multiple VGs found with the same name: skipping test
  Use --select vg_uuid=<uuid> in place of the VG name.
vgchange --select vg_uuid=4Pya72-0QM4-IuiL-2cr2-oWkp-fkc1-tewrG9 --systemid node2 
  No command with matching syntax recognised.  Run 'vgchange --help' for more information.
  Nearest similar command has syntax:
  vgchange --systemid String VG
  Change the system ID of a VG.

PS: I created two devices with the same name by removing the disks, and then returning them

@teigland
Copy link
Contributor

Hi, unfortunately the --select option only works with a subset of lvm commands, and can't be used with vgchange (we should change the error message to avoid the wrong suggestion.) There is another simple way of doing what you need by limiting the set of devices the command uses to only the PVs in the VG that you are trying to change:

Newer lvm versions:
vgchange --devices /dev/foo,/dev/bar --systemid x vgname

Older lvm versions:
vgchange --config 'devices/filter=["a|/dev/foo|", "a|/dev/bar|", "r|.|"]' --systemid x vgname

@lignumqt
Copy link
Author

Hi, unfortunately the --select option only works with a subset of lvm commands, and can't be used with vgchange (we should change the error message to avoid the wrong suggestion.) There is another simple way of doing what you need by limiting the set of devices the command uses to only the PVs in the VG that you are trying to change:

Newer lvm versions: vgchange --devices /dev/foo,/dev/bar --systemid x vgname

Older lvm versions: vgchange --config 'devices/filter=["a|/dev/foo|", "a|/dev/bar|", "r|.|"]' --systemid x vgname

The second way worked for me. Thank you!
I think it would be better to add the option '--select <vg_uuid>' or something that allows vg_uuid to be specified

@teigland
Copy link
Contributor

It was pointed out that vgchange does actually work with --select, and it was simply the command definitions that were missing the necessary annotation to allow --select with vgchange --systemid. That's now been added.

@lignumqt
Copy link
Author

Было указано, что vgchange действительно работает с --select, и просто в определениях команд отсутствовала необходимая аннотация, позволяющая --select с vgchange --systemid. Теперь это было добавлено.

sorry, I didn't quite understand, is this already fixed in the latest version of lvm, or you made a commit? anyway, if you know the commit hash, could you post a link

@teigland
Copy link
Contributor

@teigland teigland closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants