Reinstall fedora while keeping /home intact
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Aug 2010
    Location
    Wellington, New Zealand
    Posts
    921

    Reinstall fedora while keeping /home intact

    Hi everyone,

    I think I've found my self in need of a possible reinstall of fedora, and this time I want /home to left completely intact. So to do that would I have to install fedora into a / partition and then symlink my old /home to the /home on the / partition?

    TIA
    "For what is a man profited if he gains the whole world, but loses his own soul?"

    - Jesus

  2. #2
    Join Date
    Apr 2011
    Posts
    133

    Re: Reinstall fedora while keeping /home intact

    When reinstalling, don't let the partitioner do all the work for you. Choose custom layout, or whatever it may be called, and manually specify what each partition should be. On my computer, with one hard-drive (/dev/sda), I have 4 partitions (sda1, sda2, sda3 and sda4). 1 is Fedora 16, 2 is Fedora 17, 3 is home, and 4 is swap. Once Fedora 18 is released, I will do a clean install onto sda1 replacing 16, and so on.

    You will have to format the partition holding root ( e.g., /), but DO NOT format home.

    In order to do this you will need to know what your current setup is. fdisk -l will show you your disks and partitions, and cat /etc/fstab can tell you what file format they are currently using (you'll need to know this so that you choose the right filesystem under 'use as...'.

    If you're just doing a reinstall, choose the same user name. SELinux will relabel everything for you on your first boot. If you're dong an upgrade, I like to choose a new user name and migrate everything over a bit at a time.

    If you've got some crazy setup, where root and home are on the same partition... best to just back it up and create a sane partioning scheme. I like having one root, one spare, one home and a swap. You can use the spare to try other distros, upgrade and test things out before migrating data/settings, or just use it to have a super stable fall back os in case anything goes crazy bad one day.
    Last edited by sillav; 22nd March 2012 at 06:13 AM.

  3. #3
    Join Date
    Aug 2010
    Location
    Wellington, New Zealand
    Posts
    921

    Re: Reinstall fedora while keeping /home intact

    Thanks very much sillav! I forgot to mention that /home is on a separate partition, figured I may as well make it easy for myself So to recap:

    1. Set anaconda to replace / while completely ignoring /home
    2. Once everything's done, I symlink /home partition to /home on the / partition I just reformatted? Or do I symlink /home on the reformatted system to the /home partition?
    "For what is a man profited if he gains the whole world, but loses his own soul?"

    - Jesus

  4. #4
    Join Date
    Oct 2007
    Location
    Freedonia
    Age
    69
    Posts
    3,076

    Re: Reinstall fedora while keeping /home intact

    No. You tell anaconda to use the partition you're currently using for /home but not to format it. That will keep everything on it intact and, if you use the same username you did before, the reinstall is seamless and transparent. I know, because I've done it myself at least once.
    Registered Linux user #470359 and permanently recovered BOFH.

    Any advice in this post is worth exactly what you paid for it.

  5. #5
    stevea Guest

    Re: Reinstall fedora while keeping /home intact

    Quote Originally Posted by sidebrnz
    No. You tell anaconda to use the partition you're currently using for /home but not to format it. That will keep everything on it intact and, if you use the same username you did before, the reinstall is seamless and transparent. I know, because I've done it myself at least once.

    Maybe the installer is smarter then I think, but if you tel it your current root is is /home, then I expect it will create a new /home directory and the existing stuff wilt be in /home/home

    I suggest the OP install the new fedora in a separate / partition and not specify a separate /home - leave the old "/" intact.
    AFTER the system is installed he can either mount and create a symlink as he suggested.
    Perhaps a little better he can use the "mount --bind" option to mount the old /oldroot/home over the new /home dir (even if non-empty).
    I'd personally remove the old /etc /usr /bin ... etc then mv all the /home contents up one directory, Then edit fstab to mount this as /home.

    I hope by F18 that the installer will default to putting "/" and "/home" in distinct subvolumes.

  6. #6
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,345

    Re: Reinstall fedora while keeping /home intact

    A simple fstab entry to mount the home directory is all that is needed.

    That is all I've done for the last 5 years.

  7. #7
    Join Date
    Aug 2009
    Posts
    8,486

    Re: Reinstall fedora while keeping /home intact

    Quote Originally Posted by sidebrnz
    No. You tell anaconda to use the partition you're currently using for /home but not to format it. That will keep everything on it intact and, if you use the same username you did before, the reinstall is seamless and transparent. I know, because I've done it myself at least once.
    Yes, quite seamless.. UNLESS you are going from Fedora 15 or below to Fedora 16 or above.

    The default user numbering changed. In F15 and earlier, the default user numbering started at 500. In F16 and later, it changed to 1000. Upgrades from F15 to F16 retain the 500 number, but fresh installs will change to using 1000.

    So, if you happen to fall into the user numbering change, you will have to go back and change the files on any partition you have kept files created by earlier versions to the new numbering.

  8. #8
    Join Date
    Aug 2010
    Location
    Wellington, New Zealand
    Posts
    921

    Re: Reinstall fedora while keeping /home intact

    Quote Originally Posted by sidebrnz
    No. You tell anaconda to use the partition you're currently using for /home but not to format it. That will keep everything on it intact and, if you use the same username you did before, the reinstall is seamless and transparent. I know, because I've done it myself at least once.
    How do you tell anaconda to use a partition but not format it?? I tried the upgrade option a little while ago and it just reformatted the partitions.

    @stevea, That seems like a good plan. BTW why should I keep my original / partition?

    Thanks everyone for the help
    "For what is a man profited if he gains the whole world, but loses his own soul?"

    - Jesus

  9. #9
    Join Date
    Oct 2007
    Location
    Freedonia
    Age
    69
    Posts
    3,076

    Re: Reinstall fedora while keeping /home intact

    Whenever I've used anaconda I've done a custom partitioning layout. One of the options when you pick an existing partition is not to format it, although it's been long enough that I don't remember exactly how it's phrased.
    Registered Linux user #470359 and permanently recovered BOFH.

    Any advice in this post is worth exactly what you paid for it.

  10. #10
    Join Date
    Apr 2011
    Location
    Rainham, Essex, UK
    Posts
    343

    Wink Re: Reinstall fedora while keeping /home intact

    There are a couple of caveats - in my experience.

    If you are recycling the same /home from version -> version or even distro -> distro it is usually a good idea to do a bit of housecleaning on your ~/.config and other hidden configuration files to prevent "1st boot" configuration conflicts which can be a pig to unravel...

    Boot to a liveCD and remove any extraneous hidden files/folders. You can usually hang onto Mozilla / Chromium profiles and the like although with the best will in the world you can come up against some incompatabilities between version. This has kinda become essential with a gnome-shell setup that makes use of shell-extensions as you can encounter a "sadface loop" on first login when bits of old extension configs are left behind

    Likewise, whilst you can keep your custom ~./bashrc etc is can pay dividends to back it up and only put it back in place once you are back up on a "vanilla" upgrade.

    Fedora installs do provide the facility to "reclaim" ownership of a reused /home automatically but you can also do it manually in event of problems with:

    Code:
    # chown -R <user>:<user> /home/<user>

  11. #11
    Join Date
    Apr 2018
    Location
    USA
    Posts
    21

    Re: Reinstall fedora while keeping /home intact

    Hello. I currently run Manjaro Arch Linux. I would like to install F28 but keep my home folder intact. It does reside on it's own partition. Will I miss anything from the F28 install? I want to do the xfce4 flavor. Thanks, Mike

  12. #12
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,294

    Re: Reinstall fedora while keeping /home intact

    With anaconda, choose custom and then reselect the partitions. Indicate reformat for all except /home. Reformat /boot, / and swap.

    If your system is distributed onto multiple disks, there is an entry at the foot of the "select disks" presentation screen to choose the "boot" drive.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  13. #13
    Join Date
    Apr 2018
    Location
    USA
    Posts
    21

    Re: Reinstall fedora while keeping /home intact

    Thank you. Got it installed. Pretty slick this version. But suspend does not work. I will need to dig around a bit. Mike

  14. #14
    Join Date
    Apr 2018
    Location
    USA
    Posts
    21

    Re: Reinstall fedora while keeping /home intact

    Is it also possible to wipe the boot partition and install the kernel and boot stuff. Leaving /home and / alone?

  15. #15
    Join Date
    Apr 2009
    Location
    central NY, USA
    Posts
    1,120

    Re: Reinstall fedora while keeping /home intact

    For what it's worth, I've managed to save a couple machines whose permissions and Selinux contexts, also some system files had gotten trashed (guilty). I did it by re-installing every package on the machine. As I am a CentOS user and therefore still back on yum, what I did was:

    Code:
    su
    {password}
    yum reinstall \*.\*
    It worked beautifully, at least for my purposes. Perhaps there's a dnf equivalent if interested.
    Change - the only constant.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Reinstall Fedora without losing my /home partition
    By dth4h in forum Installation, Upgrades and Live Media
    Replies: 5
    Last Post: 7th March 2011, 03:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •