LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-04-2017, 08:51 AM   #1
Sol33t303
Member
 
Registered: Jul 2017
Distribution: gentoo
Posts: 115

Rep: Reputation: Disabled
How can I replace /home on one drive with a different /home from another?


I recently had to wipe my SSD and before doing so I backed up my /home partition to another drive (sdc3) and reinstalled fedora on my SSD (sda3). I don't want to change /home to the one on my backup drive because that would mean I would have to deal with HDD speeds when I could be using my SSD. How can I replace /home (on sda3) with /home (on sdc3)? So to make things clear, I don't want to set use the /home on sdc3, I want to use the /home on sda3 but with all the contents of sdc3. I'm not really that new to Linux (have been using it for 10-11 months) but I feel this is sort of a noobish question. Also, previously before the wipe I had my /home on a separate partition but don't any more making replacing it a bit more complicated I would imagine.

Last edited by Sol33t303; 10-04-2017 at 08:54 AM.
 
Old 10-04-2017, 09:01 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
you can use for example the tar command to pack the content of home (on sdc3) and unpack it onto the other drive.
Code:
# use soemthing like this - as root
tar -C sourcedir -cf - . | tar -C destdir -xf -
You may use rsync too (and other tools). But you need to take care about user id (if that changed) and also you may need to check if there was some special settings in /home before.
 
Old 10-04-2017, 09:38 AM   #3
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Rsync is a good solution as pan64 mentioned - works well. If you use the tar method suggested, make sure the ownership on /home is set correctly for your user or you won't be able to log in.
 
Old 10-04-2017, 12:00 PM   #4
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
I would honestly just install the distro with a fresh, empty home for my user, and copy the contents (not the "home/<myuserid>" directory itself ...) of the backed-up home into the new "/home/<myuserid>".

Done this several times in exactly the same circumstances as you describe.

Hope this helps - let us know how you make out !

Cheers.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 04:02 PM
how to create a new partition to replace current /home? parv Fedora 2 02-26-2007 02:24 PM
Put a 2nd kanotix at hdb 3/,-4/home. 1st is at hdb8/,-9/home.#2 is using 1st's /home sleekmason Linux - General 3 12-09-2006 09:21 AM
/home is limited to mb when a 80 GB hard drive is partioned as /home tmick Fedora 3 11-14-2006 03:46 AM
Can Ubuntu replace Debian without loss of /home/ ? OldakQuill Ubuntu 1 10-04-2006 03:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration