====== Disk Partitionning ====== At the beginning of the system installation process you'll be asked to decide whether you prefer a regular partitioning scheme or a custom one. Choosing the default partitioning is perfectly OK and will "simply" create one big partition that will contain all of your system's files, as well as all the documents you'll create. That said, there are many considerations that might push you to choose a custom partitioning scheme, reading this article might open your eyes to the interest that may be to partition your hard drive. [[http://content.hccfl.edu/faculty/wayne_pollock/AUnix1/Partitioning.htm]]\\ Also, when time comes to think about backups, your partitioning scheme could make a difference in the options you may have regarding your backup policy. To learn more about the subject, please consult the [[applications:backup|Backup]] page before making a decision. ===== Basic Partitioning ===== In case you "simply" want to grant yourself the option to separate the system files from your personal documents (translate this to: any user's created document), a basic custom partitioning scheme would be to create a separated "/home" partition. As discussed below, the effective space reserved for the "system", or "/", partition and the one reserved for your "/home" partition cannot be determined absolutely. It all depends on the available space on your hard disk drive and the type of work you intend to execute on the machine. It is generally called your own "use case". If you still want an indication of the volumes to be allocated, consider that about 50GiB is probably a minimum for your system, outside of the "/home" partition that could then use the rest of the available space on your hard drive. ===== Custom Partitions Sizes ===== First of all let's state it clearly: > **There is no such thing as the perfect partitioning scheme** What you'll find here is simply the plan I chose to apply to my hard drive, along with a few justifications regarding what drove me to this decision. As we will discuss later, regardless of your total available disk space, the EFI (or boot) and swap partitions can, more or less, be fixed. The same could be said for the / and /tmp partitions as long as the /home, /var and /opt are separated, although they both certainly could accommodate a larger space when a quite large drive is available. It is always a good idea to plan your partition map in advance, and document it so that you can recall what was done and why. Here is the plan for the partition map on the 160 GiB drive I'll be using here: ^ Part/LV name ^ Mount Point ^ Size ^ Note ^ | 0 | EFI | 200MB | | | 1 | / //(root)//| 35GB | | | 2 | //Swap// | 4GB | based on 4Mb of RAM | | 3 | //logical// | 120GB | LVM physical volume for group VG1 | | homeLV | /home | 70GB | Logical volume in VG1 | | varLV | /var | 22GB | Logical volume in VG1 | | tmpLV | /tmp | 10GB | Logical volume in VG1 | | optLV | /opt | 23GB | Logical volume in VG1 | ===== EFI or BIOS Partition ===== ==== EFI Partition ==== Since my system uses an EFI (Extensible Firmware Interface), it needs an EFI System Partition (or ESP). Thus, the very first partition I will create is a 200MiB, fat32 one. It will hold a filesystem, various boot-loaders, drivers, as well as other files and there will still be plenty of space left for future needs. ==== BIOS Boot Partition ==== If your system is using a BIOS (Basic Input/Output System), you'll need a boot partition, specifically on GPT disks. You can learn more about this reading the following article: [[http://en.wikipedia.org/wiki/BIOS_Boot_partition]].\\ Anyways, a BIOS Boot partition has to be the first one on the disk and a 1MiB size is adequate. ===== Root Partiton (/) ===== Has to be bootable (i.e. have the boot flag set), and on older motherboards it must be located within the first 1,024 cylinders of your drive or you can't boot from it. Although that isn't necessary with modern motherboards I chose to have it as the first partition on my disk (after the EFI). This would include the kernel itself and the boot-loader configuration file (e.g. grub.cfg) amongst others. It will also hold all of your system files, as stated earlier it could span the whole space left on disk, but here I'll limit it to 35 GiB since the plan is to separate the /home, /opt, /var and /tmp directories. Please note that /bin, /lib, and /etc should always be part of the / partition as it is the only one that gets mounted at boot time and is accessible by the init program that needs to access files in /etc, /lib and /bin (sometimes to /usr/bin also). ===== Swap Partition ===== If the system runs out of physical RAM and cannot access a swap space (partition or file), it would crash.\\ To avoid this situation it is always important to have a swap space available, a general rule is to allocate at least the same amount of swap space as the available RAM to support features such as hibernation and crash dump analysis. Thus here we'll go for 4 GiB. ===== Logical Partition (LVM) ===== Since there is an OS-imposed limit on the total number of partitions, using logical volume management, one can create as many filesystems as makes sense in a given situation. In this case we'll reserve whatever is left available on the disk. ===== /tmp Partition ===== VMware recommends making the /tmp filesystem at least one and a half times the amount of virtual memory on your system. Other systems might have specific needs at that level (like database services). You should check on that subject with the specific services you plan to run. ===== /opt Partition ===== The size depends on how much software you plan to install there. ===== /var and /home Partitions ===== Once you have made a decision on the aforementioned partitions, comes the time to decide how to balance the space that is left between /var and /home. Once again that question is totally dependent on the type of usage you'll make of the system.\\ As a web developer, the /var/www directory is probably going to grow as time goes by, also /var/log could become an important space eater... It could even maybe become a separated partition one day. ====== Conclusion ====== Let's finish this section as we started it by saying that: > **There is no such thing as the perfect partitioning scheme** I simply hope that this introduction to the subject gave you sufficient insight to allow you to make an educated decision on the partition scheme that would best fit your particular hardware and use case. ===== My Final Partition Scheme ===== Well, if of any interest after all this, my final partition scheme (for a 250GB SSD) is as follow: {{ :install:gparted-ssd-partitionning.png?direct&200 |}}