12

My understanding of disc partitioning has always been that you partition a disc to install multiple operating systems so you can boot from multiple operating systems on a single disc. However I'm reading a ubuntu server book and it talks about partitioning the /home directory of a ubuntu installation.

"The /home directory is a popular partitioning candidate among both administrators and desktop users alike because it holds all of the personal files for user accounts on that machine. If you maintain /home as a separate partition, you can install new versions of a distribution or even different distributions altogether without wiping out any user settings."

I don't see how and why anyone would partition the home directory or any other directory for that matter in the file system of a ubuntu installation.

2 Answers 2

13

When installing Ubuntu to a hard drive the installer takes care of partitioning. In case it finds an empty unpartitioned space it will use this for your Ubuntu Installation. If you had already installed an OS the Installer will let you shrink a partition to then hold Ubunutu.

By default a single partition, and an additional swap partition will be created. In case the installer finds a pre-existing swap partition it will not create an additional one. We may want to hold our HOME in a separate partition, be it to

  • mirror this partition
  • easy format the OS partition without deleting HOME
  • having the OS on a fast SSD but HOME on a conventional drive,
  • or a variety of other reasons.

Note that it is not a good idea to share all of the HOME partition with different distributions or releases as this may lead to conflicting configuration settings from differing application versions. Rather than sharing all of HOME we should share data on a shared partition only. These data directories can then be symlinked to from the user's home subdirectories.

In the following sections let me depict procedures for having HOME on a partition or a drive different to the OS:

Backup all of your important data before you change partitions.

Desktop installation

  1. On installing Ubuntu choose "Something else" to have access to the partitioner.
  2. If the drive was used before, remove the partition table or delete partitions to hold your Ubuntu. All data on these partitions will be deleted.
  3. Create a new partition to hold the OS root directory.
  4. Choose the mount point / for this root partition:

    enter image description here Note the different mount points you may be able to choose for any partition created.

  5. Repeat step 3. and 4. for the /home partition:

    enter image description here

    In case there is a pre-existing HOME partition holding data we now have to make sure to untick "Format?" before we proceed with the installation to not delete this data:

    enter image description here

  6. Choose "Install now" to partition and format the drive and proceed with the installation.

Ubuntu Server installation

The server installation will guide you through the partitioning using partman. At the partitioning step we may delete, or create new partitions similar to the desktop installation. Shown below are interim steps when we do so:

  1. Choose "Manual" partitioning for an individual setup:

    enter image description here

  2. Choose partition to change or free space to create a partition

    enter image description here

  3. Select mount points / for root or /home for HOME:

    enter image description here enter image description here

  4. Repeat steps 2. to 4. until finished:

    enter image description here

  5. Continue server installation:

    enter image description here

Move exisiting HOME to a different location

See question and answers below on procdeures to move the HOME directory to a different partition or drive:

7

You quoted the answer to your own question...

If you maintain /home as a separate partition, you can install new versions of a distribution or even different distributions altogether without wiping out any user settings.

A partition is just a way to separate the files in the hard drive, it doesn't need to be a place for an operating system. If your system partition and your home partition are separated, if you upgrade your system it'll only affect the system partition, leaving your data alone.

There are other uses for a different data partition such as encrypting it or a having a different filesystem than the operating system's one.

Note that Linux treats /home, /usr, /var... as folders, even if they are separate partitions (they are mounted at bootup). So having a separate /home partition won't affect you in any negative way, go ahead and do it.

If you intend to have a server someday, I'd advise to use a separate /var partition, and probably a separate /usr and /tmp too.

4
  • Can you partition a folder on a live system? Apr 19, 2013 at 13:39
  • 1
    I'm not sure what you mean. A live system isn't installed to the HD, it usually doesn't use your harddrive, at least not permanently, it runs from the CD and on the RAM. You can use a tool called GParted available on most live CDs to partition your harddrive, but the live CD itself won't be using the partitions you make unless you install it to the drive.
    – Alex
    Apr 19, 2013 at 23:02
  • I mean once ubuntu is installed on a partition in the hard drive, can I then after installation repartition a folder in it? Apr 21, 2013 at 3:38
  • I have never tried it, but it seems to be possible.
    – Alex
    Apr 24, 2013 at 8:38

You must log in to answer this question.

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