Analysis and Design
The Ubuntu Server Long-Term Support (LTS) is great choice for companies because it is a solid operating system that happens to be free. If professional support is needed, there is an option to buy support for the Long-Term Support (LTS) versions of the operating system.
The large decision over the configuration of Ubuntu is how the hard drive space is sliced up (partitioned). This documentation will focus on partitioning the drives in such a way that it allows for growth depending on what is needed for the specific application.
This following design allows for dynamic growth and fine-tuning if need be. Being caught offguard with a scenario where space is filled up with no immediate option other than deleting files is never a good thing. Long-term life and growth of the system as well as budgeting concerns have to be taken into consideration.
Isolating the root volume to mainly just static data that will not grow much over time is the central concern. Pushing the other folders into their own volumes will be done so their dynamic growth will not affect the root partition. Filling up the root volume on a *nix system is a very bad thing and should be avoided at all costs. The file systems will also not take up 100% of the logical volume. This will allow the file systems (through automated scripts) to grow as needed and give the administrators some time to add more drives if necessary or shrink other volumes to get more space.
The volumes will initially be sliced up as follows:
- boot - This will remain static in size. It is also the only space residing outside the Logical Volume Manager (LVM)
- root volume - Operating system and everything else which should remain fairly static.
- home volume - This is where personal files will be stored but likely not be used in most server configurations.
- tmp volume - This location will be used for temporary storage. Size should be adjusted to match however it is being used.
- usr volume - This will contain mostly static data and should not grow unexpectedly.
- var volume - This is the app/database/log storage and will continue to grow over time.
- srv volume - This will contain the files stored in the Samba share.
- opt volume - This will contain specific software you add but may not be utilized at all depending on configuration.
- bak volume - This will contain a local backup of the server/applications/data. So space needs to be about double the size of your application data (typically double the /var and /opt size).
- Offsite Storage - This will be handled elsewhere. A backup server will access this server to pull backup data. It is wise to make sure no servers can access the backup server for security reasons.
The partitions will be increased later as needed but will start off with a minimum size due to how the installer expands the file system to fill up all available volume space.
To get a good idea of the initial hard drive layout and to understand the process better, here is a graphical representation of the initial design for the server:
>> CREATE IMAGE FOR 22.04 <<
These numbers will be used for the initial build of the system:
boot = 1 GB
root = 5 GB
home = 0.5 GB
tmp = 1 GB
usr = 3 GB
var = 1 GB
srv = 0.5 GB
opt = 0.5 GB
bak = 2 GB
Important information
- When the logical volumes and file systems are initially created, they consume the maximum amount of space allocated which means the file system size will initially equal the logical volume size. These partition sizes above are artificially small for that reason. These will be later modified so that the logical volume will be larger than the file system so that the file system has room to expand when needed in a safe and automated manner.
- If you want, you can initially allocate a larger disk such as a 50 GB drive rather than adding the 2nd and 3rd disk as noted in these steps. These are just examples on how to manage and expand your storage when needed.
- The /tmp folder is strictly temporary. By default, each time the server reboots, this folder is deleted and re-created.
- The /bak folder will retain the most recent backup and is considered the "local" copy of the backup and where the remote backup server will pull backups from.
VMware Virtual Machine Settings
- Configuration: Custom
- Name: srv-ubuntu
- Datastore: DS3400-LUN0
- Virtual Machine Version: 8
- Guest Operating System: Linux, Version: Ubuntu Linux (64-bit)
- Number of virtual processors: 1
- Memory Size: 1 GB
- Number of NICs: 1
- NIC 1: VM Network
- Adapter: VMXNET3, Connect at Power On: Checked
- SCSI controller: LSI Logic Parallel
- Select a Disk: Create a new virtual disk
- Create a Disk: 25 GB, No thin provisioning, No cluster features, Store with the virtual machine
- Advanced Options: Virtual Device Node = SCSI (0:0)
- Remove Floppy Drive
- Mount CD/DVD Drive to Ubuntu ISO (ubuntu-20.04-server-amd64.iso). Make sure CD/DVD is set to Connect at power on
- Set boot options to Force BIOS Setup so you can set CDROM to boot before the Hard Disk
VirtualBox Virtual Machine Settings
- Name: srv-ubuntu
- Operating System: Linux
- Version: Ubuntu (64 bit)
- Memory: 1 GB
- Check - Start-up Disk
- Create new hard disk
- VMDK
- Dynamically allocated
- Size: 25 GB
- Select srv-ubuntu and click Settings (CTRL+S)
- System, Processor, Enable PAE/NX
- Network, Attached to: Bridged Adapter, Advanced, Adapter Type: Intel PRO/1000 MT Server
- Storage, IDE Controller, Choose a virtual CD/DVD disk file, ubuntu-22.04-server-amd64.iso
Install PuTTY
When running inside a virtual machine, the response time for screen refreshes can be painfully slow to view man (manual) pages and navigating in VI (text editor). However, when using PuTTY via SSH, it is a far better solution for your Ubuntu console because it handles the screen draws much faster when scrolling and allows copying and pasting text between windows.
For example, selecting and copying a command in this document and then right-clicking in the PuTTY window will paste the command and have it ready to execute. Any text/lines highlighted with the mouse will be automatically copied into clipboard memory on the PuTTY window.
Download the portable edition and run the install...except it does not really "install" like a normal program, it simply extracts to a specified folder and will run from that folder even if you put it on a USB stick and carry over to a new computer (requires no install to run and thus leaves no footprint on your Windows system)
- Start PuTTY
- Under Window - Translation - Remote character set, select UTF-8
- Type the following and click the Save button:
Host Name: SRV-Ubuntu (or the IP such as 192.168.107.2)
Port: 22
Connection type: SSH
Saved Sessions: SRV-Ubuntu
- Now all you have to do is double-click on the session and it will connect to your server (when online).