You are not logged in.

#1 2016-05-07 22:18:46

bokailya
Member
Registered: 2016-05-07
Posts: 12

Can't create new lvm volume

[root@arch user]# lvcreate -L600M -n test vg-arch
  Insufficient free space: 150 extents needed, but only 0 available
[root@arch user]# vgs
  VG      #PV #LV #SN Attr   VSize   VFree
  vg-arch   1   2   0 wz--n- 929.51g 19.51g
[root@arch user]# lvs
  LV   VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home vg-arch -wi-ao---- 900.00g                                                   
  root vg-arch -wi-ao----  10.00g                                                   
[root@arch user]# vgdisplay vg-arch
  --- Volume group ---
  VG Name               vg-arch
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  10
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               929.51 GiB
  PE Size               4.00 MiB
  Total PE              237954
  Alloc PE / Size       232960 / 910.00 GiB
  Free  PE / Size       4994 / 19.51 GiB
  VG UUID               wWTljk-aeGq-ORmw-0OAg-VhWx-DPxk-obPzVc

Offline

#2 2016-05-08 09:50:03

bokailya
Member
Registered: 2016-05-07
Posts: 12

Re: Can't create new lvm volume

If that can help

[root@arch user]# lsblk
NAME                MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                   8:0    0 931.5G  0 disk 
├─sda1                8:1    0     2G  0 part  /boot
└─sda2                8:2    0 929.5G  0 part 
  └─lvm             254:0    0 929.5G  0 crypt
    ├─vg--arch-root 254:1    0    10G  0 lvm   /
    └─vg--arch-home 254:2    0   900G  0 lvm   /home
sr0                  11:0    1  1024M  0 rom

Offline

#3 2016-05-08 11:04:20

bokailya
Member
Registered: 2016-05-07
Posts: 12

Re: Can't create new lvm volume

Output of

lvcreate -L10G -n test vg-arch -vvvv

http://pastebin.com/ga5hYrZn

lv_manip.c

/* Is there enough total space or should we give up immediately? */
static int _sufficient_pes_free(struct alloc_handle *ah, struct dm_list *pvms,
                                uint32_t allocated, uint32_t extents_still_needed)
{
        uint32_t area_extents_needed = (extents_still_needed - allocated) * ah->area_count / ah->area_multiple;
        uint32_t parity_extents_needed = (extents_still_needed - allocated) * ah->parity_count / ah->area_multiple;
        uint32_t metadata_extents_needed = ah->alloc_and_split_meta ? 0 : ah->metadata_area_count * RAID_METADATA_AREA_LEN; /* One each */
        uint32_t total_extents_needed = area_extents_needed + parity_extents_needed + metadata_extents_needed;
        uint32_t free_pes = pv_maps_size(pvms);

        if (total_extents_needed > free_pes) {
                log_error("Insufficient free space: %" PRIu32 " extents needed,"
                          " but only %" PRIu32 " available",
                          total_extents_needed, free_pes);
                return 0;
        }

        return 1;
}

Offline

#4 2016-05-08 11:28:36

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: Can't create new lvm volume

Anything in `dmesg`?

Is there anything in `dmsetup table` that should no longer be there?

What happens if you add `--alloc anywhere` to your lvcreate?

Can you show your metadata `vgcfgbackup`?

If it's not incredibly fragmented for some reason maybe all it needs is a `pvck`.

Last edited by frostschutz (2016-05-08 11:28:53)

Offline

#5 2016-05-08 13:29:14

bokailya
Member
Registered: 2016-05-07
Posts: 12

Re: Can't create new lvm volume

dmesg (full):
http://pastebin.com/SrKRSwkB

# dmsetup table
vg--arch-home: 0 1887436800 linear 254:0 20973568
vg--arch-root: 0 20971520 linear 254:0 2048
lvm: 0 1949324720 crypt aes-xts-plain64 0000000000000000000000000000000000000000000000000000000000000000 0 8:2 4096

diff of output with and without --alloc anywhere http://pastebin.com/N2BLtXjq

cat /etc/lvm/backup/vg-arch
http://pastebin.com/myCSeXwA

pvck don't change result

Offline

#6 2016-05-08 13:31:53

bokailya
Member
Registered: 2016-05-07
Posts: 12

Re: Can't create new lvm volume

I completely don't understand, why this happens sad

Offline

#7 2016-05-08 13:55:34

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: Can't create new lvm volume

Your PV is for some reason set to be not allocateable.

pvchange --allocatable y /dev/mapper/lvm

The error message could be better...

Offline

#8 2016-05-08 14:10:35

bokailya
Member
Registered: 2016-05-07
Posts: 12

Re: Can't create new lvm volume

frostschutz, Thank you so much!!
LOL I'm so stupid XDD

Offline

#9 2016-05-08 14:31:15

bokailya
Member
Registered: 2016-05-07
Posts: 12

Re: Can't create new lvm volume

Maybe i should write about error message in mailing list?

Offline

Board footer

Powered by FluxBB