Horneker Online

Home >> PCLinuxOS Support >> Planning your Hard Disk Layout...


Planning Your Hard Disk Layout for PCLinuxOS Installation

One of the biggest decisions you will need to make before you install PCLinuxOS is to plan how the hard drive on your computer is to be laid out. It is easy to let the PCLinuxOS Installer do the work for you. However, the installer may or may not have setup the best layout for your system.

Before you even begin to plan your layout...

Will You Be Keeping Your Existing Operating System?

Chances are your desktop, laptop, or notebook will already have some version of Windows, Linux (most likely Ubuntu or Mint), or Mac OS-X already installed on and configured to use your entire hard drive.

In this case, you may choose whether you want to keep your existing operating system, or you may choose to replace the current operating system with PCLinuxOS. If you are keeping your existing operating system, you will need to resize the partition so you can have enough empty space to install PCLinuxOS.

The PCLinuxOS Installer will automatically repartition any existing operating system to allow the minimum required space for PCLinuxOS installation.

Not All Windows are Created Equal

If your machine was equipped with Windows Vista or Windows 7, the manufacturer of your machine configured Windows with a hidden partition containing software needed to do a system restore. Also, these versions of Windows tend to spread data and program files all over the disk, obviously intended to make repartitioning as difficult as possible.

Windows 8.x and Windows 10 machines are configured similar to Windows 7 machines, with one controversial exception, namely the so-called Universal Extended Firmware Interface and the associated "Secure Boot" function. This feature can be disabled by quickly (and I do mean quickly) pressing a function key (usually F3 or F10) at the time you power up your machine.

Windows XP and earlier versions are much easier to deal with, and you can resize partitions with these versions of Windows.

Special Consideration for Mac Users: Mac OS-X contains a utility that must be used to create and modify partitions. This is because the bootloader is setup so that only that bootloader can be used to start Mac OS-X. Hence, you must create PCLinuxOS partitions using the Apple supplied utility, unless you plan to replace Mac OS-X with PCLinuxOS, in which case you can create the partitions with the PCLinuxOS Installer utility.

If you have a UEFI enabled machine: The gpart utility is recommended for (re)partitioning hard disks as UEFI machines do not boot from a traditional master boot record, but instead run a firmware application contained in the /boot/EFI folder that allows PCLinuxOS (or another operating system) to boot.

However, if you can disable the so-called Secure Boot from your machine's setup utility (usually by quickly pressing F10, F12 or whatever to get into what we at one time called the BIOS setup), that would make it easier to install PCLinuxOS, especially if you choose to make PCLinuxOS your only operating system on that machine, because if you disable Secure Boot, you will not need to run gpart before you run the PCLinuxOS installer.

Always Backup Your Data Before Doing Anything Else

No matter which operating system you are using, be sure you have some means in which to backup all of your user data. This includes all of your documents, photographs, audio files, and anything else you store in your home directory.

The easiest way to do this is to backup your files to a external hard drive. You may use a flash drive or memory card (SD/MMC, Memory Stick, or Compact Flash). Just be sure there is enough capacity on the flash drive or memory card to store what you need to backup. You may also use blank CD-R(W), DVD-R(W), or DVD+R(W) discs to backup your data.

CD and DVD discs are cheaper storage than flash drives, hard drives, or memory cards. But then, you need to use CD/DVD mastering software to create your backups, whereas you can accomplish the same task with the latter three medium by simply copying files from your home directory to the medium.

If Possible, Create System Restore Disks

When I purchased my laptop, the first thing I did was to create a set of system restore DVDs. This allows for reinstallation of the original operating system if you need to do so. Even if you choose to make PCLinuxOS your only operating system, it is a good idea to have restore disks available, unless you are absolutely sure you will not want to restore the original operating system.

These days, some hardware manufacturers such as Dell provide a downloadable utility to create a system installation image that can be written to a USB thumb drive.

If this is not possible for your machine, then I recommend using a disk imaging program such as Clonezilla and an external hard drive (or a large enough USB thumb drive) to create a backup of your original system configuration.

How Much Space to Allocate?

The next step is to determine how much hard drive space to give to each operating system to be installed on your computer. PCLinuxOS requires a minimun of 15GB (absolute) to 20GB of hard drive space for a minimal installation.

IMO, the more storage you can allocate to PCLinuxOS, the better. Your PC or Mac will thank you for it.

How much space you give depends on several factors, namely:

Obviously, the larger the hard drive, the more space you can have allocate. You can run PCLinuxOS off an external hard drive, but that is a topic for another page.

Desktops Only: You can have more than one hard drive installed on your system, if your desktop system supports more than one drive. This is not the case with a growing number of newly manufactured desktops, especially with the all-in-one models, or the newest iMacs. Having more than one hard drive installed allows for PCLinuxOS to be installed on a hard drive separate from the original operating system.

Even then, you will have to install the bootloader on the startup hard drive, and configure that bootloader to boot PCLinuxOS from the hard drive where PCLinuxOS is installed.

Allocating Space for PCLinuxOS

The simplest way to allocate space is to allow the PCLinuxOS installer utility to allocate space for you. If you allow the installer to automatically allocate space, then about 7GB is allocated for system use, a partition size twice your physical system memory is allocated for swap space, and the remainder of free space is used for user home directories.

This configuration is intended for those who simply want a working PCLinuxOS installation for basic use.

If you are planning a development system, i.e. you want to develop applications for PCLinuxOS, you will want about 20GB of space for system use, at least twice your system memory for swap space, and as much space for user home directories as possible.

If you are planning to use your system for extended multimedia development (i.e. video editing, extensive audio editing and processing), or are building a home entertainment system with PCLinuxOS (which is quite awesome), or intend to compile TeX and LaTeX documents to (either for printing to a printer or stored to PDF files), then you are going to want at least 40GB for system use, three times the physical memory for swap space, and as much space for user home directories as possible.

These figures are for the minimum recommended amounts of disk storage you will need to allocate for the aforementioned tasks. Again, the more space you can allocate, the better.

By system use, I mean enough space allocated for the /usr, /var, /etc, and /tmp directories.

Partitioning for System Use

/boot is where the system kernel, the kernel modules and the boot image (called vmlinuz) are stored. You should allocate at least 512MB for this at the beginning of the system installation partitions or the entire hard disk (if PCLinuxOS is to be your only operating system) to ensure that PCLinuxOS will boot.

If your machine is equipped with UEFI, you will also have a /boot/EFI directory where the firmware application is stored in order to be able to boot PCLinuxOS. In this case, I recommend allocating at least 2GB of space partitioned for the /boot directory to make sure all required files are present in order for PCLinuxOS to boot. However, if you disabled Secure Boot, then you may allocate the same amount of space for a non-UEFI machine.

In practice, I would allocate at least 1GB of space in a separate partition for non-UEFI systems and 2GB for UEFI systems whether or not Secure Boot is enabled. Of course, UEFI files are still needed even if Secure Boot is disabled on UEFI systems.

/bin is where binaries intended to be used by the system administrator and by the Linux kernel are stored.

/sbin are where the system administration utilities are stored. Files placed here are not intended to be executed directly. One exception is when you have VirtualBox installed and you upgrade the kernel. The /sbin/vboxconfig utility rebuilds the kernel modules used by VirtualBox against the newly installed or upgraded kernel.

/usr is the directory where system applications and utilities (and their configuration files and application data) are stored. /usr/local is intended for installation of third party software local to this particular machine. The latter could be used for a system wide installation of software compiled from source. In practice, it is better to use the /opt directory for that purpose to ensure that nothing in such an installation conflicts with the PCLinuxOS installation, or worse that nothing does something to compromise your PCLinuxOS installation.

/etc contains system configuration files.

/tmp is used for temporary files, such as UNIX pipes, which are created and deleted by applications, desktop enviromnents, and the Linux kernel itself. There is no reason for users to create anything in this directory. However, when you upgrade LibreOffice, you have the option to keep the downloaded files (weighing in at more than 200MB). These files are kept in the /tmp directory, and you may copy them to an empty directory for backup purposes (in case you need to reinstall the product).

/var is used for storage of databases, fonts (used by Texlive or TeTeX), mail, print jobs (used by the CUPS spooler), and other data, which should be stored on the system, but not in the user directories.

It is important to give as much partition space to the above directories as possible. If you give too little space for system use, your system will crash when disk space here is depleted. I recommend no less than 50 percent of all space allocated for PCLinuxOS to be for system use.

Allocating Swap Space

As with any Linux distribution, PCLinuxOS requires at least two partitions be allocated, one for the PCLinuxOS installation, and the other for swap space. (UEFI systems will need an extra partition for the UEFI configuration files, in addition to the required partitions for Linux installation.)

Why is a swap partition required?

Modern operating systems use two types of memory to manage processes. They are physical memory, or the physical memory installed in your system, and virtual memory, that is memory simulated using a hard drive.

As programs use memory, they use the physical memory that is available for access. When that memory is used up, the operating system then simulates additional memory by swapping segments of physical memory (generally those not currently being used) between the physical memory and the hard drive.

Under Windows (and OS/2, including ArcaOS for that matter), virtual memory is implemented as a dynamically expanding file on the hard drive. This is the case, even with Windows 10! The problem here is that by sharing disk space between applications and swap space, your Windows machine will use valuable hard drive space that could be used to store data and programs.

Linux (and UNIX in general) avoids this problem by keeping the swap space in a disk partition separate from the partition where the operating system is stored.

In general, you want to be sure you allocate enough swap space so that PCLinuxOS can run effectively. The PCLinuxOS installer automatically allocates twice the physical memory for that space in a separate partition. Many Linux experts, including myself recommend this amount as it is optimal for most Linux usage.

However, if you are planning to implement a home entertainment system, or perform something that requires intensive system resources such as video editing or high quality audio recording, I recommend at least three times the amount of physical memory for the swap space.

If you are implementing a server for heavy usage, I recommend at least four times the physical memory for the swap space. This is due to the memory accesses required to support multiple users at the same time on the server.

Allocating Space for User Data

For those of you who are coming to PCLinuxOS from Windows (or OS/2 and ArcaOS), you are used to having one partition for both the operating system and user data. Ubuntu (as well as Mint, Pop!OS, Deepin, and other Ubuntu derivatives) implements the default layout as one partition for swap space, and one partition for everything else. This is, of course, to make it easy for those of us who are migrating from a non-UNIX environment.

However, creating partitions to separate data from the program and system files is a very good idea from a system administration perspective. The PCLinuxOS installer creates this type of layout by default.

First, it makes changing and/or upgrading Linux distributions much easier. No reinstallation of user data is required, though it is a good practice to always backup the data in that partition.

Speaking of backups, data backups are easier when all the user data is in a single partition.

Other Ideas for Partitioning

Placing /tmp in a separate partition does for temporary files what swap space does for memory. Just be sure you take care to allocate sufficient space for that partition. If you allocate too little space for /tmp, PCLinuxOS will crash as it will be unable to execute programs that will need to create temporary files or pipes.

If you have installed a hard drive that is bigger than what your system can support (i.e. exceeds the limit imposed by the BIOS on your system), you may create the first available partition of your hard drive and assign it to the /boot directory. The /boot directory stores the kernel, the bootloader configuration files, and everything else needed to boot PCLinuxOS. Usually, you would want to assign about 1GB to this partition as that is all the space needed for the kernel and the bootloader files.

What I Recommend

For home and small business use, I recommend a layout consisting of one partition for the PCLinuxOS installation, allocated to 50 percent of the total space allocated for PCLinuxOS, one swap partition allocated to twice the amount of physical memory, and a third partition for the user data files.

If you are implementing a server, install as large of a hard drive as what you can afford. Then, I recommend a layout consisting of one partition for the PCLinuxOS installation, allocated to 25 percent of the total space allocated for PCLinuxOS, one swap partition allocated to four times the amount of physical memory, one partition for the /var where spoolers, databases, mail, and other application created data are stored, and a fourth partition for the user data files, which should be the remainder of the hard drive as you will need as much space as possible for your users. Here, disk space for users is the main priority over the space needed for system files.