horneker online

Planning Your Hard Drive Layout

One of the biggest decisions you will need to make before you install Slackware is to plan how the hard drive on your computer is to be laid out. 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 Slackware. If you are keeping your existing operating system, you will need to resize the partition so you can have enough empty space to install Slackware.

Utilities such as Partition Magic can do the resizing for you. Be sure to backup all your data before repartioning your disk or you will risk losing all of your data stored on your hard drive!!!

Not All Windows are Created Equal

If your machine was equipped with Windows Vista (or later), chances are 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 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.

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.

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. For starters, you are going to need at least 10GB of free space for a complete (and recommended) Slackware 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.

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 Slackware to be installed on a hard drive separate from the original operating system.

Allocating Space for Slackware

When you boot the installation DVD (or CD if you are using the CD set), you will be logged into the root (administrator) account. Remember, most everything in Slackware must be configured manually. Slackware provides two utilities to allocate disk space, namely the classic fdisk and the (far better) cfdisk. I recommend the latter utility as it is far easier to use than the former.

I recommend a 512MB partition for the system kernel (named /boot), a swap partition twice the physical memory in your computer, and the rest for the entire system including home directories.

Partitioning for System Use

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

/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 Slackware to be for system use.

Allocating Swap Space

As with any Linux distribution, Slackware requires at least two partitions be allocated, one for the installation, and the other for swap space.

About Swap Space and Virtual Memory, or Why is this 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 7 (and later). 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 Slackware can run effectively. Many Linux experts, including myself recommend twice the size of your physical memory in your computer 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 Slackware 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.

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.

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 Slackware. Usually, you would want to assign about 120MB 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 Slackware installation, allocated to 50 percent of the total available disk space, 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 Slackware installation, allocated to 25 percent of the total available disk space, 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.

If your server can accommodate more than one hard drive, I recommending installing a second hard drive for user files, and the first hard drive for the Slackware installation as previously described.