All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Difference between Debian and some other distributions with thin provisioning
@ 2017-09-29 16:42 Jan Tulak
  2017-09-30  8:11 ` Xen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jan Tulak @ 2017-09-29 16:42 UTC (permalink / raw)
  To: linux-lvm

Hi guys,
I found out this difference and I'm not sure what is the cause. A
command for creating a thin LV, which works on Archlinux, Centos and
Fedora, fails on Debian and Ubuntu:

lvm lvcreate FOOvg1 \
    -T \
    -l 100%PVS \
    -n FOOvg1_thin001 \
    /dev/loop0 /dev/loop1 /dev/loop2

When it is created, lvs shows attributes "twi-a-tz--". But Debian and
Ubuntu complain that  "--name may only be given when creating a new
thin Logical volume or snapshot," even though the command states it
should be thin with -T. A script that tests this issue is at the end
of this email

Do you know if there is a reason for this different behaviour?
Versions seem to be close enough for it not to be a change in LVM
behaviour, so I suspect some downstream or configuration changes. All
tested distributions were run in their current stable versions, up to
date. For example:

Debian:
# cat /etc/debian_version
8.9
# lvm version
  LVM version:     2.02.111(2) (2014-09-01)
  Library version: 1.02.90 (2014-09-01)
  Driver version:  4.27.0

Centos:
# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
# lvm version
  LVM version:     2.02.171(2)-RHEL7 (2017-05-03)
  Library version: 1.02.140-RHEL7 (2017-05-03)
  Driver version:  4.35.0

Thanks,
Jan

-------


#!/usr/bin/env bash

# Test how the current distribution behaves when creating a thin LV.
# Centos, Fedora and Archlinux pass the test,
# but Debian and Ubuntu do not.

if [ $(whoami) != "root" ]; then
    echo "Need to be root!"
    exit 1
fi

if [ $(losetup -a |wc -l) -ne 0 ]; then
    echo "Some loopback devices are already there."
    echo "I don't want to screw up anything and it is not worth of making"
    echo "any autodetection, so I will just stop now."
    exit 1
fi

echo "setting up"

# create files for loop devices
dd if=/dev/zero bs=1M count=150 of=/tmp/0 &>/dev/null
dd if=/dev/zero bs=1M count=150 of=/tmp/1 &>/dev/null
dd if=/dev/zero bs=1M count=150 of=/tmp/2 &>/dev/null

# create loop devices
losetup -f /tmp/0 >/dev/null
losetup -f /tmp/1 >/dev/null
losetup -f /tmp/2 >/dev/null

# create PVs
pvcreate /dev/loop0 >/dev/null
pvcreate /dev/loop1 >/dev/null
pvcreate /dev/loop2 >/dev/null

# create VG
vgcreate FOOvg1 /dev/loop0 /dev/loop1 /dev/loop2 >/dev/null

# create thin lv
echo "running the test:"
echo "lvm lvcreate FOOvg1 \\
    -T \\
    -l 100%PVS \\
    -n FOOvg1_thin001 \\
    /dev/loop0 /dev/loop1 /dev/loop2"
echo ""



######### THIS IS THE COMMAND

lvm lvcreate FOOvg1 \
    -T \
    -l 100%PVS \
    -n FOOvg1_thin001 \
    /dev/loop0 /dev/loop1 /dev/loop2





# test if it worked - if yes, lvs will see the LV with thin attr
echo ""
if [ $(lvs | grep "FOOvg1_thin001" | grep -c "twi-a-tz--") -eq 1 ]; then
    echo "result: it works"
else
    echo "result: it doesn't work"
fi

# ---
# just cleanup

echo "Cleaning up..."

yes | lvremove  FOOvg1/FOOvg1_thin001 &>/dev/null
vgremove FOOvg1 >/dev/null
pvremove /dev/loop0 >/dev/null
pvremove /dev/loop1 >/dev/null
pvremove /dev/loop2 >/dev/null

losetup -d /dev/loop0 >/dev/null
losetup -d /dev/loop1 >/dev/null
losetup -d /dev/loop2 >/dev/null

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

* Re: [linux-lvm] Difference between Debian and some other distributions with thin provisioning
  2017-09-29 16:42 [linux-lvm] Difference between Debian and some other distributions with thin provisioning Jan Tulak
@ 2017-09-30  8:11 ` Xen
  2017-09-30 17:24 ` Zdenek Kabelac
  2017-09-30 17:31 ` Gionatan Danti
  2 siblings, 0 replies; 5+ messages in thread
From: Xen @ 2017-09-30  8:11 UTC (permalink / raw)
  To: linux-lvm

Jan Tulak schreef op 29-09-2017 18:42:

> Debian:
> # cat /etc/debian_version
> 8.9
> # lvm version
>   LVM version:     2.02.111(2) (2014-09-01)
>   Library version: 1.02.90 (2014-09-01)
>   Driver version:  4.27.0
> 
> Centos:
> # cat /etc/redhat-release
> CentOS Linux release 7.4.1708 (Core)
> # lvm version
>   LVM version:     2.02.171(2)-RHEL7 (2017-05-03)
>   Library version: 1.02.140-RHEL7 (2017-05-03)
>   Driver version:  4.35.0

Versions are not actually very close.

On Debian I do know that I am often confused by thin commands, sometimes 
-T seems to be necessary and sometimes --thin-pool or I am just 
confused, I don't know.

Same with Grub2, it has been in 2.02beta for ages and was only recently 
released as 2.02 but I think years of development went into that.

Although I think I can stay they are quit headstrong as compared to 
LVM2...

But you can see that the versions are 3 years apart anyway...

Regards.

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

* Re: [linux-lvm] Difference between Debian and some other distributions with thin provisioning
  2017-09-29 16:42 [linux-lvm] Difference between Debian and some other distributions with thin provisioning Jan Tulak
  2017-09-30  8:11 ` Xen
@ 2017-09-30 17:24 ` Zdenek Kabelac
  2017-10-02 10:55   ` Jan Tulak
  2017-09-30 17:31 ` Gionatan Danti
  2 siblings, 1 reply; 5+ messages in thread
From: Zdenek Kabelac @ 2017-09-30 17:24 UTC (permalink / raw)
  To: LVM general discussion and development, Jan Tulak

Dne 29.9.2017 v 18:42 Jan Tulak napsal(a):
> Hi guys,
> I found out this difference and I'm not sure what is the cause. A
> command for creating a thin LV, which works on Archlinux, Centos and
> Fedora, fails on Debian and Ubuntu:
> 
> lvm lvcreate FOOvg1 \
>      -T \
>      -l 100%PVS \
>      -n FOOvg1_thin001 \
>      /dev/loop0 /dev/loop1 /dev/loop2

Hi

This command is not actually creating 'thin'  - only a thin-pool.
For 'thin' you need to specify -V  --virtualsize.

The usage of -T  is 'smart' flag - telling lvm2 to do 'something' 
thin/thin-pool oriented.

If you want to be 'exact' you can use --type thin  or --type thin-pool giving 
you more errors and requiring user more specific option for passing in.


> When it is created, lvs shows attributes "twi-a-tz--". But Debian and
> Ubuntu complain that  "--name may only be given when creating a new
> thin Logical volume or snapshot," even though the command states it
> should be thin with -T. A script that tests this issue is at the end
> of this email

Yep - the logic of command is internally enhanced over time and when user does 
specify parameters in a way where lvm2 can interpret them uniquely - it will 
do it.

BTW step-by around ;) for detailed explanation of all possible combination 
users can use to create  thin-pool or thin or both volumes at the same time.

> Do you know if there is a reason for this different behaviour?

It's not different -  newer version is 'enhanced' and just accepts wider 
syntax range.

> Versions seem to be close enough for it not to be a change in LVM

Hmm, close enough 111 and 171 ??


> behaviour, so I suspect some downstream or configuration changes. All
> tested distributions were run in their current stable versions, up to
> date. For example:

The original naming convention with pool names was to add the name next to VG 
name.

lvcreate -T -L10 vg/pool

Pool is 'special' type of LV - thus it got this privileged naming and standard 
option --name was normally left for  'thin' when user specifies -V.

Newer version of lvm2 can use  --name with --size specifier for pool name
when there is no virtual size given as its unique combination.

> Debian:
> # cat /etc/debian_version
> 8.9
> # lvm version
>    LVM version:     2.02.111(2) (2014-09-01)
>    Library version: 1.02.90 (2014-09-01) >    Driver version:  4.27.0

I'd suggest upgrading your Debian machine....

Regards

Zdenek

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

* Re: [linux-lvm] Difference between Debian and some other distributions with thin provisioning
  2017-09-29 16:42 [linux-lvm] Difference between Debian and some other distributions with thin provisioning Jan Tulak
  2017-09-30  8:11 ` Xen
  2017-09-30 17:24 ` Zdenek Kabelac
@ 2017-09-30 17:31 ` Gionatan Danti
  2 siblings, 0 replies; 5+ messages in thread
From: Gionatan Danti @ 2017-09-30 17:31 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: Jan Tulak

Il 29-09-2017 18:42 Jan Tulak ha scritto:
> Debian:
> # cat /etc/debian_version
> 8.9
> # lvm version
>   LVM version:     2.02.111(2) (2014-09-01)
>   Library version: 1.02.90 (2014-09-01)
>   Driver version:  4.27.0
> 
> Centos:
> # cat /etc/redhat-release
> CentOS Linux release 7.4.1708 (Core)
> # lvm version
>   LVM version:     2.02.171(2)-RHEL7 (2017-05-03)
>   Library version: 1.02.140-RHEL7 (2017-05-03)
>   Driver version:  4.35.0

Well, this output explains everything: Debian's LVM version is almost 3 
years older than CentOS's one.
Generally speaking, I think that CentOS/RH ages *much* better than 
Debian/Ubuntu regarding core kernel technologies (and related userspace 
tools) as thin provisioning.

Regards.

-- 
Danti Gionatan
Supporto Tecnico
Assyoma S.r.l. - www.assyoma.it
email: g.danti@assyoma.it - info@assyoma.it
GPG public key ID: FF5F32A8

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

* Re: [linux-lvm] Difference between Debian and some other distributions with thin provisioning
  2017-09-30 17:24 ` Zdenek Kabelac
@ 2017-10-02 10:55   ` Jan Tulak
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Tulak @ 2017-10-02 10:55 UTC (permalink / raw)
  To: Zdenek Kabelac; +Cc: LVM general discussion and development

On Sat, Sep 30, 2017 at 7:24 PM, Zdenek Kabelac <zkabelac@redhat.com> wrote:
> Dne 29.9.2017 v 18:42 Jan Tulak napsal(a):
>>
>> Hi guys,
>> I found out this difference and I'm not sure what is the cause. A
>> command for creating a thin LV, which works on Archlinux, Centos and
>> Fedora, fails on Debian and Ubuntu:
>>
>> lvm lvcreate FOOvg1 \
>>      -T \
>>      -l 100%PVS \
>>      -n FOOvg1_thin001 \
>>      /dev/loop0 /dev/loop1 /dev/loop2
>
>
> Hi
>
> This command is not actually creating 'thin'  - only a thin-pool.
> For 'thin' you need to specify -V  --virtualsize.
>
> The usage of -T  is 'smart' flag - telling lvm2 to do 'something'
> thin/thin-pool oriented.
>
> If you want to be 'exact' you can use --type thin  or --type thin-pool
> giving you more errors and requiring user more specific option for passing
> in.
>
Hi,

Ah, thanks for the explanation.


>> Versions seem to be close enough for it not to be a change in LVM
>
>
> Hmm, close enough 111 and 171 ??
>

I would swear I saw different numbers when I wrote it. 117 perhaps?
So, disregard this part of my message. :-)

>
>> behaviour, so I suspect some downstream or configuration changes. All
>> tested distributions were run in their current stable versions, up to
>> date. For example:
>
>
> The original naming convention with pool names was to add the name next to
> VG name.
>
> lvcreate -T -L10 vg/pool
>
> Pool is 'special' type of LV - thus it got this privileged naming and
> standard option --name was normally left for  'thin' when user specifies -V.
>
> Newer version of lvm2 can use  --name with --size specifier for pool name
> when there is no virtual size given as its unique combination.
>
>> Debian:
>> # cat /etc/debian_version
>> 8.9
>> # lvm version
>>    LVM version:     2.02.111(2) (2014-09-01)
>>    Library version: 1.02.90 (2014-09-01) >    Driver version:  4.27.0
>
>
> I'd suggest upgrading your Debian machine....

It is a current Debian 8, so the only thing I can do is to upgrade to
Debian 9 or use a different repository. And indeed, on 9 it works.

Thanks for your answers, I know what the issue is and can now decide
what to do next with it. :-)

Cheers,
Jan

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

end of thread, other threads:[~2017-10-02 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-29 16:42 [linux-lvm] Difference between Debian and some other distributions with thin provisioning Jan Tulak
2017-09-30  8:11 ` Xen
2017-09-30 17:24 ` Zdenek Kabelac
2017-10-02 10:55   ` Jan Tulak
2017-09-30 17:31 ` Gionatan Danti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.