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.