-5

I have an old box(CentOS 5) that was formatted as lvm but now I want to convert it to ext3/4 file system without losing data. I have some empty disks that can be used, so is there an easy way to do this?

Mickey Shine
  • 929
  • 4
  • 16
  • 33
  • 3
    You might need to rethink what you want to do and why. You seem to confuse block devices and filesystems. – dawud Aug 16 '13 at 07:11
  • @ Mickey Shine, I found your question 100% valid, please see the following link to walk you through all the steps in case still interested: https://sites.google.com/site/ghidit/how-to-2/migrate-from-lvm-to-partitions – Matt Dec 06 '17 at 03:47

2 Answers2

5

LVM is a disk/partition management tool as far as I know, not a file system. Without wishing to sound rude, if you're unsure of basics like that and you don't want to lose data I'd strongly suggest getting help.

Regardless of what file system you've currently got in place, if you need to change it to something else the only properly safe way to do this without losing data is to back the data up, reformat and then restore the data. Any reputable file system format converter tools will tell you to back your data up first "just in case", so you're not really gaining anything by trying to avoid that method, except possibly saving some time if the volume is very very large.

Rob Moir
  • 31,664
  • 6
  • 58
  • 86
  • Am I missing something or is this not exactly what the OP asked? How to do it? You do come across as rude and arrogant with your assumptions OP never made. He asked how he can transfer his data from an lvm volume to a non lvm partition formatted file system and then remove lvm. What is it with some of you linux diehards that you seem to know every intention and bias some less knowledgeable linux users may or may not have? Nobody answered his question yet it was heavily down voted. I am a top ranked member in the quant stack exchange forum but this forum rakes of self righteous apostles...sad – Matt Dec 06 '17 at 03:40
  • @MattWolf thank you for reviving a 4 year old answer with a comment that should probably be on the site meta. LVM is a system for managing file partitions. ext3 is a file partition. You're presumably not a IT person or you'd probably have realised why I answered as I did, and why my answer was allowed to stand (and upvoted) by others. If you're still unsure what I mean: Imagine a question on a cooking stack exchange asking how to convert a bread tin into a loaf of bread. That's the best analogy I can think of for this question's flaws, and why it wasn't answered directly in either answer. – Rob Moir Dec 07 '17 at 10:44
  • And if that sounds "rude and arrogant" then I apologise. I was simply concerned that the OP not lose all their data by meddling with things they don't appear to understand. – Rob Moir Dec 07 '17 at 10:45
  • correct I am not an IT person, but in what way would that disqualify to meaningfully participate? I am the 3rd highest ranked user on the Quant Finance forum, I coded for many years in C, C++, C#, Python,I architected and helped implementing entire trading architectures from the ground up. I do not care about titles or certificates but knowledge. Admittedly, the word choices by OP were poor but as you are a self professed IT "specialist" you should have seen through that instead of making snarky comments. The question was clear, the answers here were arrogant and useless. – Matt Dec 08 '17 at 04:07
  • OP asked how he can remove a lvm configured partition structure into a non-lvm one. Simple question if you are capable of seeing the forest despite all the trees. Hopefully my point comes across. Showing off domain knowledge just rubs me the wrong way...especially on a user forum that was designed to help. There were a million better ways to handle this and hundreds other questions by others who may be less knowledgeable than you. – Matt Dec 08 '17 at 04:09
  • Actually Matt, you’re now the one making assumptions about what the OP asked. Have you considered that if three people looked at the question and thought one thing and you looked and thought another thing, that maybe you’re the one in error? ServerFault is aimed at *professional* system admins, and as such, expectations are for clear, well written, unambiguous questions, to avoid problems with production business systems being messed up by half-assed assumptions. OP can (and should, question should now be closed IMO) clarify their question and we would then clarify the answers. – Rob Moir Dec 08 '17 at 06:19
  • You could have pointed that out in a single sentence to OP. I rest my case. – Matt Dec 09 '17 at 08:37
  • It *was* pointed out to the OP, clearly enough, back in 2013. Right now, your comments read a lot like “I’m doubling down on being an asshat because it’s either that or admit I was wrong”. Maybe think and understand before you speak next time? – Rob Moir Dec 09 '17 at 09:36
  • There was no doubling down if you could just atfq next time or stay away from questions that are either over your head or else you feel are below your pay grade. – Matt Dec 10 '17 at 10:36
1

LVM is the magical glue which allows you to merge several hard drives and other storages to a one, easily(* resizeable block device. It's only a block device level thing which ext*/XFS/JFS and other file systems can use for their file system layout. The file systems themselves provide you the file/directory/permission stanza you seem to be thinking.

So no, you cannot convert LVM to be some file system, that would lead to fail system.

Please tell us in a much more detailed way what you are actually trying to do.

Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78
  • 1
    Mmm. Magic Glue. – Tom O'Connor Aug 16 '13 at 09:58
  • Did OP ask for the definition of LVM? And you are incorrect: You can copy data from an lvm logical volume to some free space on a non-lvm partition, remove the logical lvm volumes, remove the entire lvm layer from the physical partition, then create a new file system on any partition, copy back the data that was originally on the lvm volume, make adjustments in fstab to reflect mount changes, and that would exactly answer the question OP had. I admittedly do not have time to walk him through all the detailed steps but the two answers here are self-righteous crap with all due respect. – Matt Dec 06 '17 at 03:44
  • here is a link that walks through all the details: https://sites.google.com/site/ghidit/how-to-2/migrate-from-lvm-to-partitions – Matt Dec 06 '17 at 03:47