Sunday, May 27, 2007

Backups with LVM

Some time back I came across this link -> apps that make linux users powerful! « Jag! and came to know about many applications which exists for Linux but we do not know about them.

Why do we not know about them, its just only one reason, because we do not pay enough attention. But some one is doing it.

Recently we came across a problem that we had to take backup of Linux Open files. Our current solution could not take backup just because we purchase stupid software without thinking about it. I was not INVOLVED in that decision, but some how now I have manage that.

Next upgrade of backup software, which can take open files backup was $90K away. And I was NO way interested in purchasing that. We came up with an idea of using Linux snapshots, but since our systems were RHEL 3.0 Kernel 2.4, Linux snap shot was not an easy go. We came up with an error of not able to allocate memory while creating snapshot logical volume.

So error was lvcreate -- ERROR "Cannot allocate memory" creating VGDA and any time I search for something on Google I am point to this mail thread with no answers from any one. All forums would point to it and some suggested to upgrade to LVM2 with Kernel 2.6, which was not the answer I was looking for. I had to fix this some how!

I got hold of some patches, started looking through code, patching and booting kernel did not get me any where! the error was causing because of himem allocation error or something like that. While going through plain C code for like 9 hours, I found the solution but on the same time I realized that I can pass it to kernel as mem boot option. But I changed the code compiled the kernel, increased the default memory! And voila it worked, but this was not manageable, because everytime kernel sources gets updated I need to recompile the kernel, I tried to pass this as boot option (mem=4000m) and it worked again.

So to fix this error, most probably you need to add this boot option in grub.conf and you are most probably sorted. (fingers crossed)

So after that it was just so smooth to do backups with LVM Snapshot!

I really do not know, why people are still afraid of using Linux?

No comments: