Migrating the Home folder
To migrate your current Home folder to an external partition, there are four things that you need to do:- Mount the external partition onto a temporary Home location.
- Copy the files from your current Home folder to this temporary Home folder.
- Relocate the current Home folder
- Mount the new Home folder.
1. Create a temporary Home folder
Open a terminal and type the following:sudo blkid
Next, open the fstab file:
sudo nano /etc/fstab
UUID=xxx-xxxxx-xxxxx /media/home ext4 nodev,nosuid 0 2
Save (Ctrl + o) and exit (ctrl + x) the file.
Next, create a mount point:
sudo mkdir /media/home
sudo mount -a
2. Copy the files from your current Home folder to the new Home folder
The next thing we are going to do is to copy all the files from the current Home folder to the new Home folder. You can simply do a “Select all”, “Copy” and “Paste” to transfer all the files to the new Home folder. However, you might be missing out the hidden files and some of the file permissions might not be preserved. A more complete method would be usingrsync
.sudo rsync -aXS /home/. /media/home/.
3. Relocate the current Home folder
Once we have set up the new Home folder, we need to remove the existing Home folder to make way for the new Home folder in the external partition. To do that, type the following commands in the terminal:cd / sudo mv /home /home_backup sudo mkdir /home
4. Mount the new Home folder
The last step to complete the migration is to mount the new Home folder as “/home”. To do that, we have to revisit the fstab file again.sudo nano /etc/fstab
Lastly, reload the fstab file:
sudo mount -a
Optional: removing the Home_backup folder
sudo rm -rf /home_backup
source::https://www.maketecheasier.com/move-home-folder-ubuntu/
No comments:
Post a Comment