Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to partition 160GB hard disk such as whenever I reinstall or upgrade my data on it should be safe such as it shouldn't get deleted?

For example in Windows XP, I have four partitions like c,d,e,f. Whenever I install new Window XP or anything in c:, my data in d:, e: and f: are safe. But this doesn't happen in Linux my all data were wiped out when I changed Ubuntu from 10.10 to 12.04.

share|improve this question
You simply make more partitions using the livecd and gparted. And keep your files in your /home folder and not in a single Ubuntu partition. – Uri Herrera Oct 29 '12 at 6:55
up vote 4 down vote accepted

Ubuntu (like all UNIX-like systems) organizes files in a hierarchical tree. At the top of this tree is / (the root directory) where everything else resides including the /home directory.

The /home directory is where all users' personal files, folders and settings resides such as music, photos, videos, etc. - everything you see in the Home folder in Nautilus.

Thus, creating a separate partition for /home will allow you to reinstall Ubuntu and still keep all your personal files and settings safe.

Option A

Create a separate /home partition using Live CD:

  1. Boot from a LiveCD and select "Try Ubuntu".
  2. Launch GParted from Dash.

    • In the GParted window, select which partition you want to resize to create space for /home.

    • Select the unallocated space gained from the above step and click on Partition → New from the menu.

    • Select the filesystem you want, ext3 or ext4.

    • Click Apply, Close then Quit.

  3. Now, you need to tell Ubuntu to use the new partition as /home.

    gksu gedit /etc/fstab

    this will open the fstab file in gedit, now add the following line:

    /dev/sdxy /home ext4 defaults 0 0

    where 'sdxy' is the partition you just created, i.e. /dev/sda2

  4. Save and close the file.

  5. Reboot.

Option B

Create a separate /home partition during installation:

  1. Boot from a LiveCD and select "Install Ubuntu".
  2. In the next window click on Continue.
  3. In the "Installation Type" window, select "Something Else" then "Continue.
  4. In the next window, select a free (unallocated) space and click on "Add".

    You have to create at least 2 partitions: / and /home

    In the Create partition window:

    • Set the size for the partition
    • Select the filesystem (ext3 or ext4)
    • Select the mount point, use:
      • / for root
      • /home for home
  5. Once you're done creating partitions, you should have one ext3/ext4 partition with a mount point of / and one ext3/ext4 partition with a mount point of /home. Depending on your situation, you may also have a swap partition.

  6. If you're satisfied with your partition scheme, click Forward to continue with the installation.

share|improve this answer
thanks for your explanation i will try it out – rajesh kakawat Oct 29 '12 at 8:17
You don't need a separate /home partition for this, simply use manual partitioning when you reinstall and do not check the format tick box. – psusi Jun 3 '13 at 15:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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