why ubuntu LTS installs all in a single partition?

Patrick Asselman iceblink at seti.nl
Mon Aug 5 11:26:31 UTC 2013


On 2013-08-04 18:33, Colin Law wrote:
> On 4 August 2013 00:14, Christofer C. Bell 
> <christofer.c.bell at gmail.com> wrote:
>> [snip]
>> I'm not sure under what circumstances one would consider 2GB to be a 
>> lot of
>> swap.  I would encourage you to look into how Linux manages memory.
>> Specifically vm.overcommit_memory and vm.overcommit_ratio.  The 
>> purpose of
>> having 2GB of swap is to give your system some buffer virtual memory 
>> so real
>> processes that end up requesting more physical RAM than you have 
>> available,
>> yet will not use it, will still be able to start.
>>
>> For example, let's say you have 8GB of RAM in your system.  
>> Currently, 6GB
>> of RAM are in use (leaving 2GB free).  You want to start a process 
>> that will
>> use no more than 1GB of physical RAM when running, but will request 
>> 3GB of
>> memory for itself, exceeding the availability of physical RAM by 
>> 1GB.
>> Without swap, this program will not start, and the kernel will give 
>> you an
>> insufficient memory error (ENOMEM).  With a 2GB buffer provided by 
>> swap (so
>> the system's total virtual memory size is 10GB), this program will 
>> be able
>> to request 3GB of RAM (as 4GB are available), be started, and 
>> happily use
>> the 1GB of RAM it really needs.
>
> I am not entirely convinced by this argument.  The argument explains
> how, if I had 8GB of RAM with 6GB in use, then I should allocate 2GB
> swap so that I can start a process that initially asks for 3GB, even
> though it will not in practice use it all.  If, however, I typically
> only have 2GB in use then the argument falls down as there is plenty
> of room for the process to start without swap.
>
> In my experience, provided the machine has enough RAM, the most 
> common
> case where swap starts being used is when a process runs out of
> control and starts consuming more and more memory.  Then swapping
> starts and the result is that the whole machine effectively grinds to
> a halt thrashing the disc until eventually it runs out of swap also.
> All that the swap space does is make the machine effectively unusable
> for the period until it runs out of swap.  It would often be better
> for it just to fail immediately it runs out of real RAM.
>
> Colin

One could also argue that in the case of memory leaks, the 'leaked' 
memory can be swapped out, so that the machine does *not* grind to halt 
because the active memory parts can remain in memory. So in effect there 
is more memory available for the active processes, because the inactive 
memory is swapped out.

But to go back from swap to the original question of partitioning:

Why would you want partitions?
* To prevent a full disk from crashing the system
* To prevent bad sectors from crashing the system (and to prevent bad 
sectors in your root partition)
* Minimise data loss in case something gets corrupted

Why would you not want partitions?
* To prevent a partition from filling up
* To not have to worry about which partition should have which size

There are more reasons 
(http://en.wikipedia.org/wiki/Disk_partitioning), but the above are the 
most important in my opinion.


Once you know this, you just need to decide which of the things you are 
trying to prevent is the most likely to happen.
- If you run a server with many users who work with big files, you 
probably want to prevent those users from filling the root file system 
(but that can also be achieved by a disk quota system as someone 
mentioned earlier... though this requires more thought and work by 
itself).
- If you run a server without any big disk users, you may as well make 
it all one partition, otherwise your /var partition may get filled by 
log files one day.
- If you run a server with huge disks, you may want to create a 
partition for only the linux operating system, to prevent the server 
from checking the filesystem for hours after some failure has happened.

At my workplace we have a good example on this. Imagine a server that 
has users that with big amounts of data. Company policy is apparently to 
have separate partions for just about everything:

/
/home
/tmp
/boot
/applications
/data  (why they dont use /home for this, I have no idea)
(and strangely no /var partition?)

It is good that they keep the users data from filling up the other 
partitions (there is no disk quota system), because that way the users 
cannot crash the server. Apart from that, it is pretty bad that all the 
other partitions are there, because we keep having down time due to one 
of the partitions filling up (also because the partition sizes are not 
much bigger than required). Last week the / partition filled up because 
of stuff in /var, last month we had a full /tmp, and even longer ago an 
admin was installing something that filled /applications that caused 
some down time. (The server did not crash, but the applications on the 
server need to write stuff to various directories in order to work).

So in short: the default that Ubuntu uses is not bad by itself, but in 
the end it is up to you to decide if it will suffice for your situation 
:)

Best regards,
Patrick Asselman





More information about the ubuntu-users mailing list