Planning Your PCLinuxOS Installation

...or what you should do before installing PCLinuxOS

First Things First

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 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.

However, if you are using a recent ISO image of PCLinuxOS, that image contains all the files necessary to install on UEFI equipped systems, hence the disabling of UEFI may not be necessary.

Windows XP and earlier versions are much easier to deal with, and you can resize partitions with these versions of Windows. Just make sure your PC can boot a 64-bit operating system as PCLinuxOS is available only as a 64-bit x86 release.

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.


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, external 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.

Unfortunately, newer PCs do not come with a utility to create such backup medium, nor do they come with built-in DVD writers. Solutions such as Clonezilla (booted from a USB flash drive or memory card) overcome this limitation to some extent. Some laptop and desktop computer manufacturers (such as Dell) provide a utility you can download and install on a USB flash drive that accomplishes the same task.

Even if you choose to make PCLinuxOS your only operating system, it is a good idea to have restore disks available (especially when it comes time to sell your old machine), unless you are absolutely sure you will not want to restore the original operating system.


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.

According to the PCLinuxOS website, PCLinuxOS requires a minimun of 15GB of hard drive space for a minimal installation.

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

  • The physical capacity of your hard drive.
  • The number of operating systems you plan to install on your hard drive
  • How you are going to use your computer
  • How many people are going to use your computer

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.

Another trend found in today's desktop and laptop computers is the use of Solid State Drives and eMMC modules for disk storage, the latter being on the low end laptops to save manufacturing costs. Many of these machines have no space to place a second disk of any type, either to save on manufacturing costs, or as part of the CPU attached to the widescreen monitor design to save space and gain some aesthetic in the process.

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 a small amount of disk space 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. I do not recommend this configuration as you will not be able to add software to the installation without worrying about running out of space to install applications. (Spoiler Alert: Software installed from the repository goes into the /usr or /opt directories, both of which are part of the space allocated for system use.)

If you are planning a development system, i.e. you want to develop applications for PCLinuxOS, you will want about 40GB 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), then you are going to want at least 80GB for system use, three times the physical memory for swap space, and as much space for user home directories as possible.

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 1GB 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.

For system use, you should allocate enough space to store the following subdirectories:

/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.

/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. These substructures are intended for use by system applications executed by the user.

/opt is another directory where applications (such as LibreOffice, VirtualBox, are Eclipse) are stored. Some application developers choose to use /opt instead of /usr or /usr/local in order to keep components of their applications separate from the rest of the PCLinuxOS installation. Also, /opt is used when the application and its files are to be kept in a specific directory layout for easier maintenance of the application, not to mention cross compatability between operating systems, such as FreeBSD, Mac OS-X, NetBSD, and OpenBSD, not just the Linux distributions.

/etc contains system configuration files.

/tmp is used for temporary files, 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.

/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 these 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.

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 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), you are used to having one partition for both the operating system and user data. Ubuntu 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.

This means that the /home directory would be created on a separate partition on the same disk. Doing so 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.

However, keep in mind that you will need to make sure that you allocate enough disk space to accommodate additional software, as well as space for the /var and /tmp directories as these directories get significant use by the PCLinuxOS installation and any applications running on it. Otherwise, your system will crash due to insufficient storage space available to store data.

Speaking of backups, data backups are easier when all the user data is in a single partition. Just be sure to also allocate sufficient space to store your data, such as documents, music, video, photographs, and so forth.

This is one reason why I recommend the following layout:

  • One 1GB partition for the /boot directory
  • Two to four times the memory in your system for swap space
  • The remainder of the disk for everything else (partition mounted at / (the root directory to cover everything else)

Other Ideas for Partitioning

Placing /tmp in a separate partition does for temporary files what swap space does for memory.

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 (including those needed for UEFI systems).


What I Recommend

For home and small business use, I recommend a layout consisting of one partition (of 1GB) for the kernel and bootloader, a swap partition twice the size of the physical memory in your laptop or desktop computer, and a single partition for everything else.

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.

Considerations for Solid State Drives and eMMC Storage Modules

While the SSD and eMMC modules perform faster than traditional hard drives, there are special considerations that need to be taken when PCLinuxOS is used.

When a file is erased from the disk, the physical sectors the file occupied do not automatically get erased. instead the effected sectors are made available in the allocation tables on the disk. When a new file is written to the disk, the sectors (or portion of the sectors) made available gets used when writing files to the hard disk.

This is not the case with Solid State Drives. New files are generally written to completely empty sectors on the disk. This means that data that would have been made available on the traditional hard drive is not available on the SSD.

Fortunately, the linux-tools package contains a utility called fstrim, which clears out sectors used by deleted files so those sectors can be made available for use with new files.

The basic function of the fstrim is to make sectors of the SSD available where deleted files no longer occupy.

To use this command, login as root (with the su command and type in the following:

fstrim / -v /dev/sda

...then wait for the command to finish. The utility will print out the amount of free space available on your SSD after erasing sectors that contained deleted files.

It is a good idea to run this command once a week to keep your SSD working properly. However, do not do it too often, or you will degrade the performance of the SSD. Even flash memory technologies such as SD/MMC, eMMC and USB flash drives have a finite lifespan, as solid state drives contain the same technologies used in memory cards and flash drives.

So why use a SSD instead of a traditional hard drive?

SSD drives perform faster than traditional hard drives. They do not have moving parts that can fail. SSD drives tend to keep the laptop or desktop running cooler. (My HP Compaq 8510p has been known to overheat at times with a traditional hard drive when placed on a flat surface. The SSD has done wonders for this 14 year old machine.)