Mount a Drive on Linux - Best Method ?

This article covers the process of Mounting and unmounting a drive or an ISO image in Linux. After creating disk partitions and formatting them properly, you may want to mount or unmount your drives.

On Linux, mounting drives is done via mountpoints on the virtual filesystem, allowing system users to navigate the filesystem as well as create and delete files on them.

How to List Mounted File Systems and Linux Drives ?

To display all currently attached file systems we will type:

$ mount

By default, the output will include all of the file systems including the virtual ones such as cgroup, sysfs, and others. Each line contains information about the device name, the directory to which the device is mounted, the filesystem type and the mount options.

How to install NFS client on Ubuntu and Debian ?

NFS stands for Network File System. To mount an NFS share you'll need to have the NFS client package installed on your Linux system.

1. To install NFS client on Ubuntu and Debian, type:

$ sudo apt install nfs-common

2. To install NFS client on CentOS and Fedora:

$ sudo yum install nfs-utils

Ansible Roles and How to Use them in Playbooks

This article covers how to Create Roles and Use them in Ansible Playbooks. Ansible is a configuration management tool that is designed to automate controlling servers for administrators and operations teams. With Ansible you can use a single central server to control and configure many different remote systems using SSH and Python as only requirements. Ansible carries out tasks on servers that it manages based on task definitions. These tasks invoke built-in and community maintained Ansible modules using small snippets of YAML for each task.

However, playbooks can become complex when they are responsible for configuring many different systems with multiple tasks for each system, so Ansible also lets you organize tasks in a directory structure called a Role. In this configuration, playbooks invoke roles instead of tasks, so you can still group tasks together and then reuse roles in other playbooks. Roles also allow you to collect templates, static files, and variables along with your tasks in one structured format.

Create a Bootable USB Drive Using Ventoy - Best Method ?

This article covers how to Create Multiboot USB from Linux Using Ventoy. A bootable USB is commonly used as an operating system installer. To create bootable USB download appropriate .iso,.dmg or .img file and then copy/unpack to a USB.

Commonly, at a time one ISO image is used in a USB and have to reformat drive each time to boot another Operating system. This will end up with many bootable USB drives to keep.

The idea is to get the USB drive ready for multibooting. Then you can copy the ISO images of the operating systems that you want in the first partition. Ventoy will then search for them and list them in alphabetical order on the GRUB menu.

Ubuntu "E: Could not get lock /var/lib/dpkg/lock" error - Fix it Now ?

This article covers methods to remove locked files and processes from Ubuntu Linux system to allow you use the APT package manager for other operations. 

The dpkg service locks itself so that two processes don’t update the content simultaneously. The service is locked to avoid potential corruptions in the system. However, it also means that the user cannot, for example, run a simple apt command.

In Ubuntu, you may sometimes encounter an error when attempting to run an apt command:

Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

This message lets you know that dpkg, the Debian Package Manager service, is unavailable.

Use the options in this guide to resolve the Ubuntu "Could not get lock…" error.

Install Elasticsearch on CentOS 8 - Best Method ?

This article covers the installation and basic configuration of Elasticsearch on the CentOS system. For how to use Elasticsearch, visit the Quick start guide available on its website. Elasticsearch is an open source search and analytics engine that allows you to store, search, and analyze big volumes of data in real time. Elasticsearch powers millions of Applications that rely on intensive search operations such as e-commerce platforms and big data applications. 

Elasticsearch supports RESTful operations. This means that you can use HTTP methods (GET, POST, PUT, DELETE, etc.) in combination with an HTTP URI (/collection/entry) to manipulate your data. The intuitive RESTful approach is both developer and user friendly, which is one of the reasons for Elasticsearch's popularity.

Run Shell Script as Systemd Service in Linux

This article covers how to run your own shell script as a systemd service. Basically, Systemd is a software application that provides an array of system components for Linux operating systems. It is the first service to initialize the boot sequence. This always runs with pid 1. This also helps use to manage system and application service on our Linux operating system.

How to Enable New Service in Linux?

1. To reload the systemctl daemon to read new file, execute:

$ sudo systemctl daemon-reload 

2. To enable the service to start on system boot, also start the service using the following commands:

$ sudo systemctl enable shellscript.service 
$ sudo systemctl start shellscript.service 

3. To verify the script is up and running as a systemd service:

$ sudo systemctl status shellscript.service

Related Posts