📜 ⬆️ ⬇️

Partitioning the system disk when installing the desktop Linux distribution

Linux is the most “generous” desktop OS in terms of choosing file systems and using them. It is foolish not to use such a resource, because with a skillful approach, we can make our system faster and safer.

So, as unworthy of a try-unixoid, we dismiss the sentence “to cut the disc in one piece,” which grows obviously from the win-world. We have our own ideas here, what to build and where to dig.
However, to begin with, it should be determined exactly how this PC will be used after installing the system on it. The markup tactics for the workstation are markedly different from the markup tactics for the server. Further, I will indicate the preferred settings for my home semi-headless server — such an intermediate option, and in a note — more optimal parameters for a (possible) highly specialized solution.
The final list of sections and their sizes are approximately as follows:
         File system Size Type is mounted on
         / dev / hda1 100M ext2 / boot
         / dev / hda2 980M swap {none}                          
         / dev / hda3 10G ext3 /
         / dev / hda4 10G {none} {none}
         / dev / hda5 10G ext3 / home
         / dev / hda6 10G ext3 / var 

Let's see if this is optimal enough?
I believe that more than. First of all - the sections are not “too much” - they are just right. Let's walk on them in more detail:

/dev/hda1 100M ext2 /boot
It is an obvious step for those who are not going to compile new variants of the system core and experiment with loaders day and night.

Pay attention to TYPE - ext2 - using the “old” format will allow you to avoid any possible problems with any bootloader.
It makes sense to place on an independent primary partition.
')

/dev/hda2 980M swap {none}
SWAP aka swap area is usually recommended to set the size of twice the size of RAM, but with a sufficient number of 1.5 factor would be more appropriate. As a last resort, we can always select another swap area on any disk and connect it to the system. The total effect from 2 areas on disks will be more than from one large area on one disk, especially the system one. By the way, if you plan to run something actively using memory, the most correct strategy would be to immediately place the swap area on another disk other than the system disk. This advice is often found and it is quite reasonable.
And here is another frequently occurring advice, “I cannot give up the paging file” as reasonable. In the event of an unforeseen situation, “saving” a gigabyte of a hard disk can be very expensive.

Again, pay attention to the TYPE - swap and the lack of a mount point - the swap partition is not required.
We place on the extended partition along with the rest of the partitions.


/dev/hda3 10G ext3 /
This, as seen from the mount point, is the root (or root) of our file system. All the directories needed by the system that have not received their own sections from us will be posted here. Including directories with installable programs and updates.

And again, the file system type, ext3 , is the journaling version of ext2, which provides faster verification in the event of a previous PC crash. Believe me when I write “faster” - I mean “VERY fast compared to ext2”. Choose this type of file system if you don’t know what to get for you.

Ps. “Journaling” is not synonymous with “redundant”. The file system log is used by it for its own needs (if you are interested - for consistency of referential integrity), the system wanted to sneeze on your data. Hence the absolutely logical rule - if you want to do it well - do it yourself! Backup yourself.


/dev/hda4 10G {none} {none}
No, this is not a typo. There really is (yet) nothing. Actually, you may not create this section, but in this case you will not have the opportunity to evaluate the silkiness and relevance of the planted straw :). The location of our NZ is also very remarkable - after root and in front of home - if one of the sections starts to grow quickly - without special problems you can double it.
Most likely this is enough for you.

Ps. Although I would recommend spending NPs gradually, it is not as fun to expand the section with the capture of empty space as redistributing the space between two contiguous points. I'm not talking about the potential insecurity of the movement of the walls, behind which someone is sitting :).


/dev/hda5 10G ext3 /home
Oh, we have already reached our "hamster"! The home section, as the name implies, provides a haven for all personal directories of users, with their users, pictures, documents, and other uncomplicated shopping. In addition, in the user's personal “folder” there are various settings, and so on and so forth. Hence, quite logical arithmetic - for each user, it is necessary to allocate 8-10G places. If you are going to actively use the system in collaboration with someone else, lay down more of my 10G space.

Ps. Not that it’s not obvious, but just in case, I remind you that when you create an ftp server on your PC in the same section, the FTP “user” will also be accommodated, just like you, you will need a place for upload, download directories and that You'll think of it there. It makes sense to think about this issue in advance. Or "expand" the directory by mounting a separate hard disk into the place of / home / ftp / upload if you are going to exchange something hard.

Pps. I hope for your prudence, but I still can not draw your attention to the obvious fact that ... The / home directory is the most valuable part of your hard disk. Make backups. Entirely or selectively, all files or only certain documents, but backups are needed. Restoring the "dead" tracks is nothing compared to trying again to collect two or three hundred pages on some not very interesting topic.

PPPS. It is obvious that the phrase “make backups” means:


/dev/hda6 10G ext3 /var
So we have reached the last (in my humble opinion) mandatory section of our system. A rather strange directory is actually quite ordinary - there are various logs / log, directory / tmp, directory / www, containing documents and scripts of your possible server and directory / lib, which for example, contains files of your MySQL database. If you are not exactly planning to make a public server with active load - you can halve the 10G offered by me - most likely there will be no problems.


By sticking to a similar plan in the disk layout when installing Linux, you can significantly save time on subsequent system maintenance and even more so on restoring it if misfortune visits your home.
"" And how are the rest xxxx on my huge disk? " - you ask. Make another section and place your favorite movies, music or something else on it.

Prepared with pod2html .

UP. Anyone who has the thought of breaking down the "horror" section 4-5 so jars:
1) It is necessary to make division into sections only once, when installing the system. You do not need to mount directories each time when loading. I do not understand what worries you.
2) For the time being, I have not heard about the tax on “extra sections”. I see no reason to make partitions smaller than desired.

Source: https://habr.com/ru/post/73827/


All Articles