Online backup using Linux Logical Volume Manager (LVM)

Performing backup of your logical volume is pretty easy and fast. It is the safest way to backup any “open” files/databases.

1) Creating a snapshot of your current LVM

[root@svr2 ~]# lvcreate -L1000M -s -n volbackup /dev/VolGroup00/datavol
Rounding up size to full physical extent 1.00 GB
Logical volume “volbackup” created

2) You should see lvdisplay stating the snapshot LVM.

[root@svr2 ~]# lvdisplay /dev/VolGroup00/volbackup
— Logical volume —
LV Name /dev/VolGroup00/volbackup
VG Name VolGroup00
LV UUID H1s7bn-TKCu-sdfE-Xi0M-oZNA-ixvq-xsWvZj
LV Write Access read/write
LV snapshot status active destination for /dev/VolGroup00/datavol
LV Status available
# open 0
LV Size 100.00 GB
Current LE 3200
COW-table size 1.00 GB
COW-table LE 32
Allocated to snapshot 0.00%
Snapshot chunk size 4.00 KB
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:4

3) Create a folder for it to do a proper mount.

[root@svr2 ~]# mkdir /backupvol
[root@svr2 ~]# mount /dev/VolGroup00/volbackup /backupvol

4) Do the backup now.

[root@svr2 ~]# tar -cf /root/datavol.tar.gz /backupvol

5) Umount, remove folder and delete the snapshot LVM

umount /backupvol
rm -rfv /backupvol
lvremove /dev/VolGroup00/volbackup

Hope this helps someone out there…

unixbench

I order a USA VPS to play around with today, just for fun. No serious stuff on it. Decided to run Unixbench but hit with some minor problem.

./src/ubgears.c:641: warning: implicit declaration of function âevent_loopâ
./src/ubgears.c:643: warning: implicit declaration of function âglXDestroyContextâ
./src/ubgears.c:645: warning: implicit declaration of function âXDestroyWindowâ
./src/ubgears.c:646: warning: implicit declaration of function âXCloseDisplayâ
make: *** [pgms/ubgears] Error 1

**********************************************
Run: “make all” failed; aborting

This is due to some development tools not installed.
Solution:

yum install -y SDL-devel mesa-libGL-devel

Hope this helps someone out there …

PING: transmit failed, error code 1232

After using Internet Download Manager for close to 48 hours, I face this problem after a restart

Problem:

C:\Users\Tan>ping 4.2.2.2

Pinging 4.2.2.2 with 32 bytes of data:

PING: transmit failed, error code 1232.
PING: transmit failed, error code 1232.
PING: transmit failed, error code 1232.
PING: transmit failed, error code 1232.

Solution:

Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\Users\Tan>netsh winsock reset

After which, just do a restart and your network will be back to normal.

Hope this helps someone out there…

Protected: Legal Purpose: Monitor Exim in+out email

This post is password protected. To view it please enter your password below:


ImportError: No module named setuptools

Problem:

Traceback (most recent call last):
File “setup.py”, line 1, in
from setuptools import setup, find_packages
ImportError: No module named setuptools

Solutions:

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install

Hope this helps someone out there ;)

openvz vzdump error

I am using vzdump tool which make use of LVM to do snapshot of the VPS which ensure that there is data consistency during the backup as the VPS is online while the backup is performed.

A small issues just happen today which took me a while to figure how to resolve the issues.

While the vzdump is performing a backup of one of my VPS, i hit with this error

Feb 21 01:33:32 INFO: tar: ./boot: Warning: Cannot savedir: Input/output error

The first impression is that the disk might have issues, but after 5 mins of verifying of the physical disk’s health, I have notice that it is due to the LVM snapshot created during the backup.

The default size that vzdump create for the logical volume is only 500MB, you need to increase to a higher diskspace provided your Volume Group has enough free space.

nano -w /usr/bin/vzdump

Edit 500m to a higher diskspace as needed.

run_command (\*LOG, “$lvcreate –size 500m –snapshot –name vzsnap /dev/$lvmvg/$lvmlv”);

Hope this helps … :)

Detecting Duplicate IP Address using arping

I have been facing a loss of connection suddenly, so I am suspecting that some host on the network is using the same IP address with me.

So I used this tool called arping.

Let’s said I want to check whether 192.168.1.1 is configure on more than 1 host. You need to test it on another machine which is not configure as 192.168.1.1

[svr1:/root]# arping -I eth0 -c 3 192.168.1.1
ARPING 192.168.1.1 from 192.168.1.99 eth0
Unicast reply from 192.168.1.1 [00:0D:A2:02:3B:53] 1.090ms
Unicast reply from 192.168.1.1 [00:0D:A2:02:3B:53] 0.837ms
Unicast reply from 192.168.1.1 [00:0D:A2:02:3B:53] 1.031ms
Sent 3 probes (1 broadcast(s))
Received 3 response(s)

As you can see, the host that response has the same mac address means this IP address is not conflict with any of the host on the network.

To simplify things, you can use this single command that uses “Duplicate address detection mode (DAD)”.

[svr1:/root]# arping -D -I eth0 -c 3 192.168.1.1 >/dev/null;echo $?
1

If you get “0″, it means that the IP address has conflict with another host

    or

it also means that there is no host in the network configured on the IP address.

So I got “1″ on the IP address I am trying to detect, it looks like IP conflict is not a issue here for me.

Hope this helps someone…

Protected: Exim Manual Route

This post is password protected. To view it please enter your password below:


Kloxo lxadmin reset password

To reset lxadmin, you can do through SSH with just two commands.

cd /usr/local/lxlabs/lxadmin/httpdocs
lphp.exe ../bin/common/resetpassword.php master mypassword

Enjoy!

Force fsck on reboot

Sometimes if you suspect your file system is corrupted, you might want to run fsck to check against the file system. You just need to create a simple file at the root partition.

touch /forcefsck
reboot

Simple and easy =)