Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

7/8/2017 How to Create a Separate Home Partition After Installing Ubuntu

How to Create a Separate Home Partition After


Installing Ubuntu
by Chris Ho man on June 17th, 2012

Ubuntu doesnt use a separate /home partition by default, although many Linux users
prefer one. Using a separate home partition allows you to reinstall Ubuntu without
losing your personal les and settings.

While a separate home partition is normally chosen during installation, you can also
migrate to a separate home partition after installing Ubuntu this takes a bit of work,
though.

Download the new Opera Opera browser with built in free & unlimited VPN, Ad Blocker and
browser - Faster, Safer, Smarter Battery Saver! opera.com

Intel KabyLake COM Express - OS Win 10/8.1/7/VxWorks/Linux, and DDR4 H.265/HEVC graphic
better computing performance perfomance adlinktech.com/7th+Intel+Core
Convert From Doc to PDF, PDF to Doc Simply With The Free Online App!
Start Download - View PDF download.fromdoctopdf.com
Merge & Convert Files into PDFs w/ EasyPDFCombine - Free!
Start Download - View PDF easypdfcombine.com

While Installing Ubuntu

Creating a separate home partition while installing Ubuntu is easy. Choose the
Something Else installation option to use a custom partition layout and create multiple
partitions. Set the mount point for one of your partitions as / which will contain the
root le system and the mount point of another partition as /home. When you install
Ubuntu in the future, you can set your old home partition as /home again but make
sure to uncheck the Format checkbox or your les will be deleted.

https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ 1/9
7/8/2017 How to Create a Separate Home Partition After Installing Ubuntu

After Installing Ubuntu

If you dont create a separate home partition while installing Ubuntu, you dont have to
reinstall Ubuntu from scratch. To migrate to a separate home partition after installation,
youll have to create a new partition (which may require resizing your existing partitions),
copy the les from your existing home directory to that partition, and tell Ubuntu to
mount the new partition at /home.

Step 1: Create a New Partition

If you have some free space, this step is easy. If you dont, youll have to resize your
system partition and create a new partition in the free space. Follow our guide to
resizing Ubuntu partitions to complete this step. If you have free space or dont need to
resize a system partition, you can just install GParted and create the partition without
restarting from a live CD youll want to create an ext4 partition.

Step 2: Copy Home Files to New Partition

Ubuntu makes it easy to mount the new partition just click it under Devices in the le
manager. After you do, click the Go menu and select Location to view its mount point.

https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ 2/9
7/8/2017 How to Create a Separate Home Partition After Installing Ubuntu

Launch a terminal and run the following command to create a copy of your current
/home directory on the new partition, where /mount/location is the location of your
mounted partition:

sudo cp -Rp /home/* /mount/location

Youll see an error about a .gvfs directory this is normal; you can ignore it.

You should check the new home directory to verify it contains your les. However, we
wont be deleting the old home directory just yet.

https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ 3/9
7/8/2017 How to Create a Separate Home Partition After Installing Ubuntu

Step 3: Locate the New Partitions UUID

The long, random-looking string above is actually the partitions UUID, and well need it
to add the partition to our fstab le, which tells Linux where to mount partitions when it
boots. You can also locate the partitions UUID by running the following command in a
terminal:

sudo blkid

https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ 4/9
7/8/2017 How to Create a Separate Home Partition After Installing Ubuntu

Step 4: Modify the fstab File

Before modifying our fstab le, we should create a backup copy that we can restore, just
in case:

sudo cp /etc/fstab /etc/fstab.backup

Next, run the following command to open the fstab le in gedit. You can also use
another text editor, if you prefer.

gksu gedit /etc/fstab

Add the following text to the fstab le on a new line, replacing the _____ portion with the
full UUID of your new home partition from the sudo blkid command above:

UUID=_____ /home ext4 nodev,nosuid 0 2

https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ 5/9
7/8/2017 How to Create a Separate Home Partition After Installing Ubuntu

Save the le after adding the line.

Step 5: Move Home Directory & Restart

From a terminal, run the following command to leave your home directory, move your
current home directory to a placeholder location, and create a new, empty home
directory which your new partition will be mounted at:

cd / && sudo mv /home /home_old && sudo mkdir /home

https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ 6/9
7/8/2017 How to Create a Separate Home Partition After Installing Ubuntu

Reboot your computer after running this command. You can restart with the following
command:

sudo shutdown -r now

Clean Up

After restarting your computer, you should be able to log in normally. Ubuntu is now
using the separate home partition. After making sure that everything went okay and you
still have all your les in your /home directory just in case you can you can remove
your /home_old directory to free up space:

sudo rm -rf /home_old

SHARE: COMMENTS:

Chris Ho man is a technology writer and all-around computer geek. He's as at


home using the Linux terminal as he is digging into the Windows registry.
Connect with him on Google+.

DID YOU KNOW


In Lewis Carrolls Alices Adventures in Wonderland,
the playing-card-people found within the Queen of
Hearts kingdom have roles based on their card
suite: Hearts belong to the royal family, diamonds
are courtiers, clubs are soldiers, and spades are
gardeners.

https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ 7/9

You might also like