partitions to lvm2 without losing data and reverse order
I want to go from partitions to LVM2 without losing my data and want to know how to go back without using a separate drive to backup my data on because I do not have that. I have one drive that is 320 gigabytes, so if I want to keep my data such as music and pictures, how do I install FC6 with LVM2 without losing my data? Currently I am using Debian Etch Testing with separate /home and / partitions.
fdisk -l Code:
debian:~# fdisk -l Code:
debian:~# df -h |
There is no way to "convert" an existing hard partition to LVM, nor to "convert" an LVM logical volume to a hard partition. The only way is to copy data. You need free space to copy the data to temporarily during the process. Either an external drive or just free space on your current drive. You could also copy data by burning it DVD's.
You could do a single disk "conversion" with your current setup. You're currently using 92Gb of /home and you have 100Gb free on /. Make a new directory under / named home_tmp, then copy all of /home to this new directory (which is on a different partition than /home). Then you can wipe out /home and recreate it - empty - using LVM. Then copy /home_tmp back to the new LVM-based /home and delete /home_tmp. Now you can install FC6 from scratch using LVM on that old / partition. That original / partition would become a LVM "physical volume", to be added to a "volume group", then divided back up into "logical volumes". You can add it to the same volume group that you used for your /home in the previous step. If you ever want to go back to hard partitions and stop using LVM, you will have to do more moving/copying of data. There is no "conversion" available. Personally, I would not want to do any of the above without first backing up my important data to offline storage (an external disk or a bunch of DVD's). But it sounds like that's exactly what you want to do. Not recommended, but it's your call. |
Side issue, sorry to butt in.
haertig, what happens if you take an LVM disk out and put it in another (non-LVM) system ???. What about a disk that is dedicated (entirely) as a PV - I believe the partition table is modified in that case. True ???. Does the new system see it as a broken disk ???. |
Quote:
Quote:
Quote:
|
Quote:
Quote:
Now I'm thinking about something I never thought of. It seems that I have to have hard partitions to use LVM. Those hard partitions are are Physical Volumes used to be added to a Volume Group, so really LVM is done on top of hard partitions, not as a replacement for them, right or wrong? Quote:
Quote:
|
I am not familiar with this "Disk Druid". I assume it must be the partitioning part of Fedora's installer. I seem to remember reading that somewhere. I also seem to remember reading that newer versions of Fedora use LVM by default.
I don't know if you "must" use Disk Druid. That question might be better asked on the LQ.org->Fedora forum. I would think that Fedora would allow you to partition things manually first, before starting the Fedora install, and then have Fedora's installer work with your existing partitions. That's only a guess, I don't know Fedora's installer. I'm not sure that it really matters if you use Disk Druid or not, so long as whatever you do you do not let the installation partitioner/formatter touch your existing LVM partition (physical volume). I would stay far far away from anything that says "automatic disk configuration" or "default installation" or anything like that. Go for "manual". I would certainly assume that Disk Druid would have manual partitioning available as an option. Quote:
Quote:
Also, the best laid plans of mice and men sometimes go wrong. So even if you tell the installer to leave your /home alone, you might have messed up your command or run into a bug in the installer. I'll never concede an argument and say, "You're right, you DON'T need to backup". Without backups, you always procede at your own risk. "Others have done it without losing data" may be true, but that means nothing to me. But if it's good enough for you, it's your computer and your data. I won't argue ... I just don't agree with your choice. Also, what happens if you successfully transfer your data without loss, and then you have a power surge and your disk frys the next week. You'll probably be wishing you had backups. :twocents: |
Before installing and while preparing, I will create a partition but not format it with a filesystem. I think I saw something in the Fedora installer "create a LVM physical volume", and I wondered if it was the same or different as creating a partition, and not formatting it with a filesystem. Last night I just installed the package from the Debian Etch Testing repositories, lvm2. I plan on reading the man pages and studying lvm at www.tldp.org more before I do it on my own. I've also reorganized my backup, deleted files that I didn't need, and created the home-tmp, then moved it to /. I also burned the FC6 iso, booted it, and played around with the partitioner without saving any changes. Daylight savings time meant an hour extra of Linux for me ;)
Quote:
Quote:
Quote:
Quote:
Quote:
|
All times are GMT -5. The time now is 09:00 PM. |