linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] -l 100%FREE doesn't work with RAID1
@ 2016-01-20 12:19 Bryan Larsen
  2016-01-20 18:17 ` Fran Garcia
  2016-01-20 19:16 ` Alasdair G Kergon
  0 siblings, 2 replies; 4+ messages in thread
From: Bryan Larsen @ 2016-01-20 12:19 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

I'm setting up some provisioning scripts, so I don't know the actual sizes
of the hard drives

$ sudo lvcreate --type raid1 -m 1 -l 100%FREE -n backups hdd_vg
  Insufficient free space: 781320 extents needed, but only 390658 available
$ sudo lvcreate --type raid1 -m 1 -l 50%FREE -n backups hdd_vg
  Insufficient free space: 390662 extents needed, but only 390658 available

thoughts?

thanks,
Bryan

[-- Attachment #2: Type: text/html, Size: 555 bytes --]

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

* Re: [linux-lvm] -l 100%FREE doesn't work with RAID1
  2016-01-20 12:19 [linux-lvm] -l 100%FREE doesn't work with RAID1 Bryan Larsen
@ 2016-01-20 18:17 ` Fran Garcia
  2016-01-20 18:55   ` Bryan Larsen
  2016-01-20 19:16 ` Alasdair G Kergon
  1 sibling, 1 reply; 4+ messages in thread
From: Fran Garcia @ 2016-01-20 18:17 UTC (permalink / raw)
  To: LVM general discussion and development

On 20 January 2016 at 13:19, Bryan Larsen <bryan@larsen.st> wrote:
> I'm setting up some provisioning scripts, so I don't know the actual sizes
> of the hard drives
>
> $ sudo lvcreate --type raid1 -m 1 -l 100%FREE -n backups hdd_vg
>   Insufficient free space: 781320 extents needed, but only 390658 available
> $ sudo lvcreate --type raid1 -m 1 -l 50%FREE -n backups hdd_vg
>   Insufficient free space: 390662 extents needed, but only 390658 available

the quick and dirty solution... :

EXTENTS=$(sudo vgs -o vg_all --noheadings hdd_vg | awk '{print $12/2}')
lvcreate --type raid1 -m 1 -l $EXTENTS -n backups hdd_vg

:-)

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

* Re: [linux-lvm] -l 100%FREE doesn't work with RAID1
  2016-01-20 18:17 ` Fran Garcia
@ 2016-01-20 18:55   ` Bryan Larsen
  0 siblings, 0 replies; 4+ messages in thread
From: Bryan Larsen @ 2016-01-20 18:55 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

On Wed, 20 Jan 2016 at 13:29 Fran Garcia <franchu.garcia@gmail.com> wrote:

> On 20 January 2016 at 13:19, Bryan Larsen <bryan@larsen.st> wrote:
> > I'm setting up some provisioning scripts, so I don't know the actual
> sizes
> > of the hard drives
> >
> > $ sudo lvcreate --type raid1 -m 1 -l 100%FREE -n backups hdd_vg
> >   Insufficient free space: 781320 extents needed, but only 390658
> available
> > $ sudo lvcreate --type raid1 -m 1 -l 50%FREE -n backups hdd_vg
> >   Insufficient free space: 390662 extents needed, but only 390658
> available
>
> the quick and dirty solution... :
>
> EXTENTS=$(sudo vgs -o vg_all --noheadings hdd_vg | awk '{print $12/2}')
> lvcreate --type raid1 -m 1 -l $EXTENTS -n backups hdd_vg
>
> :-)
>

Two problems with that.

1: I had to replace $12 with $9 to get things to work with my version.   So
probably best to use -o vg_free_count instead of -o vg_all

2: but more importantly, it has the same problem as -l 50%FREE:

  Insufficient free space: 390662 extents needed, but only 390658 available

This works for me:

EXTENTS=$((`sudo vgs -o vg_free_count --noheading hdd_vg`/2 - 2))
sudo lvcreate --type raid1 -m 1 -l $EXTENTS -n backups hdd_vg

Bryan

[-- Attachment #2: Type: text/html, Size: 1767 bytes --]

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

* Re: [linux-lvm] -l 100%FREE doesn't work with RAID1
  2016-01-20 12:19 [linux-lvm] -l 100%FREE doesn't work with RAID1 Bryan Larsen
  2016-01-20 18:17 ` Fran Garcia
@ 2016-01-20 19:16 ` Alasdair G Kergon
  1 sibling, 0 replies; 4+ messages in thread
From: Alasdair G Kergon @ 2016-01-20 19:16 UTC (permalink / raw)
  To: Bryan Larsen; +Cc: linux-lvm

On Wed, Jan 20, 2016 at 12:19:13PM +0000, Bryan Larsen wrote:
> I'm setting up some provisioning scripts, so I don't know the actual sizes
> of the hard drives
> $ sudo lvcreate --type raid1 -m 1 -l 100%FREE -n backups hdd_vg
>   Insufficient free space: 781320 extents needed, but only 390658 available
> $ sudo lvcreate --type raid1 -m 1 -l 50%FREE -n backups hdd_vg
>   Insufficient free space: 390662 extents needed, but only 390658 available

Works for me here.

Perhaps you're using an old version?
When run with -vvvv, the key line for me is this one
metadata/lv_manip.c:3036   Found fewer allocatable extents for logical volume lvol1 than requested: using 48 extents (reduced by 142).
 
Alasdair

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

end of thread, other threads:[~2016-01-20 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-20 12:19 [linux-lvm] -l 100%FREE doesn't work with RAID1 Bryan Larsen
2016-01-20 18:17 ` Fran Garcia
2016-01-20 18:55   ` Bryan Larsen
2016-01-20 19:16 ` Alasdair G Kergon

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).