LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to take backup of complete server (https://www.linuxquestions.org/questions/linux-server-73/how-to-take-backup-of-complete-server-937823/)

centos123 04-10-2012 12:35 AM

@rodrifa

i installed os on second hardisk also mounted in /mnt

Disk /dev/sda: 500.1 GB, 500107862016 bytes // this is second hdd
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM

Disk /dev/sdb: 160.0 GB, 160041885696 bytes // currently boot with this drive
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 19457 156183930 8e Linux LVM


i need to clone /dev/sdb to /dev/sda .
160 gb hdd (sdb)has mailserver and webserver(portal) installed in it.if i run dd if=/dev/sdb of=/dev/sda will mailserver and portal also run perfactly as running in sdb.

centos123 04-10-2012 03:47 AM

i run
dd if=/dev/sdb of=/dev/sda and hit enter

its taking long time 2 hr gone...

also file system changed same as 160gb hdd FS

centos123 04-10-2012 04:20 AM

dd if=/dev/sdb of=/dev/sda

312581808+0 records in
312581808+0 records out
160041885696 bytes (160 GB) copied, 10902.1 seconds, 14.7 MB/s

rodrifra 04-10-2012 01:55 PM

You have lost the two partitions you had in /dev/sda, wich I assume you didn't care about, and now you have an exact image of /dev/sdb in /dev/sda. Just take sda to the machine where you want the backup to be and start it. You will have a clone of the first one.

If you are happy with it you can resize your partition and then your file system to take advantage of that space you have unused in your drive (you only used 160GB from the 500GB you had).

centos123 04-11-2012 01:32 AM

@rodrifa
dd command work to make exactly clone of file system and also get boot hdd ...that's what i needed.

but it copied 160 gb hdd data.rest space are unallocated.so how should i use these unalocated data.shall i do with fdisk or some other command is their...?

rodrifra 04-11-2012 10:51 AM

Either you create a new partition with fdisk using the free space or you resize your last partition to collect the rest of the disk's space, if you do that (beware that the last partition could be the swap partition and you may need to move it to the end of the disk to resize the partition you want), you will later have to resize the filesystem, there are plenty of guides to do that task on the net so google for those guides and you will have the answers.

centos123 04-11-2012 11:23 PM

thanks.....one last ques. after running dd what to check for confirming my server is ok and performing well..


All times are GMT -5. The time now is 03:36 PM.