vgcreate fails with 'already exists in filesystem' error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?





[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux