My install had the /home folder inside /. I wanted to add a separate /home partition, so I created a small backup partition on a different drive, added it to /etc/fstab, and used rsync
with -aXS
to move my old /home folder to this new partition. I then did a fresh install with a /home partition. Now I would like to move my files back from the old /home folder into the new /home directory. What is the best way to do this?
What I tried: sudo rsync -aXS /home_backup/. /new_home_partition/.
as per this guide
This copied the old /home folder itself into the /home partition (i.e. it created /home/home), which is not what I wanted. I figured I could run the same command, but on the subfolders within the backup folder rather than on the folder itself. Is this the best way to go about it?
I saw this similar question, but as I understand it, cp
will not preserve information like permissions and links. I also saw this question, but I don't know how to work with tarballs (and I'm not positive the OP's situation is the same). Any help would be appreciated, as I'm by no means an expert!
P.S. What is the best command to remove all files from the fresh /home partition before copying the backup files into it?
Edit: Looks like I was able to resolve this, but I still don't know what happened (added a comment below).