linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* vgcreate fails with 'already exists in filesystem' error
@ 2023-12-11 13:40 divya mohan
  2023-12-12 14:54 ` Zdenek Kabelac
  0 siblings, 1 reply; 2+ messages in thread
From: divya mohan @ 2023-12-11 13:40 UTC (permalink / raw)
  To: linux-lvm

I have an installation test environment, where occasionally an issue
is observed causing volume group creation to fail.

At the beginning of test, the disk contains four partitions.

---
# parted -l
Model: ATA Micron_5100_MTFD (scsi)
Disk /dev/sda: 480GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  525MB   524MB   fat16        EFI system partition  boot, esp
 2      525MB   1050MB  524MB                Linux filesystem
 3      1050MB  33.3GB  32.2GB  ext4         Linux LVM             lvm
 4      33.3GB  463GB   429GB                Linux LVM             lvm
---

The intention is to create a new partition /dev/sda6 and volume group
VG_TEST. Since the volume group might have been created in earlier
tests, a pre-cleanup is done first.

When the issue hits, the vgremove command output says that group does
not exist, but the vgcreate command fails with error that it already
exists.

---

# sgdisk --new=6:904849408:925820927 --change-name=6:TEST-FS /dev/sda
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.

# sleep 5

# partprobe /dev/sda

# vgremove -f VG_TEST
  Volume group "VG_TEST" not found
  Cannot process volume group VG_TEST

# rm -rf /dev/VG_TEST

# pvcreate  -ffy /dev/sda6
  Physical volume "/dev/sda6" successfully created.

# vgcreate VG_TEST /dev/sda6
  /dev/VG_TEST: already exists in filesystem
  Run `vgcreate --help' for more information.
---

(The removal of /dev/VG_TEST was added based on a suggestion found at
https://listman.redhat.com/archives/linux-lvm/2003-February/009721.html
 but it did not help anyways.)

At the end of the test, output of below commands were collected.

Here, lsblk shows this group, but it is missing in vgs output.

---

# lsblk
NAME                                                           MAJ:MIN
RM   SIZE RO TYPE MOUNTPOINTS
sda                                                              8:0
 0 447.1G  0 disk
├─sda1                                                           8:1
 0   500M  0 part
├─sda2                                                           8:2
 0   500M  0 part
├─sda3                                                           8:3
 0    30G  0 part /var/lib/docker
├─sda4                                                           8:4
 0   400G  0 part
│ ├─VG_System-..
│ ..
└─sda6                                                           8:6
 0    10G  0 part
  └─VG_TEST-sysimg                                             252:23
 0     9G  0 lvm
sr0                                                             11:0
 1  1024M  0 rom
sr1                                                             11:1
 1  1024M  0 rom


# vgs

  VG        #PV #LV #SN Attr   VSize    VFree
  VG_System   1  23   0 wz--n- <400.00g 138.87g

# pvs
  PV         VG        Fmt  Attr PSize    PFree
  /dev/sda4  VG_System lvm2 a--  <400.00g 138.87g
  /dev/sda6            lvm2 ---    10.00g  10.00g
---

What could be causing this issue? How to correctly cleanup the volume group?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: vgcreate fails with 'already exists in filesystem' error
  2023-12-11 13:40 vgcreate fails with 'already exists in filesystem' error divya mohan
@ 2023-12-12 14:54 ` Zdenek Kabelac
  0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Kabelac @ 2023-12-12 14:54 UTC (permalink / raw)
  To: divya mohan, linux-lvm

Dne 11. 12. 23 v 14:40 divya mohan napsal(a):
> I have an installation test environment, where occasionally an issue
> is observed causing volume group creation to fail.
> 
> At the beginning of test, the disk contains four partitions.
> 
> ---
> 
> What could be causing this issue? How to correctly cleanup the volume group?

Hi

As the generic advice -  check  'vgcreate -vvvv' command output.

This debug output should be pretty verbose and readable and giving you  more 
hints about what's going wrong.

Eventually post such trace if you are not able to decode this.

Regards

Zdenek


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-12 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-11 13:40 vgcreate fails with 'already exists in filesystem' error divya mohan
2023-12-12 14:54 ` Zdenek Kabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).