Fresh install - retain data
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2008
    Posts
    1,403

    Fresh install - retain data

    Is there a way that I can just make a copy of /home & then paste it into my new install or is there something else I need to do?

    What exactly do I need to do to retain all my data?

    Thanks
    Chilly Willy, Tux's little cousin...

    By its very nature, Windows is a PANE!

  2. #2
    Join Date
    Jan 2013
    Location
    Ventura, CA
    Posts
    427

    Re: Fresh install - retain data

    I believe you just click on "Advanced Partitioning", create and format / and any other partitions you would like and then navigate to the partition that contains your /home. Choose that partition with a /home mount point but DO NOT reformat. Or -- if you like more work -- save your old home partition and then only choose to create your root (which will automatically create a /home directory as well as the other essential Linux directories). Then start up your new system, rename /home something else like "/home.old", find your saved /home partition and find its UUID (sudo blkid /dev/path-to-home-partition. Then open up your fstab (sudo vim /etc/fstab) and create an entry for your saved /home partition -- something like

    "UUID=uuid-of-your-home-partition /home ext4 defaults 1 1" (without quotation marks)

    Restart your system (or enter "sudo mount -a" in terminal) and your old /home partition should be accessible. Eventually you can delete /home.old.
    Last edited by donatom; 3rd March 2018 at 06:14 AM.

  3. #3
    Join Date
    Oct 2010
    Location
    Canberra
    Posts
    3,016

    Re: Fresh install - retain data

    Make a backup of your important data just in case it all goes awry.

    Of course you should make regular backups anyway since drives are not perfectly reliable.

  4. #4
    Join Date
    Jul 2008
    Posts
    1,403

    Re: Fresh install - retain data

    Well here's the thing...
    I got an SSD that I want to put in in place of the current HD. What I would like to do is make a backup of /home to the backup drive (another HD in system),
    & copy it into the /home created by the fresh install. Can it be done that way?
    Chilly Willy, Tux's little cousin...

    By its very nature, Windows is a PANE!

  5. #5
    Join Date
    Dec 2007
    Location
    Australia
    Posts
    1,891

    Re: Fresh install - retain data

    Yes. When the new system is up, mount the disk that holds the /home files and copy them over to the new /home.

  6. #6
    Join Date
    Jul 2008
    Posts
    1,403

    Re: Fresh install - retain data

    GREAT!!!
    Thanks
    Chilly Willy, Tux's little cousin...

    By its very nature, Windows is a PANE!

  7. #7
    Join Date
    Oct 2011
    Posts
    1,897

    Re: Fresh install - retain data

    I recommend using rsync.

    Code:
    $ rsync -av /oldhome /newhome
    It is even possible to move the system to another disk. Of course updating the EFI variables is needed afterwards to make the new disk bootable.

    Code:
    $ rsync -avAX -H --numeric-ids /oldroot /newroot

  8. #8
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,542

    Re: Fresh install - retain data

    One perhaps easy way (for me) is as root, I run
    sudo bldid /sd* #This will tell me about all partitions and I will note on which "/dev/sd?" partition the old /home is located
    Continuing as root (I will use sdb3 as an example if it was /dev/sdb3 ). Note the sd?# after the /dev/sd? for the next step
    sudo su
    cd /mnt
    mkdir sdb3
    # Your number and possibly drive letter will be different, I like to make sdbx the partition onto which the old /home is located
    then run mount as
    sudo mount /dev/sdb3 sdb3
    view sdb3
    ls sdb3 #you should see your original /home

    I then use
    rsync -rav /mnt/sdb3/home /home #copy over everything, including hidden files

    When completed, check your /home to verify that the SSD has all the old /home contents
    if OK
    cd /mnt
    umount sdb3
    rmdir sdb3
    exit # exit sudo


    Your data has been migrated.

    Alternately, if you have an external drive case, put your hard drive into it, plug the external drive cable into the USB port.
    cd to /run/media/yourid/ and you should see all the old drive's partitions.
    Follow the sudo rsync -rav xxxxx /home
    Leslie in Montreal

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

  9. #9
    Join Date
    Nov 2004
    Location
    MT USA
    Posts
    951

    Re: Fresh install - retain data

    As above, I periodically rsync my /home folders to my server... and just before a reinstall. That way if something bad happens, install new drive, install OS, and then restore the /home folder when ready. That said, instead of a server like I use, an external HD would work as well.

    On most of other systems I have two drives, one the /home, and the other the OS. That way you can also re-install to your hearts content, and then when ready mount the /home to the second drive. Sometimes there is a user id, group id mismatch, but easily cleaned up.

    Of course most files are the external server, but things like email and browser setting are still in the /home/<user> directories. Nice to just restore and back in business.

  10. #10
    Join Date
    Jul 2008
    Posts
    1,403

    Re: Fresh install - retain data

    I'm using the copy & paste method because I'm going from Gnome to KDE & figure I'll need to redo my apps anyway. - starting from scratch on everything.
    One question that DOES haunt me is... what would happen if I were to copy back ALL those files / folders? Would they work or would I just have a bunch of "garbage"?
    I was planning on just copying things like pictures, videos, docs, etc. But if the other stuff would work, it'd save me a bit...

    Bad thing is, there are a lot of apps I no longer want/need. So I need to eliminate them, one way or another.
    So, I'm seeing I'd probably be better off just to copy over what I need, instead of all.

    Thanks
    Last edited by Chilly Willy; 12th March 2018 at 05:03 AM.
    Chilly Willy, Tux's little cousin...

    By its very nature, Windows is a PANE!

Similar Threads

  1. How to retain metadata
    By tech291083 in forum Wibble
    Replies: 1
    Last Post: 1st March 2018, 01:47 PM
  2. Beesu through NX does not retain password timeout
    By empire in forum Using Fedora
    Replies: 1
    Last Post: 1st December 2009, 08:26 PM
  3. How to retain a specific kernel ?
    By mrechte in forum Using Fedora
    Replies: 15
    Last Post: 20th February 2009, 01:26 AM
  4. HowTo: Retain Anonymity Online in FC6
    By c_07 in forum Security and Privacy
    Replies: 21
    Last Post: 24th May 2007, 07:02 PM
  5. need yum / yum.conf modification to retain kernels
    By dehavik in forum Using Fedora
    Replies: 6
    Last Post: 6th May 2006, 05:20 PM

Posting Permissions

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