If you only run one OS, is Partitioning worth it? [closed]
Solution 1:
First of all, the wikipedia entry is quite complete on this regard.
I will try to explain the rational behind partitioning besides the backup/organization arguments already provided in other answers, to argue that from the performance point of view, the only advantage in partitioning is minimizing fragmentation.
OSs have to make assumptions on how the user uses and stores her data. The problem can be boiled down to the following:
Assume you have a chunk of memory, say 256B, which you can imagine as 256 boxes in a sequence.
|_|_|_|_|...|_|
Now, you want to store 3 files, one with 64, other with 64, other with 128 boxes: should you allocate them?
1: | 64 | 64 | 128 | or
2: | 64 | 128 | 64 | ?
It depends... on whether which chunks are going to be stored for a long time or not, and what are the most probable chunk to be saved after one of the chunks are removed.
Imagine the 2 chunks of 64 are removed from disk in the next operation a new chunk of 128 is saved. On the example 1, you can store the 128 right away, but in the second example, first you have to move the stored chunk of 128 to the border, and only then you can add the new chunk.
Now, imagine this but with all kinds of different sizes, saved in a non-trivial way (i.e. not all 4B first, then all 8B, etc.) on a giant disk (GB size). This is known to be a very difficult problem.
The OS solves this problem by using heuristics. It does not make the optimal strategy, but uses some heuristics to put the chunks in correct places. One important information is how often how large are the chunks the user/OS saves, because it provides some a priori information on the next chunks from where the OS can try to guess.
Partitioning the disk effectively tells the OS that a specific region of the disk belongs to that partition. This means that there will be no longer a one sequence of 256 boxes, but two sequences of 128 boxes (partition A and B). The OS will no longer make the assumption on where to put it: you are the one deciding by which root on your directory you choose (hand waving speaking).
Why it can improve performance?
One typical example is when you have two distinct behaviors while using the OS. For instance, the difference between:
- using the OS daily, which has lots of write and erase in memory, and
- when you store heavy files such as videos or albums which you don't change very much.
Partitioning can improve performance when you use OS daily in one way, and you use other partition to just store heavy files which you only change very rarely during the OS lifetime.
Because your behavior is consistent within each partition, the OS will likely improve its allocation, thus minimizing fragmentation.
Now, whether this is relevant or not for normal user cases, I would say no because who develops allocation strategies are smart and the heuristics are thought for those cases.
For servers and other systems, this can make a difference, but go for it after profiling.
EDIT for including SSD
My understanding is that this problem is independent of whether we talk about SSD or hard disks. The problem is very fundamental in the sense that it only requires that you want to fill a finite space with non-constant sized items that are constantly being added and removed.
Solution 2:
The advantage is the ability to reinstall the OS without having to copy your personal files to another place and then reallocate on the brand new OS installation, since it will be in another partition.
Additionally, if you're running a server it's typically good practice to make certain service related volumes on a separate partition. That way if that service is compromised and an attacker is able to fill up that partition your OS should still be operational. Consider an FTP or database service - if the directories that are being accessed are able to be filled up to the capacity of the disk then you'll run into some serious operational problems but someone merely dumping piles and piles of data onto it, thus causing a DOS for that system. This kind of approach would be even more attractive to an attacker if there are other valuable services running on it that they'd want to disrupt such as a web server or domain controller. Arguably, this could all be mitigated with proper configuration of these services but new exploits come out daily so it never hurts to add in more layers of security when possible. (added by Bradley Forney)
But, in a end-user (users of Windows 7, Windows 8, etc) point of view (I know that the question is to a server but to those who are seeing this though Google), there is no point in partitioning if you don't reinstall your OS with frequency.