Archive for August, 2011

Linux:how to clone hardrive over network

Wednesday, August 24th, 2011

Purpose :
I want to clone a hardrive “/dev/sda” over network.
Server A will get the clone data and Server B will will sent the clone data.

disk space of Server B is :

 fdisk -l
 
Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00083b1c
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2329    18705408   83  Linux
/dev/sda2            2329        2434      842753    5  Extended
/dev/sda5            2329        2434      842752   82  Linux swap / Solaris

step 1:
Receving Serer (Sever A) :

nc -l -p 1234 | dd of=/dev/sda

step 2:
Sending Serer (Sever B) :

dd if=/dev/sda | nc 192.168.1.220 1234

it will start to clone hardirve.

it can take up to 3 to 4 hours depends on hardrive size.

How to install apache2 php mysql in debian

Thursday, August 18th, 2011

Install apache2 and php modules

apt-get install apache2 php5 libapache2-mod-php5 php5-mysql

Install mysql server

apt-get install mysql-server

Restart apache2

/etc/init.d/apache2 restart

How to allow root to login in debian desktop

Wednesday, August 17th, 2011

(a) edit gdm3 file

nano /etc/pam.d/gdm3

(b) disable bellow line

auth   required        pam_succeed_if.so user != root quiet_success