How to export block devices list as JSON

Export block devices list as JSON and parse using jq utility. ...

How to parse apt history log

Use awk to parse apt history log and filter it. ...

How to display kernel slab cache information

You can directly inspect kernel slab allocator statistics (/proc/slabinfo file) for detailed information on buffer, inode, dentry, or other caches in the Linux kernel, though slabtop utility will sort and pretty-print information in real-time. ...

How to configure swap using zram at boot

Configure compressed swap using zram device at system boot. ...

How to use compressed RAM based block devices

Take advantage of compressed RAM based block devices to create temporary filesystems and swap disks. ...

How to ensure that OpenSSH client uses explicitly configured authentication identity

Ensure that OpenSSH client uses explicitly configured authentication identity even if authentication agent offers more identities. ...

How to fix multipath daemon error about missing path when using VirtualBox

Fix multipath daemon error about missing path when using VirtualBox. ...

How to restart systemd service in case of failure

Configure systemd service to be restarted in case of failure. ...

How to determine which services need to be restarted

Use needrestart utility to determine which services need to be restarted after the upgrade. ...

How to access rdiff-backup repository using fuse

Use FUSE (filesystem in userspace) to access rdiff-backup repository. ...

How to create custom bash prompt

Today, I will show you my personal shell prompt, so you could define your own custom bash prompt. ...

How to execute rc.local shell script during boot using systemd

Execute rc.local shell script during boot using systemd compatibility generator. ...

How to display packages that are no longer required

Display packages that were installed automatically to satisfy various dependencies and are no longer required. ...

How extend existing ext4 filesystem using systemd service

Use systemd service to automatically extend existing ext4 filesystem on boot or on-demand to optimize virtual machine configuration. ...

How to display bind mounts

The simplest possible solution to display bind mounts. ...

How to determine when the operating system was booted

I have already described how to accurately determine when the system was booted, but there is a simpler solution as you can use /proc filesystem directly. ...

How to create swap file

Create swap file to optimize virtual machine configuration or just immediately increase available swap space. ...

How to extract specific file from tar archive

Extract a specific file from a tar archive. ...

How to increase the number of connection attempts when using ansible

Increase the number of connection attempts when using ansible utility. ...

How to check whether a full reboot is required

Determine whether a full CentOS 7 reboot is required and which services need to be restarted. ...

How to increase the system-wide number of available file handles

Increase the system-wide number of available file handles (open files). ...

How to clear bash history on logout

Automatically clear GNU Bourne-Again SHell history when you exit a login shell. ...

How to inspect parent processes

Inspect parent processes to determine whether shell script or specific process has been executed locally, remotely, or by any other application. ...

How to determine whether standard input file descriptor is referring to a terminal

Determine whether the standard input file descriptor refers to a terminal which can be useful to ensure that the shell script is executed using an interactive terminal. ...

How to reboot system during recovery

Reboot Linux operating system during recovery when shell is executed instead of standard init process. ...

How to limit bandwidth on specific network interface

Limit bandwidth on specific network interface using wondershaper. ...

How to change system hostname

Query and change the system hostname. ...

How to upgrade Ubuntu 18 LTS to the latest release

Upgrade Ubuntu 18 LTS to the latest Ubuntu 20 LTS (Long Term Support) release. ...

How to change the number of reserved filesystem blocks

Change the number of reserved filesystem blocks. ...

How to undo fsck operations performed on the Ext4 filesystem

Undo undo fsck operations performed on the Ext4 filesystem. ...

How to reindex directories located in the Ext4 filesystem

Reindex directories located in the Ext4 filesystem after removing a huge number of files to optimize directory sizes. ...

How to inspect OpenSSH client configuration

Inspect OpenSSH client configuration to search and display configured hosts. ...

How to temporarily stop auditd daemon

Disable auditd daemon during operating system image build process to prevent unnecessary log spikes. ...

How to expand an existing XFS filesystem on LVM Logical Volume

Expand an existing XFS filesystem on LVM Logical Volume. ...

How to log every executed command

Log every executed command to syslog. ...

How to revoke specific key used to login with OpenSSH

Revoke specific key used to perform key-based login with OpenSSH utilizing simple public key revocation list or OpenSSH Key Revocation List (KRL). ...

How to determine which key was used to login with OpenSSH

Determine which SSH key was used to perform key-based login using public key fingerprint. ...

How to instruct Ansible to use specific version of Python

Instruct Ansible to use a specific version of Python interpreter on the remote host. ...

How to suppress the message of the day

Suppress message of the day for specific or multiple users. ...

How to manage and display system news

Manage and display system news using a simple but effective utility. ...

How to display LWN news using message of the day framework

Display LWN news using the message of the day framework. ...

How to protect system against accidental shutdown

Protect the operating system against accidental shutdown or reboot. ...

How to display message after successful login

Display message of the day after successful login. ...

How to create VLAN interface using the ip utility

I have already described how to create VLAN interface, but things have changed over time, so I decided to update the know-how. ...

How to parse Debian package information

Use to drctl-tools to parse Debian package information using the Debian control file format (the dctrl format). ...

How to deal with "repository is not valid yet" error

What does “Release file for […] is not valid yet (invalid for another […]). Updates for this repository will not be applied.” error mean? ...

How to create persistent sysctl configuration

Create persistent sysctl configuration using standard system utilities. ...

How to modify system identification message

Modify system identification message that is printed before the login prompt. ...

How to perform suite change

I have recently updated Debian Buster from testing to stable, so it is worth to note how to perform such update non-interactively. ...

How to generate sequence of numbers

Generate and print sequences of numbers to perform specific operations using command-line or shell script. ...

How to determine how long specified remote server or device was offline

Create a shell script to determine how long a specified remote server or device was offline. It is not designed to substitute monitoring solutions but to determine how long it will take to reboot the server or device. It is using convert seconds to human readable time code to display results. ...

How to configure sysfs during system boot

Configure sysfs during system boot to apply custom configuration using a simple and convenient way. ...

How to download OpenVPN configuration using NordVPN API

Download OpenVPN configuration using public NordVPN API to specific file. ...

How to display your external IP address using NordVPN API

Display your external IP address using public NordVPN API. ...

How to drop kernel caches

Free dirty objects, page cache and reclaimable slab objects for troubleshooting or instructional purposes. ...

How to display user details using NordVPN API

Today, I will show you how to get and display user details using a shell script. This work is based on a Python-based solution by David Green and located at bitbucket/nordapi. ...

How to mount exFAT filesystem

I am surprised that exFAT is not supported out of the box as it is a default filesystem used on SDXC cards. You need to install a FUSE-based implementation to access data on devices using it. ...

How to use public NordVPN API

In a blog post a month ago, I described how to use a terminal to display servers recommended by NordVPN, but the same result can be achieved by using public API service. It is not officially documented, so let’s play with it. ...

How to determine what is mounted and where

Determine what filesystem is mounted where, what is using particular options and how much free space is available. ...

How to use NordVPN command-line utility

Use NordVPN command-line utility to easily manage VPN service. ...

How to build package using directory structure and custom metadata

The simplest possible way to create a Debian package is to use defined package metadata and prepared target directory structure. ...

How to verify fstab file

Verify static filesystem information defined in the fstab file after applying modifications to ensure that system will boot without any problems. It is especially important in remote locations or places where you cannot easily perform emergency operations. ...

How to use terminal to display servers recommended by NordVPN

I have already described a simple way to manually configure Network Manager and automatically import NordVPN servers, so today, I will explain how to pretty print servers recommended by NordVPN using terminal instead of web-browser. ...

How to convert seconds to human readable time

Create a shell script to convert seconds to human-readable time. I have reused part of an old shell script used to pretty-print system uptime to built it, as this code proved to be useful on several occasions. ...

How to display calendar in terminal with Monday as the start of the week

cal is a nice utility that displays calendar in terminal, but there is a small problem that needs to be fixed as it uses Sunday as the start of the week. ...

How to free disk space from deleted but still referenced file

Very rarely and often by mistake, you can end up with a deleted file that is still used by some process, which is likely writing to it, so the used space cannot be freed. ...

How to schedule one-time task

Schedule a one-time task at a specific time or below defined system load using at utility. ...

How to force user to change password

Alter password expiry date to force user to change password on next login. ...

How to verify deb package contents

Verify package contents by hand or use simple shell script to automate this process. ...

How to display deb package contents

I have already described how to list the contents of specified package using apt-file utility, but you do not need it to check the contents of downloaded package. ...

How to read and insert new values into the debconf database

I have already described how to copy answers to the configuration questions for Debian packages, but there is an easier way to read and insert new values into the debconf database. ...

How to perform incremental backup using rdiff-backup

Perform simple incremental backup using rdiff-backup utility. ...

How to remove useless localizations

Install and configure localepurge package, which provides a fancy shell script to recover disk space used by useless localizations. ...

How to configure command-line tab completion for known SSH hosts

Configure and enable command-line tab completion for known SSH hosts to ease day-to-day operations. You do need to configure or enable this on Debian-based distributions, but it is good to know how to do this as you will never know when it will come in handy. This article is an extension of adding the SSH menu to the Unity launcher blog post. ...

How to perform different operations depending on the shell script name

This technique is widespread. To be honest, it is more common than I initially thought, so I will show you how to create a single shell script that will display, create or destroy a temporary file system depending on the name used to execute it. ...

How to calculate how fast data is copied to the specified directory

Determine how long it would take to copy data between directories. ...

How to create shell script for a cron job with hidden debug information

Create a shell script for a cron job with hidden debug information shown only when executed inside the terminal. ...

How to execute logrotate every hour

Logrotate does not support hourly schedule, but this is an easy task to accomplish. ...

How to disable USB device

Whitelist or render inoperative any USB device to secure your personal belongings. ...

How to detect and log changes in the list of mounted filesystems

Detect and log changes in the list of mounted filesystems (/proc/self/mountinfo file). ...

How to execute additional commands during system startup using cron

Use cron service to execute additional commands as the specified user using cron during system startup. ...

How to automatically mount directory shared over local network using NFS

Use kernel automonter to automatically mount directory shared over network using NFS. ...

How to share directory over local network using NFS

Export directory over local network using NFSv4 to access data on a central server. ...

How to securely change user password using shell script

Securely change user password using shell script to automate this task on these rare occasions. ...

How to display dependencies for deb package

Use dpkg to pretty print package dependencies. ...

How to encrypt user password

Use encrypted passwords to automatically setup users using configuration management tools like Puppet or Ansible. ...

How to upgrade pip on Debian Wheezy

Debian Wheezy provides an ancient version of pip utility for installing Python packages. To put it very simply, it does not work anymore as it is not using HTTPS protocol, but fortunately this issue can be quickly fixed. ...

How to regenerate the boot configuration for mdadm

Alteration of the software RAID arrangement often requires an update to the boot configuration of the mdadm utility for management of Software RAID. ...

How to access Microsoft SQL Server instance when you are locked out

You can still connect to the Microsoft SQL Server 2014 as a member of the sysadmin server role using single-user mode when you are locked out of the database. ...

How to fix broken uwsgi package on Ubuntu Xenial

Recently, I tried to update uwsgi package on Ubuntu Xenial, but received an error about broken package. It looks like the mentioned package was pushed to the repository before its dependencies. This issue is thoroughly described in <a href=“https://bugs.launchpad.net/ubuntu/+source/uwsgi/+bug/1719363" target=_blank” rel=“external”>#1719363 bug report. ...

How to upgrade lxd guests

It is time to mention about simple sequential or simultaneous upgrade process on lxd guests. It is adapted to Debian-like operating systems using apt as I am using these daily. ...

How to install packages using repository snapshot

It is rarely mentioned, but you can use repository snapshots to download and install old and obsolete packages on already unsupported or even current Debian distributions. ...

How to use old network device naming convention

It is a matter of personal preference whether you use current or former network device naming convention. I am more accustomed to the latter and will configure the operating system to retain the old behavior. ...

How to fix mdadm segfault inside lxc container

lxd is a real pleasure to use, but mdadm constantly segmentation faults inside Ubuntu guest operating system. This issue affects only Ubuntu as mdadm is not disabled by default inside these containers. It is nothing scary or dangerous, but in this specific case, repetitive segfaults needlessly raise alertness level. ...

How to install missing ifconfig utility

ifconfig is not installed by default in Debian Stretch. However, it is available in package repository, so applications that depends on it can still be used. ...

How to summarize file space usage on Amazon S3 using command line client

Use s3cmd Command Line S3 Client and Backup for Linux and Mac to display disk usage on a particular bucket. ...

How to install missing firmware for tg3 module

Recently I stumbled upon the missing firmware for Broadcom Tigon3 based gigabit Ethernet card after kernel upgrade process. Simple problem, which was solved by installing firmware-linux-nonfree Binary firmware for various drivers in the Linux kernel package. ...

How to list configured APT repositories

List configured APT data sources for binary packages using apt-cache utility. ...

How to verify package version in shell script

There are circumstances when you want to ensure a particular package version during the setup process. I will show you a simple method to verify the package version suitable for sourcing into a shell script. ...

How to determine when process was started

There are at least several ways to determine when the process was started to help you investigate and trace potential issues. I will briefly introduce four different methods to choose the most useful one. ...

How to get name of the source package

There are many applications that share the same source package, so I will show three different ways to print the name of the source package. ...

How to determine when the last time package index files were updated

Knowing how to determine when the last time package index files were updated can be beneficial when you least expect it. It is not something used every day but can be used to monitor or verify when apt-get update command was executed. ...

How to upgrade selected packages

It is very easy to upgrade the whole Debian system, but you can also upgrade only selected packages and skip the rest. ...

How to list available updates using apt

Many years ago I wrote How to display available updates blog post which mainly related to Debian Wheezy. Today I want to extend it by a neat console friendly utility available in Debian Jessie since the milestone apt release thanks to Michael Vogt. ...

How to automatically login user at the console

I have already described a straightforward way to automatically login user at the console without touching the graphical user interface using Debian Wheezy, so today I will post an update for Debian Jessie as the whole process has changed considerably. ...

How to reload wifi module on resume

Once in a while, I have a problem with Intel Corporation Dual Band Wireless-AC 7265 on Dell XPS 13 during the resume process as it just stops working and won’t connect to any network. The solution is to simply reload the kernel module. ...

How to find which package includes specific file

This brief outline explains how to locate specific file within Debian packages using very useful apt-file utility which as opposed to dpkg-query does not only inspect installed packages since it utilizes fetched lists of the contents of packages. ...

How to change SSH private key passphrase

From time to time I have to update passwords used to secure private keys to keep myself a bit more sane. I will demonstrate simple and straightforward way to accomplish this task. ...

How to parse and process Linux Software RAID events

It is an interesting thing to know how to parse and process Linux Software RAID events. It is also beneficial as you can automatically take appropriate action immediately after a certain event occurs. ...

How to set NOOP scheduler at system boot

There are many different ways to set NOOP scheduler on the first hard drive at system boot. I have decided to use simple systemd service, but alternatively you can use udev to automatically configure every SSD device (see References section). ...

How to temporarily disable user logins

Sometimes, I want to prevent regular users from logging into the system to perform more complex operations. To achieve that, I am using Pluggable Authentication Modules for Linux to temporarily disable user logins. ...

How to schedule system reboot

It is a short entry, but an useful one, as it is important to have a basic knowledge of how to schedule system reboot or power it down automatically at specified time. ...

How to set CPU governor at system boot

Currently, I am playing with recent Ubuntu Wily Werewolf on my personal notebook. The first thing I did after system installation was to configure CPU governor and set it at system boot. ...

How to programmatically create system user with defined password

It is very easy to add users by hand, but sometimes such actions needs to be automated. ...

How to set PowerTOP options at boot time

Today, I will show you how to set all tunable PowerTOP options at boot time using systemd service. ...

How to determine whether the operating system is 32-bit or 64-bit

Two years ago I have described three simple ways to determine whether the processor supports 64-bit instruction set. Today, I will show you how to determine whether any Debian-based operating system is 32-bit or 64-bit. ...

How to extract the cover image from an e-book

I have successfully used Google Drive and Insync to organize all of the e-books that I have acquired during the last years. Currently plan to upload them to a personal DokuWiki instance since I use it more every day. Before I can start, I need to extract cover images to ensure that I will get a decent outcome. ...

How to use nearest Debian mirror

Today, I will explain how to automatically choose nearest mirror based on geographic and network location using Debian mirrors HTTP redirector to solve the common problem of choosing an appropriate mirror. ...

How to replace failed software RAID device

I had an unexpected incident last week as one of the hard disks in my server failed. This device was a part of a software RAID mirror, which created an opportunity to describe the whole process. ...

How to record terminal session

Maybe it is rarely needed, but recently, I found it very useful to know how to record an interactive session, so I could reference to it later or just examine it further. ...

How to enforce read-only mode on every connected USB storage device

Today, I will show you how to put every connected USB storage device in read-only mode using udev dynamic device management, blockdev utility, and systemd service unit configuration. ...

How to copy answers to the configuration questions for Debian packages

Human memory is sometimes unreliable, so it is not always possible to answer in the same way to the configuration questions. Fortunately, this process can be automated using debconf utilities. ...

How to manage system services on Debian Jessie

Debian Jessie is using systemd as the default system and service manager. I will not argue about it, but instead, I will briefly introduce the whole thing. ...

How to use chkconfig on Debian Wheezy

I have already described chkconfig utility in CentOS – How to manage system services blog post, but today I want to mention that you can also use it to manage services on Debian Wheezy. ...

How to clear up pending resync on RAID array

I have already wrote a couple of posts about software RAID setup and recovery. Today I will briefly describe how to switch array to read-write state and begin resync process. ...

How to quickly and securely search for files

Using find command is not always the fastest way to search for specific files. The better method is to use mlocate utility, which uses its own file database and provides only user-accessible results. ...

How to password protect GRUB entries

I always asked myself how to password protect GRUB entries on an encrypted notebook to lock down the boot loader and protect it from unauthorized access. ...

How to perform unattended upgrades

I have been using unattended upgrades on development machines since the end of last November, when I installed Debian Jessie release. ...

How to create persistent reverse SSH tunnel

Sometimes I want to access a private server at home from a different network while being on the go. The easiest way to do this is to use autossh utility to create a secure and persistent reverse SSH tunnel to the publicly available server. ...

How to check package version

Sometimes I need to check the installed package version, compare it with the available version, or verify that the correct version is already installed. I will show you how to quickly perform these checks. ...

How to take control over configuration files

Take control over configuration files and store them in version control system using etckeeper utility created by Joey Hess, which seamlessly integrates with package management tools inside Debian operating system. ...

How to automatically share X session using VNC

Today, I will briefly describe how to automatically share X session on Debian Wheezy using VNC protocol. ...

How to monitor TigerVNC service using Monit

Recently, I was searching for an easy to manage VNC service to use it at home. After a short while of consideration, I decided to install TigerVNC and manage it using Monit. ...

How to monitor background process using Monit

A short time after I installed Monit, I tried to monitor a background running process that does not support daemon mode. It is an exceptionally rare situation, but very interesting one, so after a while a came with a quite simple solution using additional shell script. ...

Monit – A quick look at the web-interface

Previous entry was too long to include additional screenshots of the web-interface, so today I will write couple of words about web-interface and show you several screenshots. ...

How to monitor Kolab processes

I have been using self hosted Kolab Groupware everyday for quite a while now. Therefore the need arose to monitor process activity and system resources using Monit utility. ...

How to check upstream distribution-specific information

Long time ago I have described an easy way to check Ubuntu release. Today I want to expand this topic a little bit further and mention about additional switch to check an upstream release, which can be very useful at times. ...

How to compare the contents of two directories

This weekend I encountered a simple, but interesting topic, which concerns comparing the contents of two directories. The fun part is that you don’t need any additional utilities as standard diff command is fully sufficient. ...

How to terminate PostgreSQL sessions

Recently, I have encountered an interesting issue, as I could not perform specific database operations due to unwanted and active sessions using the database. Thus, I will briefly note the solution for further reference. ...

How to access single-user mode without password

Recently I was asked to reset root password on some long forgotten Debian box. It was an easy and straightforward task, but, as there are some interesting pitfalls, I will describe the whole process of acquiring root shell without password using single-user mode and a couple of ways to prevent it. ...

How to count local user accounts

If you are wondering how to count only local users ignoring system accounts, I will give you a concise and straight answer. ...

How to manage packages on an off-line Debian system

There are plenty of off-line Debian systems just waiting to update index files, upgrade or install additional packages. This can be easily achieved by using apt-offline utility. I will shortly describe common usage scenario as it is very handy application. ...

How to redirect command output using sudo

You have probably already noticed my favorite way to overcome the sudo redirection issue, but if you haven’t, then I will write it down here for further reference. ...

Unattended boot, Grub, Ubuntu and power failure.

What do these four things have in common? Ubuntu headless server will not boot after power failure as Grub will indefinitely wait for user input. The root of this problem lies inside Ubuntu default Grub configuration as Grub will simply set timeout to infinity when recordfail parameter is set. ...

How to deal with dmesg timestamps

By default dmesg command print kernel ring buffer using the timestamp for each logged message. It is easy to change this behavior and display date/time in a human-readable form using just one additional parameter. Still, sometimes it is not supported, so I will shortly touch upon this topic. ...

How to accurately determine when the system was booted

It is very easy to tell how long the system has been running using uptime command, but the information when exactly it was booted is not so apparent, so I will show you two different ways to get it. ...

How to automatically login user at the console

Whenever I see auto-login feature implemented by using X login manager, I immediately think about how to automatically login user at the console without even touching graphical user interface. ...

How to tell to which package the specified file belongs to

It is good to know how to tell to which package the specified file belongs to as this knowledge could be very useful during system upgrade or unexpected system failure. ...

How to determine whether the processor supports 64-bit instruction set

If you ever wondered how to determine whether the processor is 64-bit capable, then I have a simple and straight answer for you. ...

How to configure software RAID1 during installation process

Recently I needed to setup software RAID1 during Debian installation process. As it turned out, this process was simpler then I initially expected. I will shortly describe it here using screen-shots captured during initial tests. ...

How to backup and restore installed packages

If you ever wondered about how to backup list of installed packages and then restore it on another machine then you need to know that it does not require anything more then three basic utilities – dpkg to import/export list of packages, apt-get to install selected packages and apt-mark to restore extended package states. ...

How to read the kernel's start-up parameters

Simply dive into proc filesystem and read /proc/cmdline file to determine the kernel’s start-up parameters. ...

How to check last mount time of the ext2/ext3/ext4 filesystem

A couple of days ago, I was asked how to check the last mount time of the ext2/ext3/ext4 filesystem. The solution is straightforward as it does not require anything more then tune2fs utility. ...

How to display available updates

It is straightforward to display available updates using an application with a graphical user interface, but not so obvious to do it by using shell commands only. I will shed some useful light on the subject so we could both benefit from it. ...

Debian – How to hold specific package

There are at least couple ways to hold specific package and prevent it from being updated as you can use apt, dpkg, aptitude, dselect, apt preferences, but only the last one is effective in every case. ...

Debian – How to quickly disable IPv6

I am playing with Linux Virtual Servers in the Linode Cloud for the last several days and a couple of times wanted to disable IPv6 for testing purposes. ...

How to re-read partition table

Re-read partition table without machine reboot using partprobe utility which is a part of parted package. ...

Debian – How to transparently bridge Ethernet interfaces

Yesterday, I wrote a short note about VLAN interfaces. Today, I want to write a short entry on how to bridge Ethernet interfaces to keep things complete as I need to mention about creating ACCESS port to tag packets on desired interface. ...

How to create VLAN interface

VLAN (virtual local area network) is very useful concept as you can easily separate device management from users by using appropriate network devices and configuration. I will describe here in a form of a short note how to create VLAN interface using Debian system. ...

Debian – How to change time zone

This is rarely performed task but an easy one. To change time zone you need to reconfigure tzdata package. ...

Ubuntu Precise – Install youtube-dl package using Quantal repo

Ubuntu Precise 12.04 currently contains in repository youtube-dl version 2012.02.27-1. As of recent YouTube changes this package version is not usable anymore but there is an updated version in Ubuntu Quantal 12.10 repository. To use it you need to perform couple of steps described below. ...

CentOS – How to manage system services

Short note on how to manage system services using CentOS. ...

How to modify squashfs image

You cannot modify squashfs image directly but you can uncompress it, apply changes and compress it again. ...

Ubuntu – How to use persistent encrypted partition

Simple solution using Linux Unified Key Setup. ...

Ubuntu – How to use encrypted tmp partition

The answer is to recreate encrypted tmp partition every boot with random key as you do not need to keep temporary data in memory. ...

Ubuntu – How to encrypt swap partition

Create partition for swap (/dev/sdaX in this example). Prepare and enable it using mkswap and swapon commands. If you already use swap partition then omit these steps. $ sudo mkswap /dev/sdaX Setting up swapspace version 1, size = 4194300 KiB no label, UUID=325d9718-8532-460d-afec-74e6aee9ae5f $ sudo swapon /dev/sdaX Execute ecryptfs-setup-swap script (it is part of ecryptfs-utils package): $ sudo ecryptfs-setup-swap WARNING: An encrypted swap is required to help ensure that encrypted files are not leaked to disk in an unencrypted format....

How to backup DOS-type partition table/GPT and LVM metadata?

DOS partition table We can use sfdisk to dump partition table in usable format and store it: $ sudo sfdisk -d /dev/sda > sda_partitions Partition table can be restored using stored backup: $ sudo sfdisk /dev/sda < sda_partitions Partition table can be easily cloned (from sda to sdz in this example): $ sudo sfdisk -d /dev/sda | sfdisk /dev/sdz GPT To backup GUID partition table use sgdisk command (from gdisk package):...

How to get disk UUID

I recently needed to know the UUID (universally unique identifier) of my bootable USB root partition. It is a better way to distinguish storage devices because device names can change depending on the connection order. ...

How to mount software RAID1 member using mdadm

Just a moment ago I connected my old hard drive and realized that it was a RAID member. ...

Boot to RAM notes

This post contains notes on this topic in the form of a concise guide. ...

How to add custom grub2 menu entry?

Edit /etc/grub.d/40_custom file to add a custom entry in grub2 menu. ...

How to check the progress of the dd process

Check the progress of the dd process. ...

How to determine current run-level using Linux

To print current run-level execute: $ who -r run-level 3 2012-01-17 17:06 To print previous and current run-level execute: $ sudo runlevel N 3

How to install *.deb package in Ubuntu?

If you downloaded *.deb package and wonder how to install it then just look at the snippet posted below. ...

How to exclude package from update on CentOS

Exclude package from an update on CentOS operating system. ...

How to get rid of slow CentOS mirrors on update

Get rid of slow CentOS mirrors on update. ...

Which Ubuntu release are you using?

The easiest way to check Ubuntu release is to use lsb_release command. ...