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 12:25:22 +0100	[thread overview]
Message-ID: <a0feed8f-0582-445a-9244-75e61caa2ff8@gmail.com> (raw)
In-Reply-To: <a5e7c616-70d5-4108-a963-b298ce317163@app.fastmail.com>

Dne 14. 03. 25 v 2:30 Patrick Hemmer napsal(a):
> On Thu, Mar 13, 2025, at 20:27, Zdenek Kabelac wrote:
>> Dne 14. 03. 25 v 1:17 Patrick Hemmer napsal(a):

> I'm describing exactly what I want. To convert a thin striped volume to linear.

Hi

Unfortunately you were using misleading terms but we are almost getting to the 
right point  -  as you were like talking  about volume named  'thin_tdata' 
which was striped LV and now is raid5 LV - but it's not 'thin' volume.

You want to preserve thin-pool functionality, you just want to relocate _tdata 
to the new drive and drop 'striped' functionality out of it.

ATM your thin_tdata volume is already raid5_n and conversion to 'raid1'  type 
is not supported ATM as lvm2 rejects this conversion for stacked LV.

So for quickest results I'd recommend these steps:
(Assuming you are 'brave enough to make them)

- Extend your 'ssd' VG with your new drive

- Create new LV (in the same VG) on new storage with the size matching _tdata 
volume size.
   # lvs -a --units b
   # lvcreate  -Lsamesizesize --name new_data_lv ssd  /dev/newpv

- Do an 'component' activation of _tdata - for this whole thin-pool and all 
it's thin volumes must be inactivate.

   # lvchange -ay ssd/thin_tdata
  This will activate volume in read-only mode.

- Then do a  'dd' copy of this _tdata volume to new destination.
   # dd   /dev/ssd/thin_tdata  ->  /dev/ssd/new_data_lv

Now 'tricky' part:

- Take a 'vgcfgbackup -f backup ssd' of current VG

- After all data have been copied make sure LVs are INACTIVE
   lvchange -an ssd/....  or simply  vgchange -an ssd

- Edit 'ascii' metadata format in your text editor - i.e.: 'vim  backup'
   look for section with LV name "thin_tdata"
   Rename this LV to some other unused name i.e. "thin_Xdata".

   Than look for the LV section with newly created LV and rename
   this LV to the name:  "thin_tdata"

   write lvm2 metadata and exit editor

- Now restore lvm2 metadata with 'vgcfgrestore --force -f backup ssd'

- check with  'lvs -ao+seg_pe_ranges'  that are all desired changes are in effect

- you now should be able to activate pool and use data from new location.

- lvremove now unused  thin_Xdata volume - evetually you should be able to 
vgremove unused  PVs from 'ssd' VG.

- You may apply similar workflow to _tmeta  - although there should work pvmove.

Regards

Zdenek

PS: Let me know if find some step unclear - it's better to ask instead of 
causing data lose.

PPS: - yeah we will need to figure out how to enable this missing workflow 
within the lvm2 - so the user does not need to do above step in such manual way.


  parent reply	other threads:[~2025-03-14 11:25 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
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 [this message]
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=a0feed8f-0582-445a-9244-75e61caa2ff8@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).