Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have just got the new installation of Ubuntu 9.10.

I am doing a clean install. I have already windows XP on a separate partition.

I went to the advanced options for partitions the file system.

However, I need to allocate space for the root, boot, swap and home directories.

I am just wondering what is the idea size I should do for each, this is just my idea, please correct if I am wrong.

The root '/' - Is that where all the linux installation files gets installed to?

The /boot - Should be mounted on a primary partition so that the BIOS can find it? 

The /swap - Should be 2x RAM mounted on special swap file system?

The /home - Is this where I do all my work .i.e. documents, videos, pictures, etc?

My computer spec is: 2GB Ram 320 GB Hard disk

share|improve this question
    
These older questions might be useful as they partly cover the same ground: superuser.com/questions/36471/…, superuser.com/questions/16280/swap-partition-size-for-4gb-ram –  Jonik Nov 3 '09 at 19:45

7 Answers 7

up vote 4 down vote accepted

Create swap at the beginning of your drive, 2x your physical RAM is a good guideline. Boot can be pretty small if you want to make it a separate partition, a gig or less. You want make your root partition big enough that you have space to install more applications later but not so big that you feel cramped in your home partition.

Here's what I would do if I was building your system:

  • 4GB swap
  • <1GB boot
  • 30GB /
  • the rest /home
share|improve this answer
    
I'd drop / to 15GB. I've got lots of stuff installed on my Ubuntu box and my / is at 10GB. It sometimes gets close to full, so another 5GB would be plenty. –  Jerry P Nov 3 '09 at 18:42

If you have neither a special memory-intensive task in mind nor a serious shortage of disk space, I would accept the default size for the swap partition. If you don't care about hibernating or you are very enterprising and don't mind some hacking to make hibernation work, you can forgo the swap partition entirely and use a swap file.

I don't see a particular reason to have a separate boot partition, unless you're doing encryption or something like that.

In the past, I've done both separate home setups and "one big filesystem" setups. I can't really say that either approach is more flexible than the other, because they have different flexibilities. If you have one big partition, you never have to adjust your partitions to deal with mis-allocated disk space, but if you want to install a new OS and keep your home directory, you need some extra space lying around (or you need to do some creative repartitioning and bind mounting). On the other hand, with separate partitions, keeping your home through upgrades and OS switches is easy, but you run the risk of running out of disk space on one partition with lots of room on others.

Ultimately, I've chosen to have a separate home partition, and I've made sure to use only fully resizable (both shrinkable and growable) filesystems (ext4), so that if I ever need to change my disk allocation, I can just boot a live CD and move partitions around without having to copy to and from a removable disk.

Ultimately, the best long-term solution is probably something like ZFS, which assimilates all disk space and allows you to dynamically allocate it by creating filesystems out of the pool. But linux doesn't have that yet. (If you're interested in when it will hav this, keep an eye on things like btrfs and tux3, and also possibly zfs-fuse.)

For the record, here's my laptop's setup:

% df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              23G   13G  9.4G  57% /
/dev/sda6             219G  157G   52G  76% /home
% swapon -s
Filename                                Type            Size    Used    Priority
/dev/ramzswap0                          partition       1048572 844588  100
/dev/sda1                               partition       3028244 0       -1

The ramzswap device is a nifty feature called compcache that is apparently included in Ubuntu's stock kernel.

share|improve this answer

Definitely do NOT ever make a separate /home partition unless you are building a machine that will have lots of individual users with data in their home directory. Examples would be shell users, email users, user home pages.

At one time, this was a good idea since you could isolate the users from using up too much disk space and crashing the system, but it is a bad idea on a single user machine or on a server where users do not use the traditional UNIX home directory storage, for instance a database server or a web application server.

I belong to the school of thought that says, one big / partition for the whole hard drive. No /boot, and no /swap. If you need swap, then use swapfiles which can be made bigger or smaller at any future time. With 2G of RAM you might start with a 2G swapfile, but keep an eye on how much you use it. You may find that you can reduce it or get rid of it entirely. It all depends on what you do. You might also edit big videos and get some value out of a 6G swapfile on a machine with 2G of RAM.

There was a time when it was important to make a /boot partition near the beginning of the disk because many computers could not boot an operating system that was not in the first x megabytes (was that 512 meg?) of the hard drive. That is no longer necessary.

One big partition for / and let the filesystem take care of the rest.

share|improve this answer
    
The OP didn't suggest he ever wanted two Linux root partitions, but if he did, having a separate /home is helpful -- you can access it from either Linux root partition. That is a reason to have a separate /home. –  Jerry P Nov 3 '09 at 18:44

Just do what I do. Accept the defaults. The installer usually has a pretty good idea about what is needed, and works it out just fine.

share|improve this answer

A clean installation of Ubuntu 9.10 requires an odd 2.5 GB on disk. Is up to you to decide how much space you need for extra programs and data.

IMHO you don't need to have /boot and /home as separate partitions.

Unless you exactly know what you're doing and have some real reason to do that, splitting your filesystems into multiple places does not make much more sense than a all-in-one-place approach for the typical home use.

You can easily install GRUB on the MBR to have a dual-boot machine and you can create a single partition (mounted as /) for both system files and users home directories.

Speaking of the /swap partition:2GB of installed RAM make very unlikely that you ever need a swap space, except when you will put your PC in suspend / sleep mode. In this scenario the RAM image (part of it?) will be dumped on disk, so you can live happy with a swap partition = RAM size.

share|improve this answer

/boot does not need a lot of space (say 1 Go).

/swap used to be twice the RAM on old configurations, now with more than 2 Go of ram, you won't need more than 2 Go of swap.

/ is important and difficult to scale : will you install a lot of stuff ? Will you use other directories than /home to save things (web server/ftp files for example) ? If you don't, 10 Go would be very good for a ubuntu.

/home need to be as big as possible for you to enjoy your linux distro

share|improve this answer
4  
And YES separating things is a good way to save time when you want to clean install a new distro. The minimum I recommend is a separate /home partition (same for Windows with a separate docs partition). –  Luka Nov 3 '09 at 17:31
    
I disagree here, primarily because USB sticks are so large. I do a clean install every other year (LTS version), and create tarball of my home directory and several directories from /usr/local. It's fast, lets me reload specific parts of my home directory, and means that I don't have to choose a fixed size for / or /home –  kdgregory Nov 3 '09 at 18:16
    
I didn't say that there is no way to do without separate /home. I said that it is easier and faster in my opinion. That's why I separated the comment (my opinion) I made from my answer (the advice asked by the author of the question). The question is not "should I make a separate /home ?", but "What sizes should you allocate to the /, /boot, /home and swap ?" : ant2009 wants to do this way. –  Luka Nov 3 '09 at 18:22

I'm sure that there are many interesting reasons for having separate partitions, but I've found it easiest (and more flexible) to just create / and nothing else. A swap partition might be OK if your machine is low on RAM (2GB is on the edge) and/or you anticipate heavily using the machine. I've found that 1.5x RAM size is a good swap size.

share|improve this answer

Your Answer

 
discard

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.