How to Stop and Disable Unwanted Services from Linux System

We build a server according to our plan and requirements, but what are the intended functions while building a server to make it function quickly and efficiently. We all know that while installing a Linux OS, some unwanted Packages and Application gets installed automatically without the knowledge of a User.

Remove Unwanted Services From Linux

Remove Unwanted Services From Linux

When building a server we need to ask ourselves what we actually need from the box. Do I need a Web Server or a FTP Server, a NFS Server or a DNS Server, a Database Server or something else.

Here in this article, we will be discussing some of these unwanted applications and services which you might not needed but they are installed by default during OS installation and unknowingly start eating your system resources.

Lets first know what kind of services are running on the system using the following commands.

[avishek@tecmint]# ps ax
Sample Output
  PID TTY      STAT   TIME COMMAND
    2 ?        S      0:00 [kthreadd]
    3 ?        S      0:00  \_ [migration/0]
    4 ?        S      0:09  \_ [ksoftirqd/0]
    5 ?        S      0:00  \_ [migration/0]
    6 ?        S      0:24  \_ [watchdog/0]
    7 ?        S      2:20  \_ [events/0]
    8 ?        S      0:00  \_ [cgroup]
    9 ?        S      0:00  \_ [khelper]
   10 ?        S      0:00  \_ [netns]
   11 ?        S      0:00  \_ [async/mgr]
   12 ?        S      0:00  \_ [pm]
   13 ?        S      0:16  \_ [sync_supers]
   14 ?        S      0:15  \_ [bdi-default]
   15 ?        S      0:00  \_ [kintegrityd/0]
   16 ?        S      0:49  \_ [kblockd/0]
   17 ?        S      0:00  \_ [kacpid]
   18 ?        S      0:00  \_ [kacpi_notify]
   19 ?        S      0:00  \_ [kacpi_hotplug]
   20 ?        S      0:00  \_ [ata_aux]
   21 ?        S     58:46  \_ [ata_sff/0]
   22 ?        S      0:00  \_ [ksuspend_usbd]
   23 ?        S      0:00  \_ [khubd]
   24 ?        S      0:00  \_ [kseriod]
   .....

Now, let’s have a quick look at the processes accepting connection (ports) using the netstat command as shown below.

[avishek@tecmint]# netstat -lp
Sample Output
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 *:31138                     *:*                         LISTEN      1485/rpc.statd      
tcp        0      0 *:mysql                     *:*                         LISTEN      1882/mysqld         
tcp        0      0 *:sunrpc                    *:*                         LISTEN      1276/rpcbind        
tcp        0      0 *:ndmp                      *:*                         LISTEN      2375/perl           
tcp        0      0 *:webcache                  *:*                         LISTEN      2312/monitorix-http 
tcp        0      0 *:ftp                       *:*                         LISTEN      2174/vsftpd         
tcp        0      0 *:ssh                       *:*                         LISTEN      1623/sshd           
tcp        0      0 localhost:ipp               *:*                         LISTEN      1511/cupsd          
tcp        0      0 localhost:smtp              *:*                         LISTEN      2189/sendmail       
tcp        0      0 *:cbt                       *:*                         LISTEN      2243/java           
tcp        0      0 *:websm                     *:*                         LISTEN      2243/java           
tcp        0      0 *:nrpe                      *:*                         LISTEN      1631/xinetd         
tcp        0      0 *:xmltec-xmlmail            *:*                         LISTEN      2243/java           
tcp        0      0 *:xmpp-client               *:*                         LISTEN      2243/java           
tcp        0      0 *:hpvirtgrp                 *:*                         LISTEN      2243/java           
tcp        0      0 *:5229                      *:*                         LISTEN      2243/java           
tcp        0      0 *:sunrpc                    *:*                         LISTEN      1276/rpcbind        
tcp        0      0 *:http                      *:*                         LISTEN      6439/httpd          
tcp        0      0 *:oracleas-https            *:*                         LISTEN      2243/java         
....

In the above output, you notice that some of the applications you may not needed on your server but they are still running as follows:

1. smbd and nmbd

smbd and nmbd are daemon of Samba Process. Do you really need to export smb share on windows or other machine. If not! why are these processes running? You can safely kill these processes and disable them from starting automatically when machine boots the next time.

2. Telnet

Do You need bidirectional interactive text-oriented communication over internet or local area network? If not! kill this process and turn-off it from starting at booting.

3. rlogin

Do you need to log in to another host over network. If not! Kill this process and disable it from starting automatically at boot.

4. rexec

The Remote Process Execution aka rexec lets you execute shell commands on a remote computer. If you don’t require to execute shell command on a remote machine, simply kill the process.

5. FTP

Do you need to transfer files from one host to another host over Internet? If not you can safely stop the service.

6. automount

Do you need to mount different file systems automatically to bring up network file system? If not! Why is this process running? Why are you letting this application to use you resource? Kill the process and disable it from starting automatically.

7. named

Do you need to run NameServer (DNS)? If not what on earth is compelling you to run this process and allow eating up your resources. Kill the running process first and then turn-off it from running it at boot.

8. lpd

lpd is the printer daemon which makes it possible to print to that server. If you don’t need to print from the server chances are your system resources are being eaten up.

9. Inetd

Are you running any inetd services? If you are running stand alone application like ssh which uses other stand alone application like Mysql, Apache, etc. then you don’t need inetd. better kill the process and disable it starting next time automatically.

10. portmap

Portmap which is an Open Network Computing Remote Procedure Call (ONC RPC) and usages daemon rpc.portmap and rpcbind. If these Processes are running, means you are running NFS server. If NFS server is running unnoticed means your system resources are being used up un-necessarily.

How to Kill a Process in Linux

In order to kill a running process in Linux, use the ‘Kill PID‘ command. But, before running Kill command, we must know the PID of the process. For example, here I want to find a PID of ‘cupsd‘ process.

[avishek@tecmint]# ps ax | grep cupsd

1511 ?        Ss     0:00 cupsd -C /etc/cups/cupsd.conf

So, the PID of ‘cupsd‘ process is ‘1511‘. To kill that PID, run the following command.

[avishek@tecmint]# kill -9 1511

To find out more about kill command with their examples, read the article A Guide to Kill Command to Terminate a Process in Linux

How to Disable a Services in Linux

In Red Hat based distributions such as Fedora and CentOS, make use of a script called ‘chkconfig‘ to enable and disable the running services in Linux.

For example, lets disable the Apache web server at the system startup.

[avishek@tecmint]# chkconfig httpd off
[avishek@tecmint]# chkconfig httpd --del

In Debian based distributions such as UbuntuLinux Mint and other Debian based distributions use a script called update-rc.d.

For example, to disable the Apache service at the system startup execute the following command. Here ‘-f’option stands for force is mandatory.

[avishek@tecmint]# update-rc.d -f apache2 remove

After making these changes, The system next time will boot without these UN-necessary process which in-fact will be saving our system resource and the server would be more practical, fast, safe and secure.

That’s all for now. I’ll here we again with another interesting article.

Source

T-UI Launcher – Turns Android Device into Linux Command Line Interface

Are you a command line guru, or do you simply want to make your Android device unusable for friends and family, then check out T-UI Launcher app. Unix/Linux users will definitely love this.

T-UI Launcher is a free lightweight Android app with a Linux-like CLI (Command Line Interface) that turns your regular Android device into a complete command line interface. It is a simple, quick and smart launcher for those who love to work with text-based interfaces.

T-UI Launcher Features

Below are some of its notable features:

  • Shows quick usage guide after the first launch.
  • It’s fast and fully customizable.
  • Offers to autocomplete menu with fast, powerful alias system.
  • Also, provides predictive suggestions and offers a serviceable search function.

It is free, and you can download and install it from Google Play Store, then run it on your Android device.

Once you have installed it, you’ll be shown a quick usage guide when you first launch it. After reading the guide, you can start using it with simple commands as the ones explained below.

T-UI Commandline Help Guide

T-UI Commandline Help Guide

To launch an app, simply type the first few letter in its name and the auto completion functionality will show all the available apps on the screen. Then click on the one you want to open.

$ Telegram   #launch telegram
$ WhatsApp   #launch whatsapp
$ Chrome     #launch chrome

T-UI Commandline Usage

T-UI Commandline Usage

To view your Android device status (battery charge, wifi, mobile data), type.

$ status

Android Phone Status

Android Phone Status

Other useful commands you can use.

$ uninstall telegram				#uninstall telegram 
$ search [google, playstore, youtube, files]	#search online apps or for a local file
$ wifi						#turn wifi on or off
$ cp Downloads/* Music				#copy all files from Download folder to Music 
$ mv Downloads/* Music				#move all files from Download folder to Music 

That’s all! In this article, we reviewed simple yet useful Android app with a Linux-like CLI (Command Line Interface) that turns your regular Android device into a complete command line interface. Give it a try and share your thoughts with us via the comment section below.

Source

Install “Android 4.4 KitKat” to Run Favourite Games and Applications in Linux

Android (x86) is a project which aims to port Android system to Intel x86 processors to let users install it easily on any computer, the way they do this is by taking android source code, patching it to work on Intel x86 processors and some laptops and tablets.

Install Android KitKat in Linux

Install Android 4.4 KitKat in Linux

A few days ago, the project released “Android KitKat 4.4 RC2”, and today we will explain how to install it on VirtualBox, there is a problem that the mouse pointer doesn’t work in android in VirtualBox, but you may use this guide to install it beside other systems as a main system and the mouse should work I guess, otherwise we’ll use the keyboard.

Step 1: Install VirtualBox in Linux

1. VirtualBox is available to install easily via official repositories in most Linux distributions, to install it on Ubuntu run.

$ sudo apt-get install virtualbox

For other Linux distributions like RHELCentOS and Fedora, use the following article to install Virtualbox.

  1. Install VirtualBox in RHEL, CentOS and Fedora

Step 2: Download and Install Android 4.4 KitKat in Virtualbox

2. This is an easy step, just download Android 4.4 x86 Kit Kat file from the androud Sourceforge.net project.

3. To install Android 4.4 kitkat on VirtualBox, you need first to boot from the .iso image that you downloaded, to do so, open VirtualBox, Click on new to create a new virtual machine, and choose the settings as follow.

Create New Virtual Machine

Create New Virtual Machine

4. Then it will ask you to choose a Memory size for the machine, Android 4.4 kitkat needs 1GB of RAM to work perfectly, but I will choose 512MB since I only have 1GB of RAM on my computer.

Set Memory to New Machine

Set Memory to New Machine

5. Now select “Create a virtual hard drive now” to create a new one.

Create Virtual Hard Drive

Create Virtual Hard Drive

6. It will now ask you for the type of the new virtual hard drive, select VDI.

Select Hard Drive Type

Select Hard Drive Type

Select Storage Type

Select Storage Type

7. Now choose the size of the virtual hard drive, you may choose any size you want, no less than 4GB so the system can be installed correctly beside any future apps that you want to install.

Set Size for Virtual Drive

Set Size for Virtual Drive

8. Now that’s your first virtual machine is created, now to boot from the .iso file that you downloaded, select the virtual machine from the list on the left, click on Settings, and go for “storage”, do as follow and select the .isoimage of android 4.4 kitkat RC2.

Select Android KitKat ISO

Select Android KitKat ISO

9. Click on OK, and start the machine to boot the .iso image, choose “Installation” to start installing the system on the virtual machine.

Select to Install Android Kit Kat

Select to Install Android Kit Kat

10. Please select a partition to install Android-x86.

Select Partition Drive

Select Partition Drive

11. Now you will be prompted cfdisk which is a partitioning tool that we will use to create a new hard drive, so we can install android 4.4 on it, Click on “New”.

Create New Partition

Create New Partition

12. Choose “Primary” as partition type.

Choose Primary Partition

Choose Primary Partition

13. Next, select the size of the partition.

Select Size of Partition

Select Size of Partition

14. Now, we have to make the new hard drive bootable in order to be able to write changes to the disk, click on “Bootable” to give the bootable flag to the new partition, you won’t notice any changes in fact but the bootable flag will be given to that partition.

Make Partition Bootable

Make Partition Bootable

15. After that, click on “Write” to write the changes to the hard drive.

Apply Changes to Partition

Apply Changes to Partition

16. It will ask you if you are sure, write “yes” and click on Enter.

Confirm Partition Changes

Confirm Partition Changes

17. Now that’s our new hard drive is created, now click on Quit and you will see something like this, select the partition that you created before in order to install android on it and hit Enter.

Choose Partition to Install Android

Choose Partition to Install Android

18. Choose “ext3” as a filesystem for the hard drive and format.

Select Ext3 Partition Type

Select Ext3 Partition Type

Format Partition

Format Partition

19. You will be asked now if you want to install GRUB bootloader, of course you will select Yes, because if you don’t, you won’t be able to boot the new system, so choose “Yes” and hit Enter.

Install Boot Loader GRUB

Install Boot Loader GRUB

20. Finally, you will be asked if you want to make the /system partition writeable, choose Yes, it will help in a lot of things later after you install the system.

Make Partition Writeable

Make Partition Writeable

21. The installer will start it’s mission… after the installer finishes the job, choose Reboot, in my test, the “Run-Android x86” didn’t work for me, so you have to reboot.

Android Kit Kat Installation

Android Kit Kat Installation

22. Now that’s we installed Android 4.4 KitKat RC2 on our hard drive, the problem is now that VirtualBox will keep loading the .iso image file instead of booting from the virtual hard drive, so to fix this problem, go to Settings, under “storage” select the .iso file and remove it from the booting menu.

Remove Android Kit Kat Image

Remove Android Kit Kat Image

23. Now you can start the virtual machine with the installed android system.

Start Android Kit Kat System

Start Android Kit Kat System

Android Splash Screen

Android Splash Screen

24. Now you will start a wizard to configure some things before you start using Android. You will see a screen like this, Now the problem is, that the Mouse doesn’t work in android 4.4 KitKat, that means that we’ll be using our skills in keyboard, first choose the language you want using the Up and Down keys in the keyboard, and to go the next step, hit the Right arrow key and click Enter.

Android Welcome Screen

Android Welcome Screen

Select WiFi Network

Select WiFi Network

Create Android Google Account

Create Android Google Account

Sign in Google Account

Sign in Google Account

Set Date and Time

Set Date and Time

Enter Your Details

Enter Your Details

Android 4.4 Kit Kat Home Screen

Android 4.4 Kit Kat Home Screen

Installing Android x86 will be good for you if you don’t have a smartphone and you want to use the Play Storeapps easily, have you ever tried to install android x86? What was the results? Do you think that android may become a “real operation system” targeting PCs in the feature?

Source

Android Studio – A Powerful IDE for Building Apps for All Android Devices

Android Studio, Android’s official IDE, is a powerful and popular, feature-rich IDE for building apps for all Android compatible devices. It is specifically designed for Android platform to speed up building of apps and help users develop top-quality, reliable and efficient apps from scratch, for every type of Android device.

Android Studio Features:

  • It runs instantly
  • Has a fast and feature-rich emulator.
  • Provides an intelligent code editor.
  • It is designed for teams.
  • It is also optimized for all Android devices.
  • Provides code templates as well as sample apps.
  • Offers testing tools and frameworks.
  • Has C++ and NDK support.
  • Supports firebase and cloud integration.
  • Provides GUI tools such as layout editor, APK analyzer, vector asset studio and translation editor and much more.

Requirements:

  • 64-bit distribution that also run 32-bit applications.
  • Desktop environment: GNOME or KDE, but most desktops should work.
  • GNU C Library (glibc) 2.19 or newer.
  • At least 2 GB of available disk space, but 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image).
  • At least 3 GB RAM, but 8 GB RAM recommended, the Android Emulator consumes 1 GB of RAM.
  • At least 1280 x 800 screen resolution.

How to Install Android Studio in Linux Systems

First, you need to download Android Studio package for Linux. Accept the terms and conditions before you can access the download link, as shown in the screenshot below.

Download Android Studio for Linux

Download Android Studio for Linux

Alternatively, you can use wget command to download the Android Studio package from your terminal, then unpack the Android Studio distribution archive and move into the extracted directory, as follows

$ cd Download
$ unzip android-studio-ide-173.4670197-linux.zip
$ cd android-studio/
$ ls

Android Studio Files

Android Studio Files

To launch Android Studio, navigate to the android-studio/bin/ directory, and execute studio.sh. This application initializer script will create several configuration files in the ~/.AndroidStudio3.1 directory.

$ cd bin
$./studio.sh 

Once you run script, it will ask you to import previous Android Studio settings or not, then click OK.

Run Android Studio in Linux

Run Android Studio in Linux

After the applications download and loads a number of components, you will see the setup wizard shown in the screen shot below. Click Next to proceed.

Android Studio Setup Wizard

Android Studio Setup Wizard

Next, select the type of installation you want and click Next.

Android Studio Installation Type

Android Studio Installation Type

Then, choose a UI theme and click Next.

Android Studio UI Theme

Android Studio UI Theme

Now verify settings and click Next to continue.

Android Studio Settings

Android Studio Settings

At this point, you should check emulator settings and click Finish to complete the setup process.

Android Studio Emulator Settings

Android Studio Emulator Settings

Next, the application will download several components as shown. Once all the necessary components have been downloaded, your Android studio will be up to date. Click Finish to start using Android Studio.

Android Studio Components

Android Studio Components

Now create your first project or open an existing one.

Create New Android Studio Project

Create New Android Studio Project

For example, if you choose to start a new project (a mobile phone app), define its settings as shown below and click Next.

Create Android Project

Create Android Project

Then select the form factor and minimum SDK for your app and click Next.

Target Android Devices

Target Android Devices

Next, choose an activity for mobile and click Next to continue.

Add Activity to Mobile

Add Activity to Mobile

Afterwards, create a new basic activity with an app bar. Then click Next to continue.

Configure Activity

Configure Activity

Then the application will install the requested components, one it has done that, click on Finish.

Install Android Studio Components

Install Android Studio Components

Next, the application will also build the gradle project info for your app, as shown, this may take a few minutes.

Building App Gradle Project

Building App Gradle Project

After building the gradle project info, you should be set, you can now work on your project.

Main App Activity View

Main App Activity View

XML App View in Android Studio

XML App View in Android Studio

Conclusion

Android Studio is a powerful and feature-rich IDE for building apps for all android compatible devices. It offers the fastest tools for building apps, and most importantly, it is Android’s official IDE. Use the comment from below to share your thoughts or queries about it, with us.

Source

Redo Backup and Recovery Tool to Backup and Restore Linux Systems

Redo Backup and Recovery software is a complete backup and disaster recovery solution for systems. It provides simple and easy to use functions that anyone can use. It supports bare-metal restore, means even if your computer hard drive totally melts or damaged by a virus, you can still able to restore a completely-functional system running in less than 10 minutes.

All your files and settings will be restored to the exact same situation they were in when the most recent snapshot was taken. Redo Backup and Recovery is a live ISO image is built on Ubuntu to give a graphical user interface for users. You can use this tool to backup and restore every system, it doesn’t matter whether you use Windows or Linux, it works on both platforms, because it is open source and completely free to use for personal and commercial use.

Features

Redo Backup and Recovery tool key features are:

  1. No Installation Needed : You don’t need to install Redo Backup or even you don’t need an operating system installed to restore. Just put the CD device into your system and reboot. No need to re-install Windows again!
  2. Boots in Seconds : The system boots in 30 seconds from CD, and it automatically detect all your hardware. It consumes less space and resources, the download size is only 250MB, and you can download it freely. No serial key or license required.
  3. It’s Pretty : Redo Backup gives an easy to use interface with network access and a complete system via Ubuntu. Operate other applications while your operating system backup is being transferred.
  4. Works with Linux or Windows : Redo Backup works on both operating systems and any computer user can backup and restore all machines with this tool.
  5. Finds Network Shares : Redo Backup automatically search and locate your local area network for drives to backup to or restore from. No need to bother about shared drive or attached network storage device, it detects automatically.
  6. Recover Lost Data : Redo Backup provides a file recovery tool that automatically finds deleted files and save them to another drive.
  7. Easy Internet Access : Is your computer crashed or broken, but you needing an internet access to download drivers? Doesn’t worry just insert Redo Backup CD, reboot, and start browsing the Internet.
  8. Drive Configuration Tools : Redo Backup start menu provides a powerful graphical drive management and partition editing tools to edit, manage and resize partitions.

Download Redo Backup

As I said it’s a Live CD image, so you cannot directly run this program from within the operating system. You need to follow our steps as described below in order to use Redo Backup.

Getting Started

Download the latest version of the Redo Backup live CD.

You will need to burn the ISO disc image using a CD burning software such as KDE Burning Tool for Linux and for Windows there are plenty search for it.

After creating ISO CD image, put the CD in and reboot your computer to use Redo Backup. While system is starting you may need to press F8 or F12 keys to boot from the CD-ROM drive.

Once you boots up system with Live CD, a mini operating system will loaded into memory which will launch Redo Backup. Now decide what you want to do, Backup machines or Restore machines from last saved images. For example, Here I’m taking my own Ubuntu 12.10 system backup, follow the screen grabs below for your reference.

Click on “Start Redo Backup“.

Redo Backup Boot Screen

Redo Backup Boot Screen

Welcome Screen of “Redo Backup“.

Redo Backup Welcome Screen

Redo Backup Welcome Screen

Easily create a backup image of your computer or completely restore from one. Click on “Backup” to create full system backup.

Backup Linux Server

Select Backup

Select the source drive from the drop-down list that you would like to create a backup image from. Click on “Next“.

Linux Partition Backup

Select Partition

Select which parts of the drive to create backup of. Leave all parts selected if you are unsure. Click on “Next“.

Select Partition Backup Drive

Select Partition Backup Drive

Select Destination Drive it could be local drive connected to your computer or shared network drive.

Linux Backup Drive

Select Backup Destination Drive

Next it will ask you to give unique name for this backup image, such as the “date“. Today’s date is automatically entered for you like “20130820“.

Next it will backing up your system to the location you selected. This may take an hour or more depending on the speed of your computer and the amount of data you have.

That’s it, you successfully created backup image for your computer. If you would like to Restore this image on any other computer follow the same procedure and select “Restore“, then follow on-screen instructions.

Reference Link

Redo Backup homepage.

Source

How to Clone or Backup Linux Disk Using Clonezilla

Clonezilla is one of the greatest Open Source backup tool for Linux. The absence of a Graphical User Interface combined with a simpler, fast and intuitive guided command line wizard that runs on top of a live Linux Kernel makes it a perfect candidate back-up tool for every sysadmin out there.

With Clonezilla, not only you can perform a full backup of a device data blocks directly to another drive, also known disk cloning, but you can also backup entire disks or individual partitions remotely (using SSH, Samba or NFS shares) or locally to images which can be all encrypted and stored in a central backup storage, typically a NAS, or even on external hard-disks or other USB devices.

Suggested Read: 8 Best Open Source “Disk Cloning/Backup” Softwares for Linux Servers

In case of a drive failure the backed-up images can be easily restored to a new device plugged-in into your machine, with the remark that the new device must meet the minimum required space value, which is at least the same size that the failed backed-up drive had.

In simpler terms, if you clone a 120 GB hard-disk which has 80 GB free space, you can’t restore the backed-up image to a new 80 GB hard-drive. The new hard drive which will be used for cloning or restoring the old one must have at least the same size as the source drive (120 GB).

Suggested Read: 14 Outstanding Backup Utilities for Linux Systems

In this tutorial we are going to show you how you can clone a block device, typically a hard-disk on top of which we run a CentOS 7 server (or any Linux distribution such as RHELFedoraDebianUbuntu, etc.).

In order to clone the target disk you need to physically add a new disk into your machine with at least the same size as source disk used for cloning.

Requirements

  1. Clonezilla ISO image – http://clonezilla.org/downloads.php
  2. New Hard Drive – physically plugged-in into the machine and operational (consult BIOS for device information)

Suggested Read: How to Backup or Clone Linux Partitions Using ‘cat’ Command

How to Clone or Backup CentOS 7 Disk with Clonezilla

1. After you download and burn Clonezilla ISO image to a CD/DVD, place the bootable media into your machine optical drive, reboot the machine and press the specific key (F11F12ESCDEL, etc) in order to instruct the BIOS to boot from the appropriate optical drive.

2. The first screen of Clonezilla should appear on your screen. Select the first option, Clonezilla live and press Enter key to proceed further.

Clonezilla Boot Screen

Clonezilla Boot Screen

3. After the system loads the required components into your machine RAM a new interactive screen should appear which will ask you to choose your language.

Use up or down arrow keys to navigate through language menu and press Enter key in order to choose your language and move forward.

Select Clonezilla Language

Select Clonezilla Language

4. On the next screen you have the option to configure your keyboard. Just press Enter key at Don’t touch keymap option to move to the next screen.

Configuring Console-data

Configuring Console-data

5. On the next screen choose Start Clonezilla in order to enter Clonezilla interactive console menu.

Start Clonezilla for Interactive Menu

Start Clonezilla for Interactive Menu

6. Because in this tutorial we are going to perform a local disk clone, so choose the second option, device-device, and press Enter key again to proceed further.

Also, make sure that the new hard-dive is already physically plugged-in intro your machine and properly detected by your machine.

Select Disk to Clone

Select Disk to Clone

7. On the next screen choose Beginner mode wizard and press Enter key to move to the next screen.

If the new hard disk is larger than the old one you can choose Expert mode and select -k1 and -r options which will assure that the partitions will be proportionally created in the target disk and the file system will be automatically resized.

Be advised to use the expert mode options with extreme caution.

Select Beginner Mode for Disk Cloning

Select Beginner Mode for Disk Cloning

8. On the next menu choose disk_to_local_disk option and press Enter to continue. This option ensures that a full disk clone (MBR, partition table and data) with the same size as the source disk to target disk will be performed further.

Select Disk to Local Disk Cloning

Select Disk to Local Disk Cloning

9. On the next screen you must choose the source disk that will be used for clone. Pay attention at disk names used here. In Linux a disk can be named sdasdb etc, meaning that sda is the first disk, sdb the second and so on.

In case you’re not sure what’s your source disk name you can physically examine the source disk name and serial No, check SATA port cabling on the motherboard or consult the BIOS in order to obtain disk information.

In this guide we’re using Vmare Virtual disks for cloning and sda is the source disk that will be used for cloning. After you successfully identified the source drive press Enter key in order to move to the next screen.

Select Linux Disk to Clone

Select Linux Disk to Clone

10. Next, select the second disk that will be used as a target for cloning and press Enter key to continue. Proceed with maximum attention because the cloning process is destructive and will wipe all data from the target disk, including MBR, partition table, data or any boot loader.

Choose Local Disk as Target Cloning

Choose Local Disk as Target Cloning

11. If you’re sure the source file system is not corrupted you can safely choose Skip checking/reparing source file system and press Enter to continue.

Next, the command used for this cloning session will be displayed on your screen and the prompt will wait for you to hit the Enter key in order to continue.

Skip Checking Source Filesystem

Skip Checking Source Filesystem

12. Before starting the real process of disk cloning, the utility will display some reports concerning its activity and will issue two warning messages.

Press y key twice to agree with both warnings and press y key the third time in order to clone the boot loader on the target device.

Confirm Disk Cloning Warning Messages

Confirm Disk Cloning Warning Messages

13. After you agreed all warning the clone process will automatically start. All data from the source drive will be automatically replicated to the target device with no user interference.

Clonezilla will display a graphical report regarding all data it transfers from a partition to the other, including the time and speed it takes to transfer data.

Clonezilla Linux Disk Cloning Process

Clonezilla Linux Disk Cloning Process

14. After the cloning process finishes successfully a new report will be displayed on your screen and the prompt will ask you whether you would like to use Cloneziila again by entering command line or exit the wizard.

Just press Enter key to move to the new wizard and from there select poweroff option in order to halt your machine.

Clonezilla Linux Disk Cloning Completed

Clonezilla Linux Disk Cloning Completed

Poweroff Machine

Poweroff Machine

That’s all! The cloning process is finished and the new hard disk can now be used instead of the old one after it has been physically detached from the machine. If the old hard drive is still in better shape you can store it in a safe location and use it as a backup solution for extreme cases.

In case your CentOS File System Hierarchy spawns multiple disks you need to make sure that each disk in the hierarchy is also duplicated in order to backup data in case if one of the disks fails.

Source

Amanda – An Advanced Automatic Network Backup Tool For Linux

In the era of information technology, data is priceless. We have to protect data from unauthorised access as well as from any kind of data loss. We have to manage each of them separately.

Install Amanda in Linux

Amanda Backup Solution

Here, in this article we will be covering data backup process, which is must for most of the System Administrators and most of the time supposed to be boring activity. The tool we will be using is ‘Amanda‘.

What is Amanda

Amanda Stands for (Advanced Maryland Automatic Network Disk Archiver) which is very useful backup tool designed to backup and archive computers on the network to disk, tape or cloud.

Amanda History

The Computer Science Department of University of Maryland (UoM) remained the source of Free and Quality Software which was at par with Proprietary Software. The Advanced Maryland Automatic Network Disk Archiver was developed by UoM but now this wonderful project is no more supported by UoM and is hosted by SourceForge, where it remains in development.

Features of Amands

  1. Open Source Archiving Tool written in C and Perl.
  2. Capable of Data Backup on Multiple Computers on Network.
  3. Based on Client-Server Model.
  4. Scheduled Backup Supported.
  5. Available as Free Community Edition as well as Enterprise Edition, with Full Support.
  6. Available for most of the Linux Distributions.
  7. Windows Machine Supported using Samba or native win32 Client.
  8. Support Tape as well as Disk Drives for backup.
  9. Support tape-spanning i.e., Split lager files into multiple tapes.
  10. Commercial Enterprise Amanda is developed by Zmanda.
  11. Zmanda includes – Zmanda Management Console (ZMC), scheduler, Cloud Based Service and Plugin framework.
  12. The cloud based service works in accordance with Amazon s3.
  13. Plugin framework supports application like Oracle Database, Samba, etc.
  14. Amanda Enterprise zmanda supports image backup, which makes it possible to make backups of Live VMware.
  15. Takes less time than other backup tools to create a backup of same volume of data.
  16. Support Secure Connection between Server and client using OpenSSH.
  17. Encryption possible using GPG and compression supported
  18. Recover gracefully for errors.
  19. Report detailed result, including errors via email.
  20. Very Configurable, Stable and robust because of high quality code.

Installation of Amanda Backup in Linux

We are building Amanda from Source and then Install it. This process of Building and Installing Amanda is same for any distribution be it YUM based or APT based.

Before, compiling from the source, we need to install some required packages from the repository using yum or apt-get command.

On RHEL, CentOS & Fedora
# yum install gcc make gcc-c++ glib2-devel gnuplot perl-ExtUtils-Embed bison flex
On Debian, Ubuntu & Linux Mint
$ sudo apt-get install build-essential gnuplot

Once, required packages installed, you can download Amanda (latest version Amanda 3.3.5) from the link below.

  1. http://sourceforge.net/projects/amanda/files/latest/download

Alternatively, you may use following wget command to download and compile it from source as shown below.

# wget http://jaist.dl.sourceforge.net/project/amanda/amanda%20-%20stable/3.3.5/amanda-3.3.5.tar.gz
# tar -zxvf amanda-3.3.5.tar.gz
# cd amanda-3.3.5/ 
# ./configure 
# make
# make install		[On Red Hat based systems]
# sudo make install	[On Debian based systems]

After successful installation, verify the amanda installation using the following command.

# amadmin --version

amadmin-3.3.5

Note: Use amadmin administrative interface to control Amanda backups. Also note that amanda configuration file is located at ‘/etc/amanda/intra/amanda.conf’.

Dump Filesystem

Run the following command to dump the whole filesystem using amanda and send the email to the email address listed in configuration file.

# amdump all

Flush Amanda

# amflush -f all

Amanda have a lots of options to generate backup output to precise location and create custom backup. Amanda itself is a very vast topic and it was difficult for us to cover all these in one article. We will be covering those options and commands in later posts.

That’s all for now. I’ll be here again with another article soon. Till then stay tuned and connected to us and don’t forget to provide us with your valuable feedback in comment section.

Source

System Tar and Restore – A Versatile System Backup Script for Linux

System Tar and Restore is a versatile system backup script for Linux systems. It comes with two bash scripts, the main script star.sh and a GUI wrapper script star-gui.sh, which perform in three modes: backuprestore and transfer.

Read Also: 14 Outstanding Backup Utilities for Linux Systems

Features

  1. Full or partial system backup
  2. Restore or transfer to the same or different disk/partition layout.
  3. Restore or transfer backup to an external drive such as USB, SD card etc.
  4. Restore a BIOS-based system to UEFI and vice versa.
  5. Arrange a system in a virtual machine (such as virtualbox), back it up and restore it in a normal system.

Requirements:

  1. gtkdialog 0.8.3 or later (for the gui).
  2. tar 1.27 or later (acls and xattrs support).
  3. rsync (for Transfer Mode).
  4. wget (for downloading backup archives).
  5. gptfdisk/gdisk (for GPT and Syslinux).
  6. openssl/gpg (for encryption).

How to Install System Tar and Restore Tool in Linux

To install System Tar and Restore program, you need to first install all the required software packages as listed below.

$ sudo apt install git tar rsync wget gptfdisk openssl  [On Debian/Ubuntu]
# yum install git tar rsync wget gptfdisk openssl       [On CentOS/RHEL]
# dnf install git tar rsync wget gptfdisk openssl       [On Fedora]

Once all the required packages installed, now it’s time to download these scripts by cloning the system tar and restore repository to your system and run these scripts with root user privileges, otherwise, use the sudo command.

$ cd Download
$ git clone https://github.com/tritonas00/system-tar-and-restore.git
$ cd system-tar-and-restore/
$ ls

Install System Tar and Restore

Install System Tar and Restore

Linux System Backup

First create a directory where your system backup files will be stored (you can actually use any other directory of your choice).

$ sudo mkdir /backups

Now run the following command to create a system backup file in /backups directory, the archive file will be compressed using the xz utility, where the flags are.

  • -i – specifies the operation mode(0 meaning backup mode).
  • -d – specifies destination directory, where the backup file will be stored.
  • -c – defines the compression utility.
  • -u – allows for reading additional tar/rsync options.
$ sudo ./star.sh -i 0 -d /backups -c xz -u "--warning=none"

Perform Linux System Backup

Perform Linux System Backup

To exclude the /home in the backup, add the -H flag, and use gzip compression utility as shown.

$ sudo ./star.sh -i 0 -d /backups -c gzip -H -u "--warning=none"

Restore Linux System Backup

You can also restore a backup as in the following command.

$ sudo ./star.sh -i 1 -r /dev/sdb1 -G /dev/sdb -f /backups/backup.tar.xz

where the option are:

  • -i – specifies operation mode (1 meaning restore mode).
  • -r – defines targeted root (/) partition.
  • -G – defines the grub partition.
  • -f – specified the backup file path.

The final example show how to run it in transfer mode (2). The new option here is -b, which sets the boot partition.

$ sudo ./star.sh -i 2 -r /dev/sdb2 -b /dev/sdb1 -G /dev/sdb

In addition, if you have mounted /usr and /var on separate partitions, considering the previous command, you can specify them using the -t switch, as shown.

$ sudo ./star.sh -i 2 -r /dev/sdb2 -b /dev/sdb1 -t "/var=/dev/sdb4 /usr=/dev/sdb3" -G /dev/sdb

We have just looked a few basic options of System Tar and Restore script, you can view all available options using the following command.

$ star.sh --help 

If you are accustomed to graphical user interfaces, you can use the GUI wrapper star-gui.sh instead. But you need to install gtkdialog – used to create graphical (GTK+) interfaces and dialog boxes using shell scripts in Linux.

System Tar and Restore Gui

System Tar and Restore Gui

You can find more command-line usage examples from the System Tar and Restore Github repository: https://github.com/tritonas00/system-tar-and-restore.

Summary

System Tar and Restore is a simple yet powerful, and versatile system backup script for Linux systems. Try it out comprehensively and share your thoughts about it via the feedback form below.

Source

How to Create Encrypted and Bandwidth-efficient Backups Using ‘Duplicity’ in Linux

Experience shows that you can never be too paranoid about system backups. When it comes to protecting and preserving precious data, it is best to go the extra mile and make sure you can depend on your backups if the need arises.

Create Encrypted Linux File System Backups

Duplicity – Create Encrypted Linux File System Backups

Even today, when some cloud and hosting providers offer automated backups for VPS’s at a relatively low cost, you will do well to create your own backup strategy using your own tools in order to save some money and then perhaps use it to buy extra storage or get a bigger VPS.

Sounds interesting? In this article we will show you how to use a tool called Duplicity to backup and encrypt file and directories. In addition, using incremental backups for this task will help us to save space.

That said, let’s get started.

Installing Duplicity

To install duplicity in Fedora-based distros, you will have to enable the EPEL repository first (you can omit this step if you’re using Fedora itself):

# yum update && yum install epel-release

Then run,

# yum install duplicity

For Debian and derivatives:

# aptitude update && aptitude install duplicity

In theory, many methods for connecting to a file server are supported although only ssh/scp/sftp, local file access, rsyncftp, HSI, WebDAV and Amazon S3 have been tested in practice so far.

Once the installation completes, we will exclusively use sftp in various scenarios, both to back up and to restore the data.

Our test environment consists of a CentOS 7 box (to be backed up) and a Debian 8 machine (backup server).

Creating SSH keys to access remote servers and GPG keys for encryption

Let’s begin by creating the SSH keys in our CentOS box and transfer them to the Debian backup server.

The below commands assumes the sshd daemon is listening on port XXXXX in the Debian server. Replace AAA.BBB.CCC.DDD with the actual IP of the remote server.

# ssh-keygen -t rsa
# ssh-copy-id -p XXXXX root@AAA.BBB.CCC.DDD

Then you should make sure that you can connect to the backup server without using a password:

Create SSH Keys

Create SSH Keys

Now we need to create the GPG keys that will be used for encryption and decryption of our data:

# gpg --gen-key

You will be prompted to enter:

  1. Kind of key
  2. Key size
  3. How long the key should be valid
  4. A passphrase

Create GPG Keys

Create GPG Keys

To create the entropy needed for the creation of the keys, you can log on to the server via another terminal window and perform a few tasks or run some commands to generate entropy (otherwise you will have to wait for a long time for this part of the process to finish).

Once the keys have been generated, you can list them as follows:

# gpg --list-keys

List Generated GPG Keys

List Generated GPG Keys

The string highlighted in yellow above is known as the public key ID, and is a requested argument to encrypt your files.

Creating a backup with Duplicity

To start simple, let’s only backup the /var/log directory, with the exception of /var/log/anaconda and /var/log/sa.

Since this is our first backup, it will be a full one. Subsequent runs will create incremental backups (unless we add the full option with no dashes right next to duplicity in the command below):

PASSPHRASE="YourPassphraseHere" duplicity --encrypt-key YourPublicKeyIdHere --exclude /var/log/anaconda --exclude /var/log/sa /var/log scp://root@RemoteServer:XXXXX//backups/centos7

Make sure you don’t miss the double slash in the above command! They are used to indicate an absolute path to a directory named /backups/centos7 in the backup box, and is where the backup files will be stored.

Replace YourPassphraseHereYourPublicKeyIdHere and RemoteServer with the passphrase you entered earlier, the GPG public key ID, and with the IP or hostname of the backup server, respectively.

Your output should be similar to the following image:

Create /var Partition Backup

Create Backup using Duplicity

The image above indicates that a total of 86.3 MB was backed up into a 3.22 MB in the destination. Let’s switch to the backup server to check on our newly created backup:

Confirm Backup File

Confirm Backup File

A second run of the same command yields a much smaller backup size and time:

Compress Backup

Compress Backup

Restoring backups using Duplicity

To successfully restore a file, a directory with its contents, or the whole backup, the destination must not exist (duplicity will not overwrite an existing file or directory). To clarify, let’s delete the cron log in the CentOS box:

# rm -f /var/log/cron

Delete Cron Logs

Delete Cron Logs

The syntax to restore a single file from the remote server is:

# PASSPHRASE="YourPassphraseHere" duplicity --file-to-restore filename sftp://root@RemoteHost//backups/centos7 /where/to/restore/filename

where,

  1. filename is the file to be extracted, with a relative path to the directory that was backed up
  2. /where/to/restore is the directory in the local system where we want to restore the file to.

In our case, to restore the cron main log from the remote backup we need to run:

# PASSPHRASE="YourPassphraseHere" duplicity --file-to-restore cron sftp://root@AAA.BBB.CCC.DDD:XXXXX//backups/centos7 /var/log/cron

The cron log should be restored to the desired destination.

Likewise, feel free to delete a directory from /var/log and restore it using the backup:

# rm -rf /var/log/mail
# PASSPHRASE="YourPassphraseHere" duplicity --file-to-restore mail sftp://root@AAA.BBB.CCC.DDD:XXXXX//backups/centos7 /var/log/mail

In this example, the mail directory should be restored to its original location with all its contents.

Other features of Duplicity

At any time you can display the list of archived files with the following command:

# duplicity list-current-files sftp://root@AAA.BBB.CCC.DDD:XXXXX//backups/centos7

Delete backups older than 6 months:

# duplicity remove-older-than 6M sftp://root@AAA.BBB.CCC.DDD:XXXXX//backups/centos7

Restore myfile inside directory gacanepa as it was 2 days and 12 hours ago:

# duplicity -t 2D12h --file-to-restore gacanepa/myfile sftp://root@AAA.BBB.CCC.DDD:XXXXX//remotedir/backups /home/gacanepa/myfile

In the last command, we can see an example of the usage of the time interval (as specified by -t): a series of pairs where each one consists of a number followed by one of the characters smhDWM, or Y (indicating seconds, minutes, hourse, days, weeks, months, or years respectively).

Summary

In this article we have explained how to use Duplicity, a backup utility that provides encryption for files and directories out of the box. I highly recommend you take a look at the duplicity project’s web site for further documentation and examples.

We’ve provided man page of duplicity in PDF format for your reading convenience, is also a complete reference guide.

Feel free to let us know if you have any questions or comments.

Source

Aptik – A Tool to Backup/Restore Your Favourite PPAs and Apps in Ubuntu

As we all know that Ubuntu has a six month release cycle for new version. All the PPAs and Packages of your choice also needs to be re-added, to avoid doing those stuffs and save your time, here we bringing a fantastic tool called ‘Aptik‘.

Aptik (Automated Package Backup and Restore) is a GUI application that lets you backup your favourite PPAsand Packages. It is very difficult to remember to which packages are installed and from where it has been installed them. We can take backup and restore of all the PPAs before re-installation or up-gradation of OS.

Install Aptik in Ubuntu

Backup/Restore PPAs and Apps

Aptik is a open source package that simplify backup and restore of PPAsApplications and Packages after a fresh installation or upgradation of Debian based UbuntuLinux Mint and other Ubuntu derivatives.

Features of Aptik

  1. Custom PPAs and the Apps
  2. Backup Themes and icons
  3. Backup applications installed via APT cache
  4. Apps installed from Ubuntu Software Centre
  5. Aptik command-line options

How to Backup PPA’s and Packages on Old Systems

By default Aptik tool is not available under Ubuntu Software Centre, you need to use PPA to install it. Add the following PPA to your system and update the local repository and install package as shown.

Installation of Aptik

$ sudo apt-add-repository -y ppa:teejee2008/ppa
$ sudo apt-get update
$ sudo apt-get install aptik      [Commandline]
$ sudo apt-get install aptik-gtk  [GUI]

Start ‘Aptik‘ from the applications menu.

Start Aptik

Start Aptik

Create Backup Directory

Create or Select a backup directory to store your all sections to re-use on your new install.

Aptik Backup-Directory

Select Backup Directory

Backup Software Sources

Click the ‘Backup‘ button for Software Sources. A list of installed third-party PPAs will be displayed along with their Packages names that are installed from the PPA.

Aptik Software Sources

Backup Software Sources

Note: PPAs with a green icon indicates as active and have some packages installed. Whereas yellow icon indicates as active but no packages installed.

Select your favourite PPAs and click on the ‘Backup‘ button to create backup. All PPAs will be stored in a file called ‘ppa.list‘ in the selected backup directory.

Backup Downloaded Packages (APT Cache)

Click the ‘Backup‘ button to copy all the downloaded packages to backup folder.

Aptik Downloaded Packages

Backup Downloaded Packages

Note: All the downloaded packages stored under your ‘/var/cache/apt/archives‘ folder will be copied to the backup folder.

This step is only useful if you are re-installing the same version of Linux distribution. This step can be skipped for upgradation of system, since all the packages for the new release will be latest than the packages in the system cache.

Backup Software Selections

Clicking the ‘Backup‘ button will show a list of all installed top-level packages.

Aptik Software Selections

Software Selections

Note: By default all the packages installed by Linux distribution are un-selected, because those packages are the part of Linux distribution. If required those packages can be selected for backup.

By default all extra packages installed by the user marked as selected, because those packages are installed via Software Centre or by running apt-get install command. If required those can be un-selected.

Select your favourite packages to backup and click the ‘Backup‘ button. A file named ‘packages.list‘ will be created under the backup directory.

Backup Backup Themes and Icons

Click the ‘Backup‘ button to list all the installed themes and icons from the ‘/usr/share/themes‘ and ‘/usr/share/icons‘ directories. Next, select your themes and click on the ‘Backup‘ button to backup.

Aptik Themes Icons

Backup Themes Icons

Aptik Command-line Otions

Run ‘aptik –help’ on the terminal to see the full list of available options.

Aptik Command-line

Command-line Options

To restore those backups, you will need to install Aptik from its own PPA on the newly installed system. After this, hit the ‘Restore’ button to restore all your PPAs Packages, Themes and Icons to your freshly installed system.

Conclusion

You may be wondering why such cool stuff is not by default available on Ubuntu? Ubuntu does it via ‘Ubuntu One‘ and that too paid apps. What do you think about this tool? Share you views through our comment section.

SourceAptik

Source

WP2Social Auto Publish Powered By : XYZScripts.com