3

I had moved /home to another partition by following these steps: https://help.ubuntu.com/community/Partitioning/Home/Moving
Now I have reinstalled ubuntu by choosing the option to delete all previous files. After the installation, my /home directory is in the same partition as the root while my old /home is still intact in the other partition. Can I make /home point to the other partition while keeping my original files?

4

Before we start

Make a fresh backup of all your data on an external drive.

On installation

When installing Ubuntu with defaults it will always create then HOME directory in the root of our newly installed OS. In case we do not want this we'd have to choose "Something else" on installation to then partition our drive according to our (non-default) needs.

Then we can choose to install on a root partition (on mount point /) and also mount another partition as HOME (mount point /home).

On the screen there please note the small boxes (enter image description here) where we choose to format a partition.

  • We may want to format the root partition / holding our newly installed OS. All data on that partition will be deleted.
  • We may however not want to format our HOME partition as we would like to keep our data there. Formatting will delete those.
  • We then need to tell the installer to mount our previous HOME partiton to /home. This is done by clicking on Change... after we had selected this partition. Again, take care to have "Format this partition" unticked.

Example:

For a separate HOME partition the screen may then look similar to this:

enter image description here

In the example above we will install Ubuntu, and format /sda1 to mount it on the mount point /. We will keep an exisiting swap partition on /sda5, and we will have an additional partition /sdb5 that we chose to mount as HOME on /home. Format option is ticked and greyed out in this example because it was an unformatted drive.

After installation

In case we had already installed Ubuntu but forgot to tell it to use another partition as HOME we simply edit our /etc/fstab to define the partition we want to mount as HOME on boot. Such an entry may look similar to this:

UUID=<uuid of partition to use>    /home    ext4    defaults   0  2

If, after a reboot, everything is to our liking we could delete the contents of our previous /home directory but after a fresh install it is not really populated much, so we could also just leave it in place.

For more details on these steps see my answer to the following question

Note that the directory name /home will still reside on the root partition to be used as a mount point.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.