17

When I installed Ubuntu 10.04, I installed it on a single 16GB partition which includes /, /boot, /home etc.

I have another partition on the system (ext3). It is easily accessible from the GNOME desktop Places menu: I just click that Filesystem HDD icon on the Places menu and it is automatically mount as '/media/1326f40a-45df-4ec'.

How do I make that partition re-mount as /home instead? (permanently, that is)

1

4 Answers 4

16

First you want the UUID of the drive so it can be reliably mounted.

sudo blkid

That will return a list of all your partitions and their UUIDs. Just note the UUID of the partition you want mounted as home.

Then you just need to edit /etc/fstab to auto-mount that partition as /home.

sudoedit /etc/fstab

And add a line like this:

UUID=0c89eb5d-ac58-46c0-b309-597b35a542e8 /home ext3 defaults,errors=remount-ro 0 1

Although obviously with your UUID, not mine. Save and reboot.

6
  • 4
    before you restart, you will also need to copy all home directories from /home to new partition so that when you reboot, you and other users if any, have all their settings/configuration intact. You can also do that after restarting but doing before will save your from few surprises
    – binW
    Jan 6, 2011 at 14:27
  • I tried to mount a folder inside a drive, as /home directory, and now I can't my home folder at all. How can i solve such problem
    – Starx
    Jul 31, 2011 at 15:16
  • @Starx You can't mount a "deep" location directly - you have to mount its device first (as above) into /mnt/a-made-up-directory (change that, obviously) and then add another line to your fstab like: /mnt/a-made-up-directory/home /home bind defaults,bind 0 0. This assumes the homedir you want to mount sits inside the drive we've just mounted to /mnt/a-made-up-directory.
    – Oli
    Jul 31, 2011 at 15:51
  • I'd imagine that ext3 should be replaced by the actual fs (i.e. xfs) used by the volume (reported by the blkid).
    – Dan M.
    Apr 21, 2022 at 7:09
  • Same for ,errors=... part.
    – Dan M.
    Apr 21, 2022 at 7:17
13

Here is the official Ubuntu documentation for moving to a separate /home partition:

https://help.ubuntu.com/community/Partitioning/Home/Moving

Just skip the step for creating a new partition as you already have it.

1
  • 1
    Thanks, +1 and accepted as the most complete answer, since the guide you pointed to The guide is written in such a way so that at any point in time if there is a system failure, power outage or random restart that it will not have a negative impact on the system and SHOULD safeguards against the possibility of the user accidentally deleting their Home Folder in the process. Jan 6, 2011 at 15:42
5

In looking up a similar issue I found this thread. I wanted to touch base on a couple things.

First, IMHO, the UUID is desperate and unworkable. There is a better solution than using the UUID that works on 10.04 of Ubuntu. That is to use the LABEL='label'.

In the /etc/fstab file swap the UUID with the LABEL='<label>' (and be sure to use the single quotes). Before doing this please ensure that you have used gparted to add a label to the drive. This label is just like the label you might have created to identify your floppies, your zip drives (not files), or even your old HDDs under Windows.

The next thing I wanted to touch on is that above someone gave the following command.

sudoedit /etc/fstab

That command I have never seen before. Either it is something that I didn't know exists or it is wrong. In the case that it might be wrong I'll correct the syntax.

sudo gedit /etc/fstab

Finally I appreciate the person that appears to have given the proper answer where you want to have a folder under the root of the partition as your home. The procedure described in this thread does not touch on that even though it is the most APPROPRIATE implementation. You should always put your home folder in a folder under the partition instead of pushing your home folder into the root folder of the partition.

1
  • gedit is for graphic environment only, sudoedit is fine.
    – Han
    Mar 19, 2019 at 9:11
0

If you are installing a fresh system the easiest way is to choose an special partition layout and declare one of the partitions as /home and another one as /.

The effect is equivalent to editing fstab as in the other answers, but this method has the advantage that you do this from the start.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .