64

I have a laptop with win7 installed. I have now made a 60gb partition which I want to install ubuntu into. The question I have, before I do the installation, is how large each of the root, swap, and home partition should be? I have read some place that root could be as small as 8GB, but isn't that too small? Since I guess beside ubuntu all the softwares installed will reside there as well? And I think I'm going to set my swap to be 2GB large.

My main concern is how large should the root partition should be. I'm mainly going to use ubuntu for programming and browse the web.

Tim
  • 33,500
starcorn
  • 1,011

11 Answers11

53

You actually should just install ubuntu on two partitions, / and swap. You can have ubuntu do this automatically by choosing to use the available free space (in other words, do not format your 60GB partition in vista before installing ubuntu).

Some will argue that you should use separate partitions for /home, /boot, / and all kinds of things. This is useful in some situations, but for most common situations you are better off not doing this. This is because it will fragment your disk in a way that might not be wanted later. Just let ubuntu choose for you and you'll be safe :)

You would often use a separate home in situations where you want to use:

  • Multiple drives
  • Multiple mutually exclusive ubuntu installs sharing the same data (could work with varying distros but not advisable to do this with different distros)
  • Situations where your data needs to be safe in the case of a drive failure/upgrade (most normal installs are safe)
  • You want it to be easier to reinstall or upgrade the system (just choose not to format the /home partition - please note a backup of important data is highly recommended during any system upgrade)
  • The same drive is used by different systems.
  • Your disk does not have enough capacity for both home and system data (e.g. a small SSD)

NB: "Ubuntu's installer offers to preserve the contents of /home, so you don't need to be afraid to lose anything when doing re-installs or upgrades. – htorque"

On another note about swap - if you want to be sure that when doing large tasks you can have a lot of swap space, you can set your swap space to be twice the size of your ram, but either way, ubuntu will handle the requirements rather well if you choose to install on the blank 60GB partition.

You might also want to read up on Swap files instead of Swap partitions. Again this can help reduce fixed fragmentation of your disk and dynamically allocate space as you need it. Supposedly, there is no performance loss. How to increase swap space?

RolandiXor
  • 51,797
22

I have always had a separate /home partition, root (/) partition and swap. It means when I upgrade, I can do a clean install of the new OS with no risk to the old one. I just mount the home partition in the new one. Also means if I go back to the old OS, any files created in the new OS are still there.

I have used various sizes for my root partition. On one machine I have regular Ubuntu and Ubuntu Studio, each installed in 10GB partitions. The regular ubuntu has used 6.04Gib and studio has used 3.08Gib.

You can always change the partition size later anyway if you need more space. Just need to boot from a live CD and use GParted to change the partitions.

As for Swap, twice the RAM or 1.5x the RAM is a good rule. Then you can hibernate if you want to. But if you find you need more or less you can repartition later.

Eliah Kagan
  • 119,640
6

For / (root) partition, I use 10G (of which I rarely find I've used more than 8Gb). For swap, I have 3Gb RAM, so I set 4Gb of swap. Not quite the recommended "twice your RAM", but hibernate still works, although I rarely use it. For /home, I use the rest of the hard disk.

These days, the general consensus is to just use one root partition (which includes /home) and a swap. But I still do keep a separate home partition : I think a little separation from the system drive is nice and it means that if I'm ever in the position to increase /home, I can do so more easily.

FYI My Ubuntu install with a 10GB root is now showing root as 85% full and wont allow upgrade.

Scaine
  • 11,229
3

If you don't have specific needs, I think that you can keep root and home in the same partition.

The size of the swap partition depends on how much RAM your laptop has. If you have 4GB of RAM, a 2GB swap partition should be enough. You can then have 58GB for the system partition and 2 gb for the swap partition.

fitzbutz
  • 181
2

Partition : A H.D.D. can be divided into multiple pieces digitally. These pieces are known as Partitions/Drives.

Mounting Point : In simple words it's a Flag/Name/Type assigned to a Partition.

FileSys. Type : Type of the Partition.In Linux mostly used are ExtX(X=1,2,3,4) & NTFS.

Primary Partition : There can be maximum '4' Primary Partitions in an H.D.D. A Primary Partition may contain one or more Logical Partitions.

Logical Partition : Virtual Partition under a Primary Partition.

SDA : The Storage Media such as H.D.D. or other Media as well. If you have more Drives then it will be named SDA,SDB,SDC,++

Device for Boot Loader Installation :----

Boot Loader : As we know BootLoader is a Program that is loaded on the Media which is run by the B.I.O.S. after conducting P.O.S.T..BootLoader further loads an Operating System or provides a menu if more than one O.S. is installed in the Media.

Choosing Device : When you have a previously installed O.S. that means it has it's own BootLoader Program.Which is installed in the M.B.R.(master Boot Loader) of H.D.D.Now when you are installing Linux then it will ask you where to install the G.R.U.B.(Grand Unified Boot Loader) or Linux BootLoader.It gives you options to install it into the M.B.R. which will over write the existing BootLoader or install it into any of the Partitions,that will add this Linux entry point in the existing BootLoader.Now the choice is yours.


You need at least '3' Partitions in order to install any Linux Distro..

It just takes a 100 G.B. of Drive/Partition to install Linux decently.

Partition 1 : Root(/) : For Linux Core Files : 20 G.B. (Minimum 15 G.B.)

Partition 2 : Home(/home) : Drive for User Data : 70 G.B. (Minimum 30 G.B.)

Partition 3 : Swap Area : Space that acts like extra R.A.M. : 2 x R.A.M. Size.

Note : Swap Space behaves like an extra R.A.M. when the R.A.M. is full.

Hans
  • 1,301
1

/boot - 200m primary.

/ - 20-25g.

/home - 30g or higher for virtualbox disk files.

swap - 2 multiply of ram.

If you often install a new distro, I recommend to separate 1 empty ext4 partition for special programs or their configs --such as virtualbox disk files, your projects, etc. Because some distro installer may be unstable and your home data may be destroy. It is my bad experience.

Bonn
  • 409
0

what about allocating half of your entire storage space to Ubuntu. This will allow upgrading, customizing and installation of various applications

0

If you are dealing with only 60GB, don't bother with partitioning it, simply use one large partition and be done with it. For the swap you don't have to use a partition either, you can use a swap file, which allows you to resize or just delete it depending on your usage pattern.

Grumbel
  • 4,879
0

I always found myself putting my data into system folders after runing out of /home space (to clean all that up later) or losing data in trying and failing to resize partitions. So I've came to conclusion that unless I get a very big hard drive, I should use one common partition for the whole file system.

Yi Jiang
  • 1,206
Ivan
  • 58,745
0

Partition layout is going to be different per use, workstation vs server. Swap, most Unix/Linux today has better memory management whereas swap is not used unless run out of RAM which do not want to happen and want to increase RAM and not swap. Workstation if using hibernation will require swap to be more than RAM, a good 1.5 times is a good rule, can be higher but really want to have enough RAM not swap if can avoid, unless having a system cannot have enough RAM then can increase swap to prevent crashes. On servers best to MAX out RAM and not use any Swap, no hibernation so minimal or no swap, since very large RAM on servers not practical to have 1.5 or more swap, no more than a few gig if used just in case peaks on RAM usage but good system planning, monitoring and more than required RAM to run apps needed and not have to swap, swap is poor performance so best to max RAM and have less or no swap.

-1

swap - very important, even if you have a large amount of ram.

Cause: in the caching mechanism, the data after calculating on RAM will be saved on swap to limit caching too much on RAM (preferred as a storage place for calculations)

Especially with systems using Oracle, a large swap is always needed

Reference:

RAM <= 16GB --> swap = (1 or 2) x RAM

RAM > 16GB --> swap = 16GB