I usually install Linux on a single partition since I only use it as a personal desktop.

However, every now and then I reinstall the box. And what I do is to simply move my files around with an external hard disk.

So how could I prevent that when reinstalling my box (e.g. switching to another distro)?

6 Answers 6


Keep your /home on a separate partition. This way, it will not be overwritten when you switch to another distro or upgrade your current one. It's also a good idea to have your swap on its own partition. But that should be done automatically by your distro's installer.

The way my laptop is setup, I have the following partitions:

  • 3
    +1 on the swap partition. Actually, the theory behind swap and boot being separate is that if you make those partitions close to the zero cylinder, they'll be on the disk tracks closest to the spindle, and will be slightly faster on disk seeks. So having your page file space and your boot loader closest to center can mean performance increases. Unless you're using solid-state, then never mind.
    – Milner
    Commented Aug 10, 2010 at 19:53
  • 1
    +1 separate /home. You can encrypt all your personal files (entire /home partition), and not unnecessarily slowing down access to non-private system files and libraries.
    – Alex B
    Commented Aug 11, 2010 at 4:54
  • 2
    You have a swapfile on a separate partition?? Don't you mean you have a swappartition?
    – wzzrd
    Commented Aug 16, 2010 at 11:54
  • 1
    /swp ? A swap partition is not mounted anywhere, so your answer is somewhat misleading. Commented Aug 17, 2010 at 23:49
  • 2
    I think you should just write swap instead of /swp in order to prevent any confusions as others have already mentioned. Commented Aug 31, 2010 at 1:07

Rather than relying just on partitions, under Linux I usually recommend using LVM. This allows you to grown and shrink filesystems as needed later (though growing tends to be easier than shrinking), even wile the file system is active in the case of ext2/3/4 (I've successfully increased the size of filesystems while they were active, though I've never tried to decrease the size of one this way).

Obviously this still leaves you to decide how to apportion the space, but you don't have to get it exactly right from the get go because rearranging things later is easier. I usually give each volume as much space as I think it will need plus a chunk for good luck, and leave the remaining space for adding new filesystems or expanding existing ones into later.

  • Even if you use LVM, you still have to decide what logical volumes (LVs) to create. As a side note I still remember the disappointment I had last year when I discovered that the desktop Ubuntu installer didn't have support for LVM. Commented Aug 31, 2010 at 1:11
  • Yes the default Ubuntu installer is a pain in this regard, but you can get a LVM and/ro RAID setup out of the alternate (text based) installer. And while you still have to make some choices to start with when using LVM, changing you mind later and shuffing space allocations and/or creating new volumes is easier. Commented Sep 2, 2010 at 20:25

The minimum setup should have / and /home in separate partitions. / should have at least 18GB, in my experience. I usually have a third partition called /code where I keep all my work code, and use /home for downloads, documents and other non-code related things. When I reinstall, I just backup whatever I have in /home that I want to keep to /code.

  • why so much? I have a 10G / and 2.8G to spare. But I suppose it can be so small because I have a 10G /var and a 1G /tmp Commented Aug 10, 2010 at 20:28
  • 1
    I always have at least 14G used on / alone. It's a consequence of instaling a lot of -devel and -debug packages, basically. My /var is taking only 1.2G out of that, and /tmp takes up a few measly 100Mb. With hard drive sizes these days, no use restricting the size of /,you never know when you suddenly need to install something big. Commented Aug 18, 2010 at 16:36

No one seems to have mentioned /usr/local. I often make this a separate partition. If you're in the habit of installing software compiled from source or other 3rd party software that isn't part of your distro, having it in /usr/local means two things:

  1. You can share /usr/local over nfs and have "installed once, installed everywhere" functionality if you have more than one system with the same OS version
  2. You can keep this partition across re-installs and then you don't need to re-install everything here. Note: when you upgrade the OS some of your libraries may change and you might have to recompile some things. But not always.

Besides /usr/local I also keep a separate /home for obvious reasons and a separate /Files which is where I put stuff that is meant to be "shared", such as the family MP3 and video collection. Depending on your usage /home might be a better place for your music, but if it's in a separate partition it's easy to have it on a separate hard disk even if you don't use LVM.


Depends on the usage, and the OS really.

On my main desktop I have the space split between / and another partition I keep my documents/music etc. Since /home will have user configuration and stuff in there I wouldn't keep it intact between installs, just symlink my document/music folders into my homedir.

  • But user configuration (and thus home) should stay around between installs. Or do you reconfigure everything after a OS install? Some of my files (.emacs, .cshrc) have bits that have been around for 15 years.
    – KeithB
    Commented Aug 10, 2010 at 20:14

There are a number of guides that can help with this, and as theotherreceive pointed out, it can be OS specific. What Solaris suggests may not be what Ubuntu suggests. For instance, Solaris (and maybe HP-UX) use /export/home as the mount point for home dirs, Linux uses /home.

There's no real magic to it, in fact what I'd say is you've hit the nail on the head. One partition doesn't cut it for your needs. So make a change. Use the guides as an example (you can even learn why /etc is /etc and other neat trivia with the right document). Here's an example (pulled at random from a Google search):


You must log in to answer this question.

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