Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E2FCC77B77 for ; Thu, 13 Apr 2023 06:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681368916; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=pL5EXlMC6OK3/+D1XFsAzOEVtsaF90AttGtHX/VAg30=; b=XYN8sY7CxzV39KBbDh7SrMZmftmq+yPfMxug2+7+Gx8oFxbqlwtQgcdxFg45w032ZW4hSy XhMmmyTd50hGS8qLm1ImRqZj5rDqUeiSOkrAjM9qGWEb0bRB/GVYw4lUiZGqHnDX/ofU7b 1WVvIorKPRHwOclRk1IWAlSnNw4qfD0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-427-EfCZtE3CONOFnST3wCsPug-1; Thu, 13 Apr 2023 02:55:11 -0400 X-MC-Unique: EfCZtE3CONOFnST3wCsPug-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0FBAF29DD99E; Thu, 13 Apr 2023 06:55:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF5D94042AD1; Thu, 13 Apr 2023 06:55:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0872519472C3; Thu, 13 Apr 2023 06:55:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B78241946587 for ; Wed, 12 Apr 2023 13:53:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A6697492C3E; Wed, 12 Apr 2023 13:53:58 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9EC2B492B03 for ; Wed, 12 Apr 2023 13:53:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F62E8996E0 for ; Wed, 12 Apr 2023 13:53:58 +0000 (UTC) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-385-2xnT-lZtN3qMJTDkFgcjdA-1; Wed, 12 Apr 2023 09:53:56 -0400 X-MC-Unique: 2xnT-lZtN3qMJTDkFgcjdA-1 Received: by mail-wr1-f41.google.com with SMTP id i3so1669869wrc.4 for ; Wed, 12 Apr 2023 06:53:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681307635; x=1683899635; h=message-id:cc:to:date:from:subject:content-transfer-encoding :mime-version:user-agent:thread-topic:references:in-reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JHxRDZ0e5mSvPerHayyaVWlbtgrUHoKsNg3xuIoo+VE=; b=Y+L8KrmMgGAzSkjxJ6CKftdan4BkbUyX1re5GBvVAj/oOdiB1eey2phbirXUTqba7J L2GI92zGNCK4tt/winD8yBlIolchMCEt4k0afW07J3Z9z3rm7aZz0kM7L/GgyLejW8Vz btEOz/ygWy9BOuwZ+lYzRRFAerJXZsDH/fGfTeO7S8R7lInMJDDZQjdgcZN4iGegviq3 ebCdlNx4bqzva/+nLEf9dg190iHTLgShSLU/QTVo884Fqkr3wIohtoIWnhITffoBkXqo S0dfPlXMngjpqyYRS0puMB6rEnd7EpwTVmw7gamFJTtqEvgzp1AoCdiDqvm63nAOfRlJ mVCA== X-Gm-Message-State: AAQBX9e9zU0Ocx3e+S0YzrBLuyy6sQ0JrCx7tbrOTyjWdUyePKr70Ee/ EyahG/guYQpkgRP01NfywrFWndAQy8I= X-Google-Smtp-Source: AKy350Y/uGyQ9dB6JkY/YgChyZYt9MrTgAOmUjY5jIvykb7iSvweT3M6S9uBz4YIF1FJcVbqiTz+7Q== X-Received: by 2002:adf:e681:0:b0:2ef:cf6c:9bd1 with SMTP id r1-20020adfe681000000b002efcf6c9bd1mr8710328wrm.67.1681307634531; Wed, 12 Apr 2023 06:53:54 -0700 (PDT) Received: from [10.142.94.181] ([37.163.221.231]) by smtp.gmail.com with ESMTPSA id f25-20020a7bcd19000000b003ed1ff06faasm2435492wmj.19.2023.04.12.06.53.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Apr 2023 06:53:54 -0700 (PDT) In-Reply-To: References: <4649980a-7af2-5b2e-47de-ce88ccb8ac6f@web.de> <845e5b45-42d5-3d7f-bdad-a66ce7a2e5a9@web.de> <563d6e1e-e752-12df-4073-70c9b45c1879@gmail.com> X-Referenced-Uid: 72407 Thread-Topic: Re: [linux-lvm] bug? shrink lv by specifying pv extent to be removed does not behave as expected User-Agent: Android X-Is-Generated-Message-Id: true MIME-Version: 1.0 X-Local-Message-Id: <136aa7af-b2ac-402a-afc5-6506d4b33488@gmail.com> From: Roberto Fastec Date: Wed, 12 Apr 2023 15:53:52 +0200 To: LVM general discussion and development Message-ID: <136aa7af-b2ac-402a-afc5-6506d4b33488@gmail.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mailman-Approved-At: Thu, 13 Apr 2023 06:55:02 +0000 Subject: Re: [linux-lvm] bug? shrink lv by specifying pv extent to be removed does not behave as expected X-BeenThere: linux-lvm@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: LVM general discussion and development Cc: Roger Heflin , Zdenek Kabelac Errors-To: linux-lvm-bounces@redhat.com Sender: "linux-lvm" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: gmail.com Content-Type: multipart/mixed; boundary="===============0467467529010093579==" --===============0467467529010093579== Content-Type: multipart/alternative; boundary="----U9REFNE11PUVPXHGU3AQPPHZNXJXM9" ------U9REFNE11PUVPXHGU3AQPPHZNXJXM9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 "but shouldn't we perhaps leave it up to the end user / owner of the hardware,=C2=A0 to decide when it's ready for the recycle bin ?" with hard drives (forget SSDs, they are hardware accelerators absolutely un= affordable for data storing) it is not the user/owner that decide it , unle= ss he doesn't want to suicide his data is the SMART system that tells you that one first reallocation happen Sectors reallocation are not allowed Those few 100 or 250 sectors are just for the SMART system As soon just one reallocation happen, it is time to waste the drive Like with car tyres, when you reach the marker , it is time to waste them, = but if you run too few kilometers per year, after few years the gum got dri= ed and you create a risk for yourself and the others if you don waste them This comparison applies to hard drives If the weekly SMART test tells you that a drive is in pre-failure (just rea= llocations happen, few mean 3 - 4 - 5) you have been warned: it is time to waste "the tyre" You don't do that, you was warned Il giorno 12 apr 2023, 14:37, alle ore 14:37, Roland ha sc= ritto: >>Reall silly plan=C2=A0 - been there years back in time when drives were F= AR >more expensive with the price per GiB. > >Todays - just throw bad drive to recycle bin - it's not worth to do >this silliness. > >ok, i understand your point of view. and thank you for the input. > >but this applies to a world with endless ressources and when people can >afford the new hardware. > >i think, with the same logic, you can designate some guy to be silly , >if he puts a patch on his bicycle inner tube instead >of buying a new one, as they are cheap. with the patch, the tube is >always worse then a new one. and he probably risks >his own health, because of using a tube which may already have gotten >porous... > >but shouldn't we perhaps leave it up to the end user / owner of the >hardware,=C2=A0 to decide when it's ready for the recycle bin ? > >or should we perhaps wait for the next harddrive supply crisis (like in >2011)?=C2=A0 then people start to get more creative in using >what they have, because they have no other option... > > > whenever you want to create new arrangement for you disk with 'bad' >areas, > >you can always start from 'scratch' - since afterall - lvm2 ONLY >manipulates with metadata within disk front - > >so if you need to create new 'holes', > >just=C2=A0=C2=A0 'pvcreate -f', vgcreate,=C2=A0=C2=A0 and 'lvcreate -Zn = -Wn' >>and then=C2=A0 'lvextend'=C2=A0 with normal=C2=A0 or=C2=A0 'lvextend --ty= pe error | --type >zero' segment types around bad areas with specific size. > >Once you are finished and your LV precisely matches your 'previous'=C2= =A0 >LV of you past VG - you can start to use this LV again with > >new arrangement of=C2=A0 'broken zeroed/errored' areas. > >yes, i have already come to the conclusion, that it's always better to >start from scratch like this. i dismissed the idea of >excluding or relocating bad sectors. > > > But good advice from me - whenever=C2=A0 'smartctl' starts to show >relocation block errors - it's the right moment to=C2=A0 'dd_rescue' > > any LV to your new drive... > >yes, i'm totally aware that we walk on very thin ice here. > >but i'd really like to collect some real world data/information on how >good such disk "recycling" can probably work.=C2=A0 i don't have >any pointers for such and did not find any information, on "how fast a >bad disk gets worse,=C2=A0 if it has irretrievable bad sectors >and smart is reporting relocation errors. there seems not much >information around for this... > >i guess such "broken" disks being used with zfs in a redundant setup, >they could probable still serve a purpose. maybe not >for production data, but probably good enough for "not so important" >application. > >it's a little bit academic project. for my own fun. i like to fiddle >with disks, lvm, zfs and that stuff.... > >roland > >Am 12.04.23 um 12:20 schrieb Zdenek Kabelac: >> Dne 09. 04. 23 v 20:21 Roland napsal(a): >>>> Well, if the LV is being used for anything real, then I don't know >of >>>> anything where you could remove a block in the middle and still >have a >>>> working fs.=C2=A0=C2=A0 You can only reduce fs'es (the ones that you c= an >reduce) >>> >>> my plan is to scan a disk for usable sectors and map the logical >volume >>> around the broken sectors. >>> >>> whenever more sectors get broken, i'd like to remove the broken ones >>> to have >>> a usable lv without broken sectors. >>> >> >> Reall silly plan=C2=A0 - been there years back in time when drives were >FAR >> more expensive with the price per GiB. >> >> Todays - just throw bad drive to recycle bin - it's not worth to do >> this silliness. >> >> HDD bad sectors are spreading - and slowly the surface gets >destroyed.... >> >> So if you make large 'head-room' around bad disk areas - if they are >> concentrated on some disk area - and you know topology of you disk >drive >> like i.e. 1% free disk space before and after bad area - you could >> possibly use disk for a little while more - but only to store >> invaluable data.... >> >> >>> since you need to rebuild your data anyway for that disk, you can >also >>> recreate the whole logical volume. >>> >>> my question and my project is a little bit academic. i'd simply want >>> to try >>> out how much use you can have from some dead disks which are trash >>> otherwise... >> >> You could always take=C2=A0 'vgcfgbackup'=C2=A0 of lvm2 metadata and mak= e some >> crazy transition of if with even=C2=A0 AWK/python/perl=C2=A0=C2=A0 -=C2= =A0 but we really >> tend to support >> just some useful features - as there is already=C2=A0 'too much' and use= rs >> are getting often lost. >> >> One very simply & naive implementation could be going alonge this >path - >> >> whenever you want to create new arrangement for you disk with 'bad' >> areas, >> you can always start from 'scratch' - since afterall - lvm2 ONLY >> manipulates with metadata within disk front - so if you need to >create >> new 'holes', >> just=C2=A0=C2=A0 'pvcreate -f', vgcreate,=C2=A0=C2=A0 and 'lvcreate -Zn = -Wn' >> and then=C2=A0 'lvextend'=C2=A0 with normal=C2=A0 or=C2=A0 'lvextend --t= ype error | >--type >> zero' segment types around bad areas with specific size. >> Once you are finished and your LV precisely matches your 'previous'=C2= =A0 >> LV of you past VG - you can start to use this LV again with new >> arrangement of=C2=A0 'broken zeroed/errored' areas. >> >> I've some serious doubts about usability of this with any filesystem >> :) but if you think this has some added value - fell free to use. >> If the drive you play with would be 'discardable' (SSD/NVMe) then one >> must take extra care there is no 'discard/TRIM' anywhere in the >> process - as that would lose all data irrecoverably.... >> >> But good advice from me - whenever=C2=A0 'smartctl' starts to show >> relocation block errors - it's the right moment to=C2=A0 'dd_rescue' any >LV >> to your new drive... >>> >>> yes, pvmove is the other approach for that. >>> >>> but will pvmove continue/finish by all means when moving extents >>> located on a >>> bad sector ? >> >> pvmove=C2=A0 CANNOT be used with bad drives - it cannot deal with errori= ng >> sectors and basically gets stuck there trying to mirror unrecoverable >> disk areas... >> >> Regards >> >> Zdenek >> >> >> > >_______________________________________________ >linux-lvm mailing list >linux-lvm@redhat.com >https://listman.redhat.com/mailman/listinfo/linux-lvm >read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/ ------U9REFNE11PUVPXHGU3AQPPHZNXJXM9 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
"but shouldn= 't we perhaps leave it up to the end user / owner of the
hardware,=C2=A0 to decide when it's ready for the recycle= bin ?"

with hard drives (forget SSDs, they are hardware accelera= tors absolutely unaffordable for data storing) it is not the user/owner tha= t decide it , unless he doesn't want to suicide his data

is the SMART system that tells you that one first realloc= ation happen

Sectors reallocation are not allowed

Those few 100 or 250 sectors are just for the SMART syste= m

As soon just one reallocation happen, it is time to waste= the drive

Like with car tyres, when you reach the marker , it is ti= me to waste them, but if you run too few kilometers per year, after few yea= rs the gum got dried and you create a risk for yourself and the others if y= ou don waste them

This comparison applies to hard drives

If the weekly SMART test tells you that a drive is in pre= -failure (just reallocations happen, few mean 3 - 4 - 5) you have been warn= ed:

it is time to waste "the tyre"

You don't do that, you was warned

Il giorno 12 apr 2023, alle ore 14:37, Roland &= lt;devzero@web.de&g= t; ha scritto:
Reall si= lly plan  - been there years back in time when drives were FAR
more expensive with the price per GiB.
Todays - just throw bad drive to recycle bin - it's = not worth to do
this silliness.

ok, i understand you= r point of view. and thank you for the input.

but this applies to a = world with endless ressources and when people can
afford the new hardwar= e.

i think, with the same logic, you can designate some guy to be si= lly ,
if he puts a patch on his bicycle inner tube instead
of buying = a new one, as they are cheap. with the patch, the tube is
always worse t= hen a new one. and he probably risks
his own health, because of using a = tube which may already have gotten
porous...

but shouldn't we per= haps leave it up to the end user / owner of the
hardware,  to decid= e when it's ready for the recycle bin ?

or should we perhaps wait fo= r the next harddrive supply crisis (like in
2011)?  then people sta= rt to get more creative in using
what they have, because they have no ot= her option...

whenev= er you want to create new arrangement for you disk with 'bad'
areas,
you can always = start from 'scratch' - since afterall - lvm2 ONLY
manipulat= es with metadata within disk front -
so if you need to create new 'holes',
just   'pvcr= eate -f', vgcreate,   and 'lvcreate -Zn -Wn'
and then  'l= vextend'  with normal  or  'lvextend --type error | --type
zero' segment types around bad areas with specific size.
=
Once you are finished and yo= ur LV precisely matches your 'previous' 
LV of you pas= t VG - you can start to use this LV again with
new arrangement of  'broken zeroed/errored' area= s.

yes, i have already come to the conclusion, that it'= s always better to
start from scratch like this. i dismissed the idea of=
excluding or relocating bad sectors.

But good advice from me - whenever  'smartctl' st= arts to show
relocation block errors - it's the right momen= t to  'dd_rescue'
a= ny LV to your new drive...

yes, i'm totally aware that = we walk on very thin ice here.

but i'd really like to collect some r= eal world data/information on how
good such disk "recycling" can probabl= y work.  i don't have
any pointers for such and did not find any in= formation, on "how fast a
bad disk gets worse,  if it has irretriev= able bad sectors
and smart is reporting relocation errors. there seems n= ot much
information around for this...

i guess such "broken" disk= s being used with zfs in a redundant setup,
they could probable still se= rve a purpose. maybe not
for production data, but probably good enough f= or "not so important"
application.

it's a little bit academic pro= ject. for my own fun. i like to fiddle
with disks, lvm, zfs and that stu= ff....

roland

Am 12.04.23 um 12:20 schrieb Zdenek Kabelac:
Dne 09. 04. 23 v 20:21 Rol= and napsal(a):
Well, if the LV is being used for any= thing real, then I don't know of
anything where you could remove a bloc= k in the middle and still have a
working fs.   You can only r= educe fs'es (the ones that you can reduce)

my plan is = to scan a disk for usable sectors and map the logical volume
around the= broken sectors.

whenever more sectors get broken, i'd like to remo= ve the broken ones
to have
a usable lv without broken sectors.

Reall silly plan  - been there years back in time whe= n drives were FAR
more expensive with the price per GiB.

Todays= - just throw bad drive to recycle bin - it's not worth to do
this sill= iness.

HDD bad sectors are spreading - and slowly the surface gets = destroyed....

So if you make large 'head-room' around bad disk area= s - if they are
concentrated on some disk area - and you know topology = of you disk drive
like i.e. 1% free disk space before and after bad are= a - you could
possibly use disk for a little while more - but only to s= tore
invaluable data....


since you need to rebuild your data anyway for that disk, you = can also
recreate the whole logical volume.

my question and my = project is a little bit academic. i'd simply want
to try
out how mu= ch use you can have from some dead disks which are trash
otherwise...

You could always take  'vgcfgbackup'  of lvm2= metadata and make some
crazy transition of if with even  AWK/pyth= on/perl   -  but we really
tend to support
just some= useful features - as there is already  'too much' and users
are g= etting often lost.

One very simply & naive implementation could= be going alonge this path -

whenever you want to create new arrang= ement for you disk with 'bad'
areas,
you can always start from 'scr= atch' - since afterall - lvm2 ONLY
manipulates with metadata within dis= k front - so if you need to create
new 'holes',
just   'p= vcreate -f', vgcreate,   and 'lvcreate -Zn -Wn'
and then = ; 'lvextend'  with normal  or  'lvextend --type error | --ty= pe
zero' segment types around bad areas with specific size.
Once yo= u are finished and your LV precisely matches your 'previous' 
LV o= f you past VG - you can start to use this LV again with new
arrangement= of  'broken zeroed/errored' areas.

I've some serious doubts a= bout usability of this with any filesystem
:) but if you think this has= some added value - fell free to use.
If the drive you play with would = be 'discardable' (SSD/NVMe) then one
must take extra care there is no '= discard/TRIM' anywhere in the
process - as that would lose all data irr= ecoverably....

But good advice from me - whenever  'smartctl' = starts to show
relocation block errors - it's the right moment to = 'dd_rescue' any LV
to your new drive...

yes, pvmove is the other approach for that.
but will pvmove continue/finish by all means when moving extents
loca= ted on a
bad sector ?

pvmove  CANNOT be used = with bad drives - it cannot deal with erroring
sectors and basically ge= ts stuck there trying to mirror unrecoverable
disk areas...

Reg= ards

Zdenek






linux-lvm mailing l= ist
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm=
read the LVM HOW-TO at = http://tldp.org/HOWTO/LVM-HOWTO/
------U9REFNE11PUVPXHGU3AQPPHZNXJXM9-- --===============0467467529010093579== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-lvm mailing list linux-lvm@redhat.com https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/ --===============0467467529010093579==--