So, basically i reinstalled ubuntu 20.04 on SSD and now all the root swap and home partitions are on SSD itself. While doing that I did not format the old /home partition so all the old /home folder and its files are still there on HDD. What I want to do is to restore all the files from the old /home folder to the new /home folder on SSD. How do i do that. Will simply copying work?
-
One easy way to do this is during install. Not only should you do what you did and skip formatting the old home partition, you can mark it as the mount point for home. This way it works like you intend. If you just installed and haven't done much else, I would just reinstall and mount home as home.– user1794469Commented Jun 8, 2020 at 4:25
-
The thing is, old folder was on HDD and i have an SSD now on which the new /home partition is. If there is a way to migrate old to new folder that would be great.– Mukul AnandCommented Jun 8, 2020 at 4:34
Add a comment
|
1 Answer
Yes, you can copy it with something like:
$ cp -Ra /path/to/oldhome/ /path/to/newhome/
Or do a rsync
:
$ rsync -a /path/to/oldhome/ /path/to/newhome/
You can add the -v
flag to both commands to see the files being copied.
-
1If UEFI/gpt install, you cannot just copy one gpt partition without creating issues. The gpt has GUID in primary partition table, backup partition table and in the partition. Not sure then if clonezilla will update GUIDs to make it ok or not. You cannot have duplicate UUIDs nor GUIDs in system.– oldfredCommented Jun 8, 2020 at 13:22
-
@oldfred, good point, I'll just keep the simpler commands in the answer. Commented Jun 8, 2020 at 16:29