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

Upon lvcreate, error "1 existing signature left on the device. Failed to wipe signatures on logical volume " #88

Closed
SHWETHABHAT1 opened this issue Jul 25, 2022 · 5 comments

Comments

@SHWETHABHAT1
Copy link

This issue is seen with lvm2-2.03.14-3.el8.x86_64 during lvcreate when the previous signatures are not wiped. But after updating the wipe_signatures_when_zeroing_new_lvs=0 in lvm.conf, the issue is not seen. This has been working previously with the wipe_signatures_when_zeroing_new_lvs=1, but why is it seen now ? It asks for prompt, as it is done in automatic way, we cant provide the --yes option here.
Any help would be appreciated.

@zkabelac
Copy link

Hi

Please, can you provide log of your command execution - as it seems like it works in my case:

[root@linux export]# lvcreate -l10 vg
Logical volume "lvol0" created.
WARNING: This metadata update is NOT backed up.
[root@linux export]# mkfs /dev/vg/lvol0
mke2fs 1.46.5 (30-Dec-2021)
Zahazují se bloky zařízení: hotovo
Vytváří se systém souborů s 10240 (1k) bloky a 2560 uzly
UUID systému souborů=9acfd3e9-b391-40ea-8613-7be567fdbb5e
Zálohy superbloku uloženy v blocích:
8193

Alokují se tabulky skupin: hotovo
Zapisuji tabulky iuzlů: hotovo
Zapisuji superbloky a účtovací informace systému souborů: hotovo

[root@linux export]# lvremove -f vg
Logical volume "lvol0" successfully removed.
WARNING: This metadata update is NOT backed up.
[root@linux export]# lvcreate -l10 vg
WARNING: ext2 signature detected on /dev/vg/lvol0 at offset 1080. Wipe it? [y/n]: y
Wiping ext2 signature on /dev/vg/lvol0.
Logical volume "lvol0" created.
WARNING: This metadata update is NOT backed up.
[root@linux export]# mkfs /dev/vg/lvol0
mke2fs 1.46.5 (30-Dec-2021)
Zahazují se bloky zařízení: hotovo
Vytváří se systém souborů s 10240 (1k) bloky a 2560 uzly
UUID systému souborů=16e44c72-1da4-4798-a230-77604fc14e59
Zálohy superbloku uloženy v blocích:
8193

Alokují se tabulky skupin: hotovo
Zapisuji tabulky iuzlů: hotovo
Zapisuji superbloky a účtovací informace systému souborů: hotovo

[root@linux export]# lvremove -f vg
Logical volume "lvol0" successfully removed.
WARNING: This metadata update is NOT backed up.
[root@linux export]# lvcreate -l10 --yes vg
Wiping ext2 signature on /dev/vg/lvol0.
Logical volume "lvol0" created.
WARNING: This metadata update is NOT backed up.

@SHWETHABHAT1
Copy link
Author

Hi zkabelac,
Thanks for replying.
The issue is like, if signatures are present, then it asks for manual confirmation for wiping during lvcreate command. But in some packages, which makes use of lvcreate internally (in my case, it is puppetmodules-lvm), this doesnt have the support now, to provide the automated confirmation reply to the lvcreate command, and it takes the default response to confirmation asked for lvcreate as "n".

  1. So I was wondering if there is any option or support available to have the "--yes" option in lvm.conf ?
  2. Is the confirmation for wiping being introduced recently in lvcreate ? Becoz I dont see this issue before, and it was wiping well by default, I believe.

Execution of '/usr/sbin/lvcreate -n --extents 100%FREE ' returned 5: WARNING: signature detected on /dev//*** at offset 0. Wipe it? [y/n]: [n]
Aborted wiping of .
1 existing signature left on the device.
Failed to wipe signatures on logical volume /.
Aborting. Failed to wipe start of new LV.

@zkabelac
Copy link

Please provide 'trace' for your working & non-working case.

Wiping of the signature has been introduced around 2014 - so unless you upgrade from that version nothing should change.

You can always disable wiping in lvm.conf and wipe yourself with wipefs command.

In the script to get 'yes' answer you need to pass -y|--yes.

@SHWETHABHAT1
Copy link
Author

SHWETHABHAT1 commented Aug 3, 2022

As mentioned recently the lvm has been upgraded from lvm2-2.02.187-6.el7_9.5.x86_64 to lvm2-libs-2.03.14-3.el8.x86_64.
A 3rd party package currently helps in creating logical volumes. We just need to supply the logical volume name and other info. So we don't have the handle to supply --yes to the lvcreate command. The only support handle we have is to use lvm.conf to set all the prompting to --yes. But it seems this support is not available in lvm.conf

So thinking of using the approach of disabling the wiping in lvm.conf and then manually wipe all the signatures with wifefs command.

@zkabelac
Copy link

Assuming disabling wiping solves the issue.
Also --yes is the correct way how to answer 'y' to prompts in scripting.

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