linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zdenek.kabelac@gmail.com>
To: Patrick Hemmer <phemmer+lvm@stormcloud9.net>, linux-lvm@lists.linux.dev
Subject: Re: Converting thin stripe volume to linear
Date: Fri, 14 Mar 2025 01:05:43 +0100	[thread overview]
Message-ID: <c6889d49-e07b-4452-bcb9-f800087b9e90@gmail.com> (raw)
In-Reply-To: <a6386aa0-4eba-4a29-b737-aa93aa2232ff@app.fastmail.com>

Dne 14. 03. 25 v 0:14 Patrick Hemmer napsal(a):
> On Thu, Mar 13, 2025, at 14:54, Zdenek Kabelac wrote:
>> Dne 13. 03. 25 v 1:38 Patrick Hemmer napsal(a):
>>> I've got a LVM thin stripe volume across 2 drives that I'm trying to migrate to a new larger single drive (getting rid of the old drives). Following various information on the subject, it seems the procedure here is to first convert from stripe to mirror, and then from mirror to linear. While attempting this, I seem to have hit an issue on the second part of that process, and am not having much luck resolving it.
>>
>> Hi
>>
>> Likely you can convert your nearly full thin-pool with a single thin volume to
>> a linear  LV by just taking  'dd' copy of  if=/dev/thin of=/dev/linear - using
>> direct io option (and this can be actually faster then raid mirroring).
> 
> I assume I need to copy both the tdata and tmeta volumes to their new linear counterparts. Did this, but now I assume I need to do something to get lvm to rescan the new linear thin volume to pick up the logical volumes that are now on it. And also stop LVM from picking them up off the old thin volume. I deactivated the old thin volume, but LVM is still recognizing up all the logical volumes inside it. I could completely delete the old thin volume, but I'd prefer to get the new volume online before doing that.
> 

Hi

Thin volume is using thin pool that is using data & metadata.

Thus thin-pool can remain active even when thin LV is already deactivated, 
depends on the use case - and you can obviously deactivate also your thin-pool.

In your case you need to 'forget' copying thin_tdata or thin_tmeta or even 
thin-pool ssd/thin itself.
Your 'lvs -a'  you've shown unfortunately  lists *ONLY* thin-pool  (ssd/thin)
but not a single thin LV  (with letter 'V' in attributes and using 'ssd/thin' 
as Poll volume)

Once you know which thinLV you want to copy - simply use 'dd' to copy data 
from a thinLV to your new storage.

dd if=/dev/ssd/your_thin_lv of=/dev/new_block_dev bs=1M \
    iflag=direct oflag=direct status=progress...

Your new blockdev/LV must have at least the size of your thin_lv!!!
(thin-pool has 930.59g but thinLV could be possibly much bigger - so be sure 
you know what you are copying and where!

I'd highly recommend to check at least  'man lvmthin'  before you will try to 
follow any googled advice.

Regards

Zdenek


  reply	other threads:[~2025-03-14  0:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13  0:38 Converting thin stripe volume to linear Patrick Hemmer
2025-03-13 18:54 ` Zdenek Kabelac
2025-03-13 23:14   ` Patrick Hemmer
2025-03-14  0:05     ` Zdenek Kabelac [this message]
2025-03-14  0:17       ` Patrick Hemmer
2025-03-14  0:27         ` Zdenek Kabelac
     [not found]           ` <a5e7c616-70d5-4108-a963-b298ce317163@app.fastmail.com>
2025-03-14 11:25             ` Zdenek Kabelac
2025-03-14 11:30           ` Patrick Hemmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6889d49-e07b-4452-bcb9-f800087b9e90@gmail.com \
    --to=zdenek.kabelac@gmail.com \
    --cc=linux-lvm@lists.linux.dev \
    --cc=phemmer+lvm@stormcloud9.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).