Archive for March, 2024

LVM Part 1: Physical Volumes

📅 March 31, 2024
Linux has a number of handy technologies built in that have existed for a long time but seem to receive little attention because they are taken for granted or simply not talked about.

One of these is logical volume management (LVM) that allows us to treat hard drive storage space in a way similar to RAM. Comparable to adding another memory stick to expand RAM, we can add more hard drives to expand hard drive storage space. Need more secondary storage? Just add another hard drive.

This simple concept is incredibly versatile and saves time by eliminating the need to backup and restore data following a new drive addition to a system. It requires some extra steps to set up and has a few specific terms to learn, but the benefits are worthwhile.

LVM consists of three layers to create a working storage system. In this part, we will focus on the physical drives themselves, called physical volumes. These can be mechanical hard drives, SSDs, SAS, or even super fast NVMe storage devices.

Read the rest of this entry »

, ,

Leave a comment

Bash: Typed Variables with declare

📅 March 23, 2024
Variables are untyped in Bash by default, but there might be times when we need to create variables that hold only specific data types or have specific purposes.

The declare command allows us to achieve this in order to add extra protections on variables, and there are a few different types allowed.

Need a variable that only stores lowercase strings? How about an integer only and reject all other values? Maybe you need an indexed or associative array? Perhaps you need to create a constant?

Read the rest of this entry »

,

Leave a comment

Bash: The let Keyword

📅 March 18, 2024
JavaScript has the let keyword that creates a variable with scope.

Bash has the let keyword too, but it serves a different purpose.

Read the rest of this entry »

,

Leave a comment

What is nohup?

📅 March 17, 2024
“Help! I need to keep a program running after closing the terminal.”

There can be times when we connect to a remote system via SSH, for example, and we need to run a lengthy process on the remote system. However, we also might need to log out or close the connection, but we want the process to continue running.

Normally, the process terminates when the terminal is closed.

nohup is a way to keep a remote process running even after the terminal is closed.

Read the rest of this entry »

,

Leave a comment

Redundant Synchronized Pi-Hole with keepalived and gravity-sync

📅 March 4, 2024
“Help! When Pi-Hole goes down, nobody can access the Internet!”

Pi-Hole is a superb network-wide ad blocker because it blocks connections to forbidden domain names listed in its blocklists when resolving DNS requests, but if Pi-Hole hangs up or is inadvertently turned off for whatever reason, then domain names cannot be resolved and it seems like the Internet is down.

To help protect against this and provide some form of resiliency, we can mirror two Pi-Hole instances so if one goes down, the backup will take over, and users can still access the Internet.

This is simpler than it sounds thanks to a service called keepalived. Let’s see how to set up two Pi-Hole instances using a virtual IP address (VIP) to provide high availability (HA).

Read the rest of this entry »

, ,

Leave a comment