Restore data from amanda backup server

Go to install and configure Amanda backup Server

Continution to my post install and configure amanda backup server i am posting step by step process of
recovering data from the backup server.

Our Current Scenario is :

1. My daily backup profile is DailySet1

2. The data backup is in /data/amanda/vtape/DailySet1 on amanda server.

3. We will recover data on client system to /tmp/amanda  directory

-----------------------------------------------------------------------------------------------
Do this on Amanda Client System
-----------------------------------------------------------------------------------------------

Switch user to root

# sudo su
 Then as a root user do amrecover

# amrecover DailySet1

 then use  listdisk command to see the list of  backups

# listdisk

  it shows the client names and the directories we are taking backup on that client
Then use setdisk command to set the directory which we want to recover data from


# setdisk /data/backup


then add the files you want to recover for example if you want to recover file1
use

# add file1


In my case i have give only one file to take backup so i will use '*' to  recover all files in that
direcory.


# add *


Then finally use extract command to recover all files.


The output of all these commands can be seen here :




After giving extract command it will gives the list of data extracting location , tapes needed and the location of backup directory and it will ask for confirmation


Continue [ ?/Y/n/s/d]?


i am showing the rest of the flow in screen shots have a look at them



we can see from the above screenshot that amanda-backup-client debian package has been recovered .


we can see that file below in the temp directory.



Go to install and configure Amanda backup Server


Protected by Zmanda

Install and configure Amanda Backup Server




Amanda is one of the complex installation as it has got many features and one can be easily be confused when
installing it for first time. So i have thought of  sharing minimal installation steps to jump start your backup

First download Server and Client packages of  amanda depending on operating system you use from below
location

http://www.zmanda.com/downloads/community/Amanda/

I have taken 2 ubuntu machines 9.04

Server -- 192.168.155.108  - amanda-backup-server_3.1.0-1Ubuntu904_i386.deb
Client  -- 192.168.155.109 - amanda-backup-client_3.1.0-1Ubuntu904_i386.deb

after installation just update your repository
------------------------------------------------------------------------------------------------
On Server do this 
-----------------------------------------------------------------------------------------------


#apt-get update

then install all build essentials required for a package to install

#apt-get install build-essential

afther that install debian package

#dpkg -i  amanda-backup-server_3.1.0-1Ubuntu904_i386.deb

I've noticed that if I try to install this package it doesn't seem to work because of missing dependent librararies typing


#apt-get -f install

will solve dependency problem

After installation of that package

User amandabackup
group disk
 will be created.

add password for the user amandabackup

# passwd amandabackup

after adding user we need to create directory where our backup has to be stored.

# mkdir -p /data/amanda/vtape/DailySet1
# chown amandabackup:disk /data/amanda/vtape/DailySet1
# chmod -R 750 /data/amanda/vtape/DailySet1



------------------------------------------------------------------------------------------------
On Client do this 
-----------------------------------------------------------------------------------------------
 Install client package same as you installed on server

here also user amandabackup will get created

change password for user amandabackup

#passwd amandabackup

The client configuration file of amanda is

/etc/amanda/amanda-client.conf

Change this line:

tapedev    "tape:/dev/YOUR-TAPE-DEVICE-HERE" # your tape device
to this:

tapedev    "file://data/amanda/vtape/DailySet1" # your tape device

this is the location where we are taking backup.

after configuring  go to server again.

------------------------------------------------------------------------------------------------
On Server do this 
-----------------------------------------------------------------------------------------------

We have created a backup directory and created user amandabackup and set its password on Server
now switch user to amandabackup

# su – amandabackup

then enter this command to configure server configuration file for DailySet1

# amserverconfig DailySet1 --template harddisk --tapedev /data/amanda/vtape/DailySet1 --mailto root@localhost --dumpcycle 1week --runspercycle 5 --tapecycle 12 --runtapes 1

the output will be:



















Now adding Client 192.168.155.109 on server give second command

Explaining:
amserverconfig : command that creates the initial Amanda configuration
daily : the name of this backup set
template disk : this backup is written to disk (or “virtual” tape -vtape-)
tapedev /var/lib/amanda/vtapes/daily : this is the path of the vtapes
mailto me@mydomain.com : Amanda emails the backup report to this address
dumpcycle 5 : This backup cycle has 5 days (lets say ... Mon to Fri)
runspercycle 1 : This backup runs only once per day
tapecycle 20 : 20 vtapes (4 weeks) on the cycle
runtapes 1 : The maximum number of tapes (in this case “vtapes”) used in a single run


# amaddclient --config DailySet1 --client 192.168.155.109 --diskdev /data/backupme --dumptype  comp-user-tar


/data/backupme  is the directory on the client you want to take backup

output will be :

























after adding client now everything is ready we should test its working or not
we can test it using amcheck command

# amcheck DailySet1


the output will be:













Now checking is successful if you see 0 problems found in the output as shown above.
now we are ready to take first backup with the command amdump

# amdump DailySet1

This command will take backup and the status is emailed to root@localhost of server as we have configured above.

the mail will be like this :


From amandabackup@amandaserver  Tue Jul 20 15:19:10 2010
Return-Path:
X-Original-To: root@localhost
Delivered-To: root@localhost
Received: by amandaserver (Postfix, from userid 1001)
    id 98122602ED; Tue, 20 Jul 2010 15:19:10 -0400 (EDT)
To: root@localhost
Subject: DailySet1 AMANDA MAIL REPORT FOR July 20, 2010
Message-Id: <20100720191910.98122602ED@amandaserver>
Date: Tue, 20 Jul 2010 15:19:10 -0400 (EDT)
From: amandabackup@amandaserver (Amanda)

Hostname: amandaserver
Org     : DailySet1
Config  : DailySet1
Date    : July 20, 2010

These dumps were to tape DailySet1-1.
The next tape Amanda expects to use is: 1 new tape.
The next new tape already labelled is: DailySet1-2.


STATISTICS:
                          Total       Full      Incr.
                        --------   --------   --------
Estimate Time (hrs:min)     0:00
Run Time (hrs:min)          0:00
Dump Time (hrs:min)         0:00       0:00       0:00
Output Size (meg)            1.6        1.6        0.0
Original Size (meg)          1.6        1.6        0.0
Avg Compressed Size (%)     98.8       98.8        --
Filesystems Dumped             1          1          0
Avg Dump Rate (k/s)        163.1      163.1        --

Tape Time (hrs:min)         0:00       0:00       0:00
Tape Size (meg)              1.6        1.6        0.0
Tape Used (%)                0.0        0.0        0.0
Filesystems Taped              1          1          0
Parts Taped                    1          1          0
Avg Tp Write Rate (k/s)    160.1      160.1        --

USAGE BY TAPE:
  Label               Time         Size      %    Nb    Nc
  DailySet1-1         0:00           0G    0.0     1     1

NOTES:
  planner: Adding new disk 192.168.155.109:/home/vxadmin.
  taper: tape DailySet1-1 kb 1601 fm 1 [OK]


DUMP SUMMARY:
                                       DUMPER STATS               TAPER STATS
HOSTNAME     DISK        L ORIG-GB  OUT-GB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
-------------------------- ------------------------------------- -------------
192.168.155. -me/vxadmin 0       0       0   98.8    0:10  163.2   0:10  160.1

(brought to you by Amanda version 3.1.0)


So you have succesfully taken backup of your first client

How to Restore data from Amanda Backup Server


Protected by Zmanda

solution for error: glib not found or too old

 sudo apt-get install libgtk1.2-dev

another error we get is


checking for glib-config... no
checking for GLIB - version >= 1.2.2... no
*** The glib-config script installed by GLIB could not be found
*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GLIB_CONFIG environment variable to the
*** full path to glib-config.
configure: error: *** GLIB >= 1.2.2 not installed - please install first ***





Solution for that is:

sudo apt-get install libglib2.0-0, libglib2.0-0-dev

or 

sudo apt-get install libglib*




Hard disk cloning in linux

To Replace the hard disk need to be taken the clone of the new hard disk

The procedure is as follows:

Cloning a hard drive is a good way to create an "image," or snapshot of our current operating system as a back-up. It is also useful if we want to transfer the contents of the running mangement node computer exactly as it is, complete with all preferences, from an old drive to a new one.

Instructions:

--Back up all important data, in case anything goes wrong.

--Detach any storage devices--including external drives, memory cards, cameras and memory cards--besides the drive you want to clone and the destination drive where you want to store the image.

--Boot the computer where vx64 is running with Linux live CD.
--Learn the naming scheme for the computer's drives by opening a Linux terminal window and typing the following command:

#sudo fdisk -l
--Take note of (and preferably write down) the information under the "Device" column. It will include a list of one or more items named /dev/sda1, /dev/sda2, /dev/sdb, and so forth. The letters (sda, sdb) indicate separate hard drives. The numbers (sda1, sda2) indicate separate partitions within each drive.

Note: The new hard disk is raw..hence need to format the raw hard disk by typing the command

#mkfs

hence the fdisk will show the new hard disk as dev/sdb as if the old one is dev/sda.

--Using the information you obtained from the previous step(#fdisk -l), determine which is your source drive (/dev/sda) and your destination drive (dev/sdb).

--Some clues include the size of the respective drives and their partitions. For example: You are trying to clone a 60-gigabyte source drive onto a 120-gigabyte destination drive. If the previous step tells you /dev/sda has a 60-gigabyte capacity and /dev/sdb has a 120-gigabyte capacity, you can use their respective sizes to tell which is which. Another example: You are copying a three-partition source drive onto a blank destination drive. You see four rows labelled: /dev/sda1, /dev/sda2, /dev/sda3 and /dev/sdb. Next to them are numbers that correspond to each of your partitions and a blank field next to /dev/sdb. You can conclude that sda is your source drive and sdb is your destination drive.

--Open a terminal window.
--Type in the following command, replacing SOURCE with the name of the source drive and DESTINATION with the name of your destination drive:

#dd bs=4k if=/dev/sda of=/dev/sdb conv=noerror,sync

--Here, if=... sets the source and of=... sets the destination. "dd" doesn't care of the contents of the hard disk. It just reads bytes from /dev/sda and writes them into /dev/sdb. It doesn't know what are files. So, the hard disk file system and how many partitions it has are not important. For example, if /dev/sda is splitted into three partitions, the /dev/sdb will have the same partitions. i.e. "destination" is completely same with "source"

Note:To clone only one partition from the source drive, specify the partition (e.g., /dev/sda1 or /dev/sda2). To clone the entire drive, specify only the drive name, with no partition number (e.g., /dev/sda).

to execute "dd" you should login as "root" or switch to "root" using "su" command. And you must be careful, a small mistake may cause a serious problem!

--Wait. Cloning a large drive using dd can take hours, and according to some accounts, even more than a day.

Tips & Warnings:

--After the process is complete, test whether cloning took place properly by attempting to boot from your destination drive.

--Giving dd to the wrong source and destination drives can cause you to overwrite important data. Be sure to input the correct source and destination drives. Always back up important data before attempting this process.

Most of time we don't want to make a complete duplication of hard disk. Then we may prefer to creating an image file of the hard disk and save it in other storage devices. The following command will create an image file "disk1.img" in your user's directory from /dev/sda:

#dd if=/dev/sda of=~/disk1.img

Since you have created an image file, you can compress it with "gzip" or "bzip2":

gzip disk1.img #generates disk1.img.gz or

bzip2 disk1.img #generates disk1.img.bz2

You can save much storage space with compression. But it will take very long time.

To restore a partition or a hard disk from an image file, just exchange the arguments "if" and "of". For example, restore the whole hard disk from the image file "disk1.img":
#dd if=disk1.img of=/dev/sda

Restore the first partition of /dev/sda from the image file "disk2.img":

dd if=disk2.img of=/dev/sda1


My practical test in our lab environment

-Created on virtual machine(min10GB) on esxi box

-After success ful installation shutdown the virtual machine and added new hard disk form the vsphere client add and remove console with incresing the disk size upto 12 GB

-now the boot priority changed to cdrom as the first boot device and the vm is booted with the live cd of Ubuntu linux.

-- formated the new hard disk and mounted the volume and cloned the old hard disk to the new one with "ddcommand"
-- after completion of the process the boot priority is chnaged the new harddisk and booted

-- after successful boot the os on the new hard disk is running fine and proper.

Installing and configuring Web keepass Step by Step - Raja Antony

What is Webkeepass?   
A free, easy to use password manager which helps you to manage your passwords in a secure way. Focused on deep encryption and ease of use. Also supports importing/exporting of KeePass data!

How to Use WebkeePass:

 There are 4 sections in webkeepass:

1) work with my passwords

                   - My passwords Profile
                   - Edit My password
                   - My password by category

2) KeePass import/export

                  -  import KeePass xml
                  - export KeePass xml

3)work with shared passwords

                  - Share my passwords
                  - My passwords shared profile
                  - Passwords shared by others

4)work with web users

                 -  Web user profile
                 -  Edit web users
                 - Web user group profile
                 - Edit web user groups 
 
Admin will work with all the 4 sections, whereas normal user, as far now is granted to use only 1 and 3 sections.  


How to Login?
                               URL :  https://Yourpublicip:8443/                           - External
                                          https://localhost:8443/                                 - Internal


you need to have credentials to login to webkeepass.

What to do After Logging In?

Edit Password: If you want to store your personal usernames and passwords :

 click on Edit My password ->     Give password ID(It can be IP or Name)
                                                       Enter username and password.




beside password box you can see … button, you can use this button not to show password as  you type. Just beside that you can see one more button, which can be useful to create password. Incase If you want to copy the password, you can use the Last button, and use your gedit or notepad to save the password within 10 seconds.
Click on “Update changes” which is on top menu.
Now you have saved one password. Likewise, you can save as many passwords as you want.




My Passwords Profile:     You can use this button to List out all the Password IDs of yours:





If you want to share your Passwords, Select the option “share my password”

Share My Passwords:




In the above picture you can see Password ID#. Click on it and you can see screen like below:




Select the Password ID that you want to share and Double click it. It will be shown in the Password ID# box like below.


From the above picture, you can see one option saying New Share. Select it, and then enter webuser/web group name, to whom you want to share.(Note: case sensitive).

 For this you need to know web user id / web user group name.
Web user groups :          Management
operations
development and testing.

Web user names:
User1
User2
User3



Then check the box share active. Later if you want to remove the share, just uncheck the share active check box.Click on Update Changes. You can see confirmation message like this.














My shared Password Profile:
Here you can see, what are the Password IDs that you are sharing to others.






Passwords Shared By Others:
If you want to see, what are all the passwords are shared to you by admin or  others. Click on  “ Passwords shared by others”.


















At Bottom, you can see view password option. Use this to see any of the passwords that are shared to you.


Work with Web Users profiles:   Here we can define the usernames and passwords, who can login to WebkeePass interface.
Edit Web Users:


















Give user ID and Password. Address information is optional. In Access Information box, we need to check user active and add that user to any of the web groups we have created or already created. By default, there are two web groups:
1)    Admins
2)    Users
    Enter the User Group appropriate and then click on Add/Update. Now he can login via web with the url given along with credentials provided.

Web User Profile:
Here we can see how many web users are existed and to which they belong to.




















Web User Groups:   To create new web user group: click on Edit web User Groups.


















Enter UserGroup and then check Group Active box ….etc. Use Menu XML button to select type of xml sheet to be used , give date format, select server access.
Now, click on Add/Update to add the web group.
Why do we need this Web Groups?
If you have observed how we are sharing our Password IDs. They can be shared to web user/web group. Most of the time, it is very difficult to share the password ID to each individual users. It consumes lot of time. So what we can do? Since, we have created few groups. At the time of creating users add them to appropriate groups. While sharing simply share to the group. Now all the group members can have access to the share.
Web User Group Profile:
Click on WebUserGroupProfile. You’ll be shown nothing there.





















Click on ‘Find-it’ which you can see on top. Now you will be displayed all the groups that are existed like below:

































That’s it.

Overview:

Options                                                                          Usage
My Password Profile          ---------------------->      To list out all the Password IDs
Edit Password                    ---------------------->      create new Password IDs
Share My Passwords      ---------------------->     To share passwords to web users/web groups           
My shared Password Profile ---------------------->     To List out all the passwords that are shared.
Passwords shared By others    ---------------------->   To view the passwords that are shared by others
Web User Profile         ---------------------->        To list out all the web users existed
Edit Web Users       ---------------------->     To create new web users and add them to any web group
Web User Group Profile      ---------------------->     To see all the web groups which are created
Edit Web User Groups         ---------------------->    To create New web User Group

Mail linux man pages to mail in Pdf format


man -t sendmail | ps2pdf - sendmail.pdf

It uses  Postscript to Portable Document format converter