Ubuntu partitioning recommendation.

Asked by Bjarni

Hi

I wonder if anyone can recommend me on how to partition the disk on a laptop, for Ubuntu Linux.
Vista (NTFS) is installed with 3 partitions (C: and D: plus some system partition) but is to be overwritten. I've already copied neccessary files with help from this forum.

GParted seems to make partitioning really easy - It's just the parameters I need help with.
I've deleted all partitions on the disk (not confirmed though).
The disk is 114GB approx. I don't want any dual boot.

How should I partition the disk:
 - How many partitions
 - What size to make each partition, using what filesystem?
 - What should Free Space Preceding and Free Space Following be?

Although there is plenty of help around the Net - I cannot find any guidelines for this.

Best regards,
Bjarni.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu kde-guidance Edit question
Assignee:
No assignee Edit question
Solved by:
W. Prins
Solved:
Last query:
Last reply:
Revision history for this message
Nizar Kerkeni (nizarus) said :
#1

Hello;
Here what i recommend you but you can wait for other recommendations to see which is the best for you. For desktop use of ubuntu i recommend 3 partitions; swap, root(/) and home (/home) :
- The swap partition should have a size equal to 2*RAM size with a maximum of 2GB.
- The root partition should not be more then 20GB.
- The home partition containing your data can take the rest size. But you can partition it on more.
Kind regards

Revision history for this message
Koen (koen-beek) said :
#2

on ubuntu and linux you'll need a swap partition +- double the size of your RAM

The rest (/tmp, /home, /, ...) could all be installed on 1 partition : the / partition

I however like to put /home on a separate partition than the rest

I allocate twice ram for the swap
+- 10 Gb for / (this will conatin all /tmp files alls spool/buffer files in /var, all program files in /usr, ...)
and the rest for /home (your user data and configuration files

you could also put separate partitions for /usr, /tmp, /var but for a home system I don't think it is really useful

Revision history for this message
Best W. Prins (wprins) said :
#3

The main reason for having multiple partitions is to make future reinstallations easier since then keeping user data is easier as it's on a seperate partition, allowing for the main system partition to be reformatted at will. Generally my scheme is similar to Nizar's, although lately I've been using a slightly modified scheme as follows:

Swap: Same size as RAM, not more than 2GB or so. (Note, you can always add swapspace in a file on later. It doesnt HAVE to be a partition.)
/ (root): Approx. 12-16GB, filesystem type EXT3
/var : Approx 12-16GB, filesystem type EXT3
/home : Remainder, filesystem type EXT3

Comment regarding /var and /: / (root) can be a bit smaller due to having "/var" on a seperate partition here. I've started putting /var onto a seperate partition as it IME contains useful system stuff that one might want to keep accross reinstalls, e.g. downloaded packages for example, and there's no reason to neccesarily delete that on reformat/reinstall. So, consequently, / and /var can be about 12Gb each and it'll still be sufficient.

Comment regarding swap: The more RAM you've got, the less need for swap you have. The 2*RAM size rule of thumb originates with Microsoft in the early 90's as far as I know, and is increasingly inappropriate for today's high-memory machines. That said, IIRC the swapfile is involved in hibernation on Linux, so needs to be at least as large as physical RAM, unless you don't care about hibernation. Aside: On my one server with 4GB of RAM, I have virtually no swapspace, and it matters not a jot. The system usually doesn't touch even what little space it does have.

Revision history for this message
Bjarni (bjarnir) said :
#4

Thanks Walter Prins, that solved my question.

Revision history for this message
Bjarni (bjarnir) said :
#5

Thank you all.
I'm partitioning following your advice Walter. Thank you all for your input.

It wasn't mentioned here - but in my youth - Unix was divided into filesystems - for a number of reasons. One of them was to avoid system crashes should the disk get full. This way only one filesystem would become full - but others operational and the system wouldn't crash alltogether.
Do partitions serve this purpose now - or are there filesystems on top of them?

Best regards,
Bjarni.

Revision history for this message
Buz Cory (buzco) said :
#6

See my long reply following, though you already accepted a short answer while I was typing the long one.

Revision history for this message
Buz Cory (buzco) said :
#7

Bjarni asked:
I wonder if anyone can recommend me on how to partition the disk on a
laptop, for Ubuntu Linux.

Vista (NTFS) is installed ... but is to be overwritten...

[snip]
The disk is 114GB approx. I don't want any dual boot.

How should I partition the disk:
 - How many partitions
 - What size to make each partition, using what filesystem?
 - What should Free Space Preceding and Free Space Following be?

=====

Recommendation on partition count/size:

Note: This suggestion is based on some ten years of Linux experience on
boxen that I built myself (no SW preloaded) and some prior experience w/
different varieties of Xenix (a M$ product of the '80s), including some paid
consulting.

What I have found works best is to have most of the partitions just small
enough to back them up, when full, on whatever backup media you intend to
use. Make as many as are allowed for your drive type (63 for parallel
(ATAPI), 15 for serial (including SATA) ).

The root/boot partition is most critical, so I am inclined to keep it small
so when the inevitable bad tracks occur they will occur elsewhere. In fact I
keep __two__ root/boot partitions so if one fails I can use the other. Right
now I don't have a good number for Ubuntu (I am as new to Ubuntu as you, my
prior practice has been to use some distro for the base system and then roll
my own from source). I would suggest 100 .. 200 MB for each copy of
root/boot ([hs]da{0,1}). Another 2 .. 3 GB in case you need a DOS partition
for some reason (less likely now than it was ten years ago), and all the
rest for secondary.

My recent practice has been to have separate partitions for
/usr/{,share,local} home and swap.

swap should be some (2.5 .. 4) * <RAM> for best operation and __must__ be ≥
2.5 * <RAM> if you are going to suspend/hibernate on a laptop.

There is no advantage that I can see to allowing empty space between
partitions ("room to grow").

So, using the above numbers and assuming 15 partitions max, 4GB b/u volume
size and 4GB RAM we get:
root/boot 100MB * 2 = 200 MB
DOS 3GB
leaving some 110 GB for secondary.

Now, the 11 secondary partions will be:
10GB swap
9 * 4GB mountable = 36GB, leaving some 60 GB for the final, huge partition
which could have a variety of uses. To give you a complete long-term
strategy would take too much time for the present. See my web pages here
when I get some set up.

My choice for FS is ext3, but I have not examined all the new varieties.

More coming ...

Revision history for this message
Bjarni (bjarnir) said :
#8

Hi

You must be my age then.... Started with Xenix myself. Probably Bill Gates finest work.
The size of swap is too small as I defined it (2GB). This laptop will hibernate with 2GB of RAM.
I read somewhere along the way I could increase the swap size later although it wouldn't be on a seperate partition then.
I'll take more into consideration when installing Ubuntu in the future - on more critical systems at least.
Looking forward to see your webpage. Hope you'll get it up in the very near future. I'll be the first to visit :-)

Best regards,
Bjarni

Revision history for this message
The Staucher (bcstauch) said :
#9

Alright, so I am new to Ubutu...period. I have 4 hard drives, I have vista ultimate on one and all my media ect.. on my TB drive. I have tried installing it twice and failed twice. I have read through the partition recommendations, however I am only slightly familiar with partitions and not at all familiar with ext3. Recommendations on software for partitioning? I dont have any experience with Ubuntu (Linux), and wanting to learn more about it. And will be able to access my media on my TB hd that is in NTFS?

Not that is matters but here is what i have:
160gb ide,34 gb raptor sata,1 tb sata, 240 gb sata <----Vista is on this one
4 gb ram
amd x2 64 3800+

Revision history for this message
W. Prins (wprins) said :
#10

@ The Staucher: You really should ask a seperate question, not hijack this one. It's better for everyone concerned.

@Buz Cory/Bjarni: Just to add a few comments/correct one or 2 things (pardon if this sounds like nit picking): You do *not* need more than 2x the RAM size for hibernation to work as stated by Bjarni. The task when hibernating is that your physical RAM must be put onto disk, which is why 1x is the minimum size that will work, and which is why 1-2x is the generally recommended size, see here: https://help.ubuntu.com/community/SwapFaq 2.5x or more is way overkill on todays machines (in any case any machine with 2GB+ RAM or more.) If you're not interested in hibernation, it follows that you then don't need as much swapspace. So I reiterate my point that in reality on machines with Gigabytes of memory, having too large swap partitions can be unneccesarily wasteful. That said, disks are so large these days that it hardly matters, so just allocating 2xRAM size is then from that point of view, the simplest "catch all" rule after all. Note: I mentioned you can always add swapspace (in a file) later on. This is true, but will not enable hibernation if your swap partition wasn't made big enough to begin with. See the link I posted. So you can't enable hibernation later if your swap partition is too small, by adding swapspace in a file. (But, such added space will work fine as swapspace of course.)

Re extra partitions: Having more partitions gives more flexibility but at the expense of more complexity. It is IMHO counter-productive to have too many partitions on end-user machines, so while I acknowledge Buz's suggestions, I neverheless suggest you try to keep your setup as simple as possible (but no simpler.) There is a reason why Ubuntu defaults to having one single partition by default, it is the simplest setup from certain points of view for end-user desktop machines and for most end users this is appropriate. Nevertheless, for slightly more advanced users a slightly more nuanced scheme is better as was suggested. At the other end of the spectrum lies Buz's suggestion, which I humbly suggest is somewhat overkill for a new Ubuntu user, particularly on a laptop. If you really want flexibility with respect to partitioning and want growable paritions (even accross seperate disks) then you should have a look at LVM, see http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)

As another aside: Dos/utility partitions are less useful than they used to be so unless you actually know you want one and are going to install something there, I'd suggest you skip that. You can usually get more done and do whatever repair and rescue needs doing using a rescue CD or USB drive. See for example here: http://ubuntu-rescue-remix.org/

Re your question about filesystems and partitions: Partitions are like fences, you fence off areas of your disk into blocks. But they don't contain anythign yet. To make use of each partition you have to put a filesystem on it to make use of the empty space. My current choice is also EXT3, but keep an eye on EXT4, which is in development but looks quite promising. If you have *very* large numbers of small files to manage, you might consider ReiserFS which I've used in the past quite successfully in such contexts.

Revision history for this message
W. Prins (wprins) said :
#11

Note: Please be careful to copy the LVM URL manually, as Launchpad's excluded the last parenthesis from it's HTML.

Revision history for this message
Bjarni (bjarnir) said :
#12

Thanks Walter.

I do not have an opinion or knowledge about the size of the swap partition. When I said my swap file was too small - I meant it was too small according to Buz Cory's advice. I worded this inaccurately having the last reply in front of me.
Right now I'm just like a kid in a candy store exploring Ubuntu - valuing all input I get here.

Best regards,
Bjarni.

Revision history for this message
W. Prins (wprins) said :
#13

Hi Bjarni, Hmm yes sorry rereading my post I see I made a typo when answering (using your name when I meant his) -- I was trying to say that Buz's advice (about the size of the swa partition) was IMHO excessive for Ubuntu, as per the link I sent.

As an aside/Just a thought: It might be worthile (a worhwhile learning experience) to install Ubuntu a couple of times using different setups, to get a feel for things. In other words, there's nothing stopping you doing an partitioning + install, playing around a bit, then deciding you don't like the parition sizes or whatever, and rebooting again with the install CD and redoing the partitioning/install again from scratch.

By the way, if you haven't yet, you might also want to look at the Ubuntu community forums where there's lots of other people like yourself and a lot of resources for beginners posted. See here: http://ubuntuforums.org/

Anyway, just trying to help etc. I hope your Ubuntu experience is a pleasant one. All the best and good luck.