-   Linux - Newbie (
-   -   Is it possible to reinstall or upgrade linux without losing data?? (

cyber.scientist 04-22-2009 06:30 PM

Is it possible to reinstall or upgrade linux without losing data??
hi all
there are similar questions to this in here but non is quite clear about this.
so the question is is it possible to upgrade or reinstall linux with out losing data?
if yes how would you go about doing so?(please use baby steps I'm new)

would this work with lvm or lvm2 partitioning?

Thank you all in advance.

billymayday 04-22-2009 06:50 PM

What distro are you using?

cyber.scientist 04-22-2009 06:57 PM

im using fedora core 9.

but is there a general/ non distro specific answer?

billymayday 04-22-2009 07:16 PM

Not really.

I hear mixed stories about upgrading Fedora. As a matter of course, I would always take a backup first in case something goes wrong. One way to avoid this in the future can be to have a separate /home partition that you don't touch during the upgrade and that you simply remount post installation (or as part of the installation process).

I generally find LVMs more trouble than they are worth, and wouldn't use one unless I needed to add extra capacity to an existing volume.

What do you have available for backups? A USB HDD is a good solution.

Sorry if that isn't quite what you wanted to hear, but that's my take.

cyber.scientist 04-22-2009 07:23 PM

yeah LVM an be very annoying for simple or newbies users like me.
but its the default installation.
now the problem is that i cant mount the LVM (the problematic one) using Konnpix for some reason. ( I can mount other LVM partitions strangely enough. so i can not back up my data.

billymayday 04-22-2009 07:24 PM

Try a live CD of Fedora if you can't boot the existing copy

cyber.scientist 04-22-2009 07:36 PM

sorry i cant see how would that help?
sorry newbie here

jschiwal 04-22-2009 07:38 PM

If you only have one HD in your computer using LVM doesn't gain you much, if anything. It would be easier for you to use regular partitions. It can be a bit of work to get the partitions in the logical volume recognised by the kernel when running from a rescue disk or live distro.

For your general question, it is common to have a /home partition (rather than just a directory). This would allow you to even install a different distro (fresh install) but not reformat the /home partition. I would rename your home directory and then copy the data you want from your old home directory to the new one. For example, if your username is cybers, then rename /home/cybers to /home/cybers-old before reinstalling. This will leave two directories in /home/, /home/cyber & /home/cyber-old. If you are changing distro's you may find that your users UID is different. Some start at 500 and others start at 1000. Using chown as root, you can fix that easily.

The /home partition could be a partition on an LVM volume. It doesn't have to be a separate partition on the disk. A new distro would need to use an installer that can LVM volumes.

billymayday 04-22-2009 07:40 PM

A Fedora alive CD should be able to read its own LVM. It may be a more modern version that the other LVMs you can mount from Knoppix

jschiwal 04-22-2009 07:47 PM


Originally Posted by cyber.scientist (Post 3517750)
sorry i cant see how would that help?
sorry newbie here

Missed your last message. If the version of the filesystem is different, maybe the kernel that knoppix uses can't work with the version that Fedora used.

There are commands like lvscan & vgscan that might help.

The command "/sbin/vgmknodes" may create the device nodes for the logical volumes. This step may be needed if you boot up from a live distro.

You get the picture why lvm2 adds complication. If you are a newbie and don't have a multidisk logical volume, I'd recommend reinstalling instead of upgrading, and use regular partition. Create a separate /home partition. Later if you want to try a different distro, you can preserve the /home partition easily. In other words, backup and restore your data this one time. Next time you can keep your old /home partition.

cyber.scientist 04-22-2009 07:58 PM

thanks a lot guys. you guys have been very helpful.

now i need to find out how to back up 200 gb of data.
but i will need to change the partitions to ext3 and make a home partition for my data.

how do you make the home partition during installation wizard?

billymayday 04-22-2009 08:04 PM

Totally from memory here, so interpret as such:

When you get to the partitioning step, you will be give nthe option to accept the default partitioning scheme or manually partition. Choose the manual option, and the instructions should be reasonably clear.

If you aren't using LVM, you should get away with an ext3 / partition and an ext3 /home partition, but you may as well set aside a swap (say 1-2 times your physical memory in size).

Good luck.

cyber.scientist 04-22-2009 08:31 PM

Just one last question is it possible to resize LVM partitions from the Live?
so that i can create ext3partition. And then move my data to new partition and label it /home. and then format the rest of hard drive as ext3 and install fc10 on it.

hope that was clear.

chrism01 04-23-2009 09:35 PM

Try this

jschiwal 04-24-2009 08:04 PM

If you can shrink the lvm partition, label the new partition something else like /home-new. Then you can have /home mounted and /home-new mounted. After copying the data, check that it looks OK in /home-new before deleting the files in /home. Use "cp -a". This selects recursion, preserves links and copies the permissions & timestamps. Make sure that the hidden files are copied as well. If you copy your home directory from /home, they should be.

For the swap partition. Just a little over 1 X memory should be fine if you have over 1GB. You need a swap partition as large as memory for suspending to disk to work. ( This is the resume=<device> you see on the grub line )

If you stick with LVM, then you want a separate /boot partition.

All times are GMT -5. The time now is 07:02 PM.