0

Linux Backup / Clone Disk

I want to clone my entire disk to to new disk using Linux.
I just need to write a simple command using dd and specify if (input file / disk) and of (output file).

dd if=/dev/sda of=/dev/sdb
 
To get get the current progress of disk copy / cloning 
I need to know the process id of dd process. 
Using command belows I can get the process id.

ps aux | grep -i dd

To make the progress shown on the console I need to write the following command

kill -SIGUSR1 


Reference :

http://www.thegeekstuff.com/2010/10/dd-command-examples/
http://serverfault.com/questions/4906/using-dd-for-disk-cloning
0

Linux - Sync time using google web server

Reference : http://superuser.com/questions/307158/how-to-use-ntpdate-behind-a-proxy

I got problem to sync time on my Linux controllers using ntpdate because they are under proxies & firewall. I found a simple solution and it's using google web server time.
Execute this
sudo date -s "$(wget -S "http://www.google.com/" 2>&1 | grep -E '^[[:space:]]*[dD]ate:' | sed 's/^[[:space:]]*[dD]ate:[[:space:]]*//' | head -1l | awk '{print $1, $3, $2, $5 ,"GMT", $4 }' | sed 's/,//')"
if the timezone is not configured yet, simply run this command
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime 
or using wizard
dpkg-reconfigure tzdata
0

Skip MySQL temp table

I have a problem where MySQL has taken a long time to copy the data to a temporary table.
I found a solution at:

http://stackoverflow.com/questions/7532307/skip-copying-to-tmp-table-on-disk-mysql

But in this problem, I changed the / tmpfs to / dev / shm.
More information about the / dev / shm can be found here

http://www.cyberciti.biz/tips/what-is-devshm-and-its-practical-usage.html

Step I:

1. Change the configuration of MySQL to use / dev / shm as temp tables directory

2. Change tmp_table_size = 2K
 
Copyright © peyotest