Basic NFS Installation and Configuration on Linux

Sharing files between computers and servers is an essential networking task. Thankfully, Linux’s NFS(Networked File System) makes it extremely easy. With NFS properly configured, moving files between machines is as easy as moving files around on the same machine. Since NFS functionality is built directly into the Linux kernel, it is both powerful and available on every distro, though the configuration differs slightly between them.

Setting Up The Server

Installing The Packages

Linux NFS uses the Client-Server model, so the first step in getting NFS set up is setting up the server. Because the core NFS capabilities are rooted in the kernel, there isn’t much required in the way of packages, but there are still a few regardless of the distribution as well as some configuration.
Almost all major distributions have NFS enabled, so unless you’re running a custom one, it should already be set up. The next step in getting the server set up is to install the packages.

On Ubuntu/Debian:

$ sudo apt-get install nfs-kernel-headers

On Fedora

$ sudo yum install nfs-utils system-config-nfs

Read more

Getting The RX 480 Running With AMDGPU on Linux

AMD’s RX 480 has been out for a little over a week now, and in that week Linux gamers have been clamoring or information on whether and how the card works on their favorite distribution. Sure, Ubuntu 16.04 is officially supported by AMD’s proprietary Pro drivers, but what about everyone else, and what if you want to use those AMDGPU open source drivers that have been in the works for so long? Well, it’s definitely possible, but it’s not all that easy.

WARNING: Here be dragons, big ones. They’re pretty much the kind you’d expect to see flying around Mereen, so if you don’t want to take the chance of breaking your install and some singed eyebrows, turn back now.

Read more

How to take and restore VM snapshot using command line on XenServer

Objective

The objective is to create a new snapshot of a XenServer virtual machine and later restore from this snapshot.

Requirements

Privileged access to XenServer’s command line.

Difficulty

EASY

Instructions

Identify VM’s UUID

First, we need to identify a VM’s UUID we wish to take a snapshot from. Use xe vm-list to list all available VM:

# xe vm-list
uuid ( RO)           : 7371124f-7d4d-66b7-cbc7-a98b1457543e
     name-label ( RW): Debian Jessie 8.5
    power-state ( RO): halted


uuid ( RO)           : bad8e456-df88-435d-ba12-3f0f6e54b2c6
     name-label ( RW): Control domain on host: xenserver
    power-state ( RO): running

Read more

How to export/import VM to/from a backup file using command line on XenServer

Objective

The objective is to first export XenServer’s virtual machine into a regular backup file and later import a new virtual machine from the previously generated backup file.

Requirements

Privileged access to XenServer’s command line.

Difficulty

EASY

Instructions

Identify VM’s UUID

We start by identifying a virtual machine we would lake to export to as a regular backup file. Run xe vm-list to list all available virtual machines and take a note of the virtual machine in question:

# xe vm-list
uuid ( RO)           : 7371124f-7d4d-66b7-cbc7-a98b1457543e
     name-label ( RW): Debian Jessie 8.5
    power-state ( RO): halted


uuid ( RO)           : bad8e456-df88-435d-ba12-3f0f6e54b2c6
     name-label ( RW): Control domain on host: xenserver
    power-state ( RO): running

Read more

Installing NVIDIA Drivers All Major Linux Distributions

Intro

NVIDA supports Linux with its proprietary drivers nearly as well as it does Windows. That said, it’s no secret that NVIDIA has long been the go-to choice for gaming on Linux. Unfortunately, even though the drivers support Linux well, installing them can become more complicated when dealing with different distributions. In many cases, the process is very simple but not well documented. In others, it’s a bit tougher, but there is no reason that you can’t get the latest NVIDIA drivers for your graphics card working on most major distributions.

Read more

How to extract XZ compressed archive on Linux

XZ is another compression method used to compress data. There are several ways on how to decompress XZ archive on Linux. For a tarball XZ compressed archive first try a tar command with xf options. This way a tar command will try automatically guess a compression method. Before you run the above command firs install XZ tools:

# apt-get install xz-utils

Otherwise, you will receive error message output:

tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

To extract XZ tarball run:

$ tar xf myarchive.tar.xz

Read more

How to rename VDI/Virtual disk on XenServer Linux

Objective

The Virtual Machine creation using template provisioner may spawn unnamed VDI disks. Usually, the VID description states Created by template provisioner at most.
Example:

uuid ( RO)                : 093e128a-2632-43bd-bb45-8f864bc69d6f
          name-label ( RW): 0
    name-description ( RW): Created by template provisioner
             sr-uuid ( RO): 3ef7b35b-5d39-7414-0c91-bbb281b9a521
        virtual-size ( RO): 21474836480
            sharable ( RO): false
           read-only ( RO): false

The objective is to set a proper name and description to VDI disk.

Read more

Secure SSD data deletion

Normal data deletion does not erase all data from SSD as same parts are reserved and omitted by removal process. The function secure erase function allows for a complete data removal from all cells. The secure erase function is offered by SSD manufactures and not all hard drives or Linux kernels support it. In the below examples we will refer to /dev/sda block device as our test drive. To find whether your SSD hard drive supports secure erase run a following linux command:

Warning:

ATA Security Feature Set
These switches are DANGEROUS to experiment with, and might not work with some kernels. USE AT YOUR OWN RISK.

# hdparm -I /dev/sda | grep erase
		supported: enhanced erase

Read more

User Data Encryption with FUSE-based EncFS filesystem

Introduction

Any decent Linux distribution comes with an installation option to automatically encrypt user’s home directory. In case you do not wish to encrypt the entire home directory or perhaps you wish to encrypt some random directories on your Linux system you can use EncFS the FUSE-based cryptographic filesystem. EncFS will allow you to encrypt and decrypt any directory in a matter of seconds. It will reside on top of your current filesytem and provide access to any EncFS encrypted directory only upon entering a correct predefined password. This short tutorial will show you how to encrypt and decrypt your directories with the EncFS cryptographic filesystem.

Scenario

Let’s assume that you are a heavy Laptop user traveling from one place to another. You also use ssh quite often and so you have generated ssh keypair. For your convenience you even generated a private key without using a pass-phrase ( never good idea ). Furthermore, you have copied you public ssh key to multiple servers for an easy access. The problem with this scenario is that once someone gets hold of your Laptop s/he gets instantly access to all servers using you private ssh key. In this article we will show you how to encrypt your .ssh directory and avoid such problem.

Read more

How to rename VM ( virtual machine ) name label on XenServer

Objective

The objective is to set a new name label on a existing XenServer’s VM ( virtual machine ).

Requirements

Privileged access to XenServer’s command line as well as configured ISO image storage containing an ISO image of the Linux distribution you wish to install.

Difficulty

EASY

Instructions

Identify VM’s UUID

In order to set/rename VM’s name label we fisrt need to identify its UUID. List all VM’s and take a note of a relevant UUID. Example:

# xe vm-list
uuid ( RO)           : bad8e456-df88-435d-ba12-3f0f6e54b2c6
     name-label ( RW): Control domain on host: xenserver
    power-state ( RO): running


uuid ( RO)           : 699dcb0c-e897-5bd4-30c1-ab1dd9a3ca4e
     name-label ( RW): Debian Jessie 8.0
    power-state ( RO): halted

Read more