Skip to the content.

Linux Image

Disclaimer: the information presented here is for reference only and nothing should be considered as written into stone. Keep this in mind while planning your setup and adjust the values accordingly.

Partitioning

The big decision to make when configuring Linux is how the hard drive space should be partitioned.

The design proposed here allows for dynamic growth and fine-tuning when needed. Being caught off guard in a scenario where there is no more storage space available, with no immediate option other than deleting files is never a good experience. The long-term life and growth of the system, as well as budgetary concerns, must be taken into account.

Isolating the root volume, especially for static data that does not grow much over time, is the central concern. Isolating the other directories in their own volumes will be the strategy adopted here so that their dynamic growth does not affect the root partition. Filling the root volume in a system is a very bad thing and should be avoided at all costs. By segregating partitions, we have a bunch of options to act, like increasing one partition and/or reducing another, for example, since the volume is not 100% occupied by the logical volumes (partitions).

Partitions may be increased later, but this is how our volumes will be initially divided for the system installation:

Partition Size Description
boot  512 Mb   Boot loader files (ex: kernel, initrd). Single space residing outside the Logical Volume Manager (LVM)
root  2 Gb   Operational System (/bin, /lib, /etc, /sbin)
home  2 Gb   User directories.
opt  1 Gb   Static application packages.
tmp 1 Gb   Temporary files.
usr  10 Gb   Secondary hierarchy for shared user data which access is restricted for read-only.
var  10 Gb   ”Variable” files, such as logs, databases, web pages, and e-mail files, container images, etc.

Reference: http://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html

Software

The installation of software packages that make up the base image is necessary to avoid repetition of work in the other VMs that will be created based on it.

Since we are using VirtualBox as our virtualization system, an important software that should be part of every image is VirtualBox Guest Additions, as well as its dependencies.

The softwares to be installed are the following:

Reference: apt-cache show package-name

Create the Linux image

Please follow the steps described here.

Again, keep in mind this is for reference only and nothing should be considered as written into stone. Keep this in mind while planning your setup and adjust the values accordingly.

Or, if you prefer to download the base image

Debian

~$ cd ~/VirtualBox\ VMs/
~$ curl -L --progress-bar "https://vms-image.s3.amazonaws.com/debian-base-image.tar.bz2" -o - | tar xjf -
~$ vboxmanage registervm ~/VirtualBox\ VMs/debian-base-image/debian-base-image.vbox

Ubuntu

~$ cd ~/VirtualBox\ VMs/
~$ curl -L --progress-bar "https://vms-image.s3.amazonaws.com/ubuntu-base-image.tar.bz2" -o - | tar xjf -
~$ vboxmanage registervm ~/VirtualBox\ VMs/ubuntu-base-image/ubuntu-base-image.vbox