1

Is it possible to reinstall Fedora (I have the DVD that I used to install it yesterday), and keep the files in my home directory?

I seem to have messed up my system while trying to get my monitor resolution to work correctly: Installed Fedora in dual boot Windows desktop. Now I can't get full monitor resolution with my AMD Radeon HD 6450

The step that caused my problem was yum --enablerepo=rawhide upgrade kernel xorg-x11-drv-ati xorg-x11-drv-ati-firmware, so I'm looking to either figure out how to get fedora to boot, or just reinstall fedora, but keep the files I've set up so far.

jonderry
  • 2,089
  • 1
    What I do is separate /home dir from the rest of the system via partitioning. That way, I can mess around with my installation as much as I want, knowing if something goes wrong, it's a simple matter of a reinstall. – tshepang Mar 08 '11 at 23:15
  • 1
    Why not just copy the files somewhere and reinstall? Is it too much work? – tshepang Mar 08 '11 at 23:16
  • Debian actually allows installation over an existing OS (i.e. doesn't format the drive). It's not recommended, and I've never tried it. I can't check now if Fedora does. – tshepang Mar 09 '11 at 05:22

1 Answers1

2

Yeah sorry about that. :)

It is possible, but is only easy if you made /home be a separate partition. Despite my best efforts, this isn't the default.

You don't have a lot of files yet, though, do you? I think the best bet is to boot into single user mode and copy the contents to a USB memory stick. That should be easy.

You'll need to mount it manually -- plug it in, wait a few seconds, and then type dmesg and note the device that it says was inserted. Then, mount that with:

mount /dev/sdc /mnt

replacing sdc with whatever dmesg said. (You may need sdc1, depending on how the device was formated).

Then, change to the root directory (cd /) and run

tar cJvf /mnt/mattdm-is-sorry.tar.xz /home

and when that completes, run

sync; sleep 3; umount /mnt

(The sleep is for superstition.)

The reason for tar rather than just copying is to preserve the Unix metadata, because the USB drive will be FAT formatted, and we don't want to mess with that right now.

Then, once you have your system repaired (I still recommend the F15 alpha!), you can extract it with tar xf /mnt/mattdm-is-sorry.tar.xz. If you do that in / as root, it'll overwrite everything in your new /home, so probably the best thing to do is boot the new system into single user mode and do that first thing.


Oh, and this time, while you're installing, make /home its own partition. :)

mattdm
  • 40,245
  • ok, trying to do this now. I just scp'ed to my laptop. I tried installing 15, but it threw an error during installation and failed, so I'm going with 14. How do I make sure /home/ is on it's own partition? – jonderry Mar 09 '11 at 00:58
  • @jonderry — can you report the Fedora 15 install error at http://bugzilla.redhat.com/ so we can get it fixed? – mattdm Mar 09 '11 at 01:11
  • @jonderry — to put /home on its own partition, follow instructions here: http://docs.fedoraproject.org/en-US/Fedora/14/html/Installation_Guide/s1-diskpartitioning-x86.html, and if that's not clear, ask a new question. :) – mattdm Mar 09 '11 at 01:11
  • I reported it a little while ago. – jonderry Mar 09 '11 at 01:14
  • Added the following question: http://unix.stackexchange.com/questions/8887/how-do-i-create-a-separate-partition-for-my-home-directory – jonderry Mar 09 '11 at 01:37