Home » Questions » Computers [ Ask a new question ]

What sizes should you allocate to the /, /boot, /home and swap [closed]

What sizes should you allocate to the /, /boot, /home and swap [closed]

I have just got the new installation of Ubuntu 9.10.

Asked by: Guest | Views: 54
Total answers/comments: 5
Guest [Entry]

"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"
Guest [Entry]

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.
Guest [Entry]

"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."
Guest [Entry]

"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."
Guest [Entry]

"As with all my systems I separate the OS from the data.
Linux: sda1 for /, sda2 for swap, sdb2 for /homes
Mac: SSD1 for the OS, HDD1 for /homes
Windows: C: for the OS, D for the Data

If I stuff up the OS then I can just reimage or reinstall
and all the Data (in RAID 1 preferably) is still there.