Skip to main content


Showing posts from January, 2011

Moving your mysql database to another hard disk

Recently, my server's only hard disk was almost full. I bought a new hard disk with bigger size and I decided to just add it as a second hard disk. Since I need to move it to the 2nd hard disk, I need to find a proper way to move the db with minimum downtime. So I googled around and found a solution.
First, I needed to format the 2nd hard disk and I chose xfs as the filesystem. I created 2 partitions using Linux's fdisk for this task. First partition is 10 GB and 2nd one is around 900 GB. That's approximately added up to 1 TB. Then I mounted the 2nd partition in current partition eg /media/hd2 as follows:
mount -t xfs /dev/sdb5 /media/hd2
where /dev/sdb5 is the partition and /media/hd2 is the mounting dir.
Stop mysql db before doing anything:
service mysql stop
Afterthat, I copied the entire db to newly mounted hard disk:
cp -rv /var/lib/mysql /media/hd2
It will take a while if you have huge databases.
Then, change the ownership of the dir to user and group of mysql:
chown -R mysql:…

The easiest way to 'burn' iso to USB disk.

The easiest way to 'burn' iso to USB disk is by using dd command. Let's say you don't want to burn your newly downloaded iso to CD/DVD but want to use USB disk instead, you can run this command :
dd if=/path/to/file.iso of=/dev/sdb
This assumes your USB disk is /dev/sdb. You can use mount command to check what device your USB disk is using. Now you can install your new distro using USB disk.

Note: You can burn iso this way if the iso is of type hybrid. Read here for more information.
Have fun!

/usr/include/linux/netfilter_ipv4.h:53: error: ‘INT_MIN’ was not declared in this scope

This error happened when I was compiling dansguardian with Linux netfilter support.
In file included from ConnectionHandler.cpp:48: /usr/include/linux/netfilter_ipv4.h:53: error: ‘INT_MIN’ was not declared in this scope /usr/include/linux/netfilter_ipv4.h:64: error: ‘INT_MAX’ was not declared in this scope /usr/include/linux/netfilter_ipv4.h:65: error: ‘INT_MAX’ was not declared in this scope make[2]: *** [dansguardian-ConnectionHandler.o] Error 1
To solve it, you have to edit netfilter_ipv4.h and type #include <limits.h> just below or after other #include lines.
Have fun!.

How to change the plymouth default theme

Plymouth is a graphical boot system that runs very early in the boot process. It provides graphical animation while the boot process happens in the background. Starting from Mandriva 2010 Beta, it replaced splashy to manage boot splash. Many latest distributions now are using plymouth. Since it displays graphical boot login, users usually do not bother to tinker with it.
What is the default theme? To know the current default theme, run this command without any options:
Changing theme To change plymouth theme, we have to know what themes are installed. To list them, run (as root):
plymouth-set-default-theme --list
You'll get something like this:
details fade-in Mandriva-Free spinfinity text
So to change to a particular theme as the default, for example fade-in, run :
plymouth-set-default-theme fade-in --rebuild-initrd
--rebuilt-initrd option is a must or the change won't take effect. You can explore other options by running plymouth-set-default-theme -h
Have fun!