Copy physical server to Virtualbox or VMWare?

Discussion in 'General' started by ikrudolf, Feb 12, 2014.

  1. ikrudolf

    ikrudolf Member

    Hi there,
    Is it possible (also read easy) to copy an entire physical server to a virtual server?

    Regards,
    Rudolf.
     
  2. srijan

    srijan New Member HowtoForge Supporter

    Hi skoena,

    Yes we can clone the physical server into virtual server. You just requires a live cd to run the physical server.

    Step 1: Build any live CD to your physical server.
    Step 2: Boot the physical server with the Live CD/USB.
    Step 3:Open the terminal & run this code.(Its my pre-assumption that the server is installed in /dev/sda)

    Please note that the server.img file will be as large as your server intalled so recommended to save the server.img in external drive with good hdd.

    Step 4. You can boot the raw image as a hard disk or convert it to a virtualbox (or other) image

    Cheers, now you can connect the server.vdi to virtualbox for use.

    Br//
    Srijan
     
  3. ikrudolf

    ikrudolf Member

    Not clear what you mean here? Should I download a live CD or create it from the physical server? How should I do this?

    How can I check this?

    Can I create a mount to a network drive to do this?

    Tnx!
     
  4. srijan

    srijan New Member HowtoForge Supporter

    Hi

    This was suggested to boot your physical server machine with the help of the Live CD or Live USB.For this you can use http://unetbootin.net/ to make a Live USB. You can use any OS. I will recommend to use Ubuntu12.04 live environment.

    For this I mean to say that when you are in live boot environment then you can open the live environment's terminal & need to run this command.You can check this with the with command
    Simply make the image of the server.


    Further

    You need to configure the network drive with live environment to save the server image file.

    Br//
    Srijan
     
  5. sjau

    sjau Local Meanie Moderator

  6. ikrudolf

    ikrudolf Member

    Thank you. Will try this!!

    Rudolf.
     
  7. ikrudolf

    ikrudolf Member

    Is it completely save to use this command, as DD is also known as Data Destroyer?

    What does the
    do?
     
  8. ikrudolf

    ikrudolf Member

    And what about my filesystem?

    I guess the one I want to be cloned is "/dev/mapper/web01-root"?

     
  9. ikrudolf

    ikrudolf Member

    A fdisk -l command gives me this:

     
  10. srijan

    srijan New Member HowtoForge Supporter

    Hi Rudolf,

    For this i will say that DD command is used to dd' copies a file (from standard input to standard output, by default)
    with a changeable I/O block size, while optionally performing
    conversions on it
    . Yes dd is also used to completely shred/wipe a drive with proper operands.

    bs=1024 it means that Set both input and output block sizes to BYTES. This makes `dd'
    read and write BYTES per block, overriding any `ibs' and `obs'
    settings. In addition, if no data-transforming `conv' option is
    specified, input is copied to the output as soon as it's read,
    even if it is smaller than the block size.


    After looking your fdisk -l, I will suggest you need to clone the /dev/sda2


    Note: Please let the dd command to complete fully, please ensure that the the saving media should be of enough to save the server.img file.

    Br//
    Srijan
     
  11. ikrudolf

    ikrudolf Member

    Thank you for your help!
    Will the right command to clone be:
    Code:
    dd if=/dev/sda2 of=/dev/sdb/server.img bs=1024
    I attached a 500GB external harddisk as /dev/sdb, what's the best way to format it?
    What if the command/cloning fails, should I retry?


    This is the most recent output of fdisk -l:
     
  12. srijan

    srijan New Member HowtoForge Supporter

    Hi Rudolf,

    Yes that will be right.

    I think 500Gb is enough for the server.img file.You can use the Gparted utility to format the drive.

    Please ensure & wait for the command to get completed, it takes time.

    Br//
    Srijan
     
  13. ikrudolf

    ikrudolf Member

    Tnx again.
    One additional question that pops up :)

    After formatting the drive should I mount it somehow?

    Regards,
    Rudolf
     
  14. srijan

    srijan New Member HowtoForge Supporter

    Hi Rudolf,

    Yes you need to copy the server.img file in the mounted drive. Gparted is very user freindly tool which uses to automatically mount the new formatted drive. But for confirming you can deploy
    df -kh to check the /dev/sdb mount point.

    Br//
    Srijan
     
  15. ikrudolf

    ikrudolf Member

    Haven't had the time to try it out ;-)

    This is the latest fdisk -l (see attachment)

    Disk /dev/sda is the Live Usb disk
    Disk /dev/sdb is the 500GB External HDD
    Disk /dev/sdc is the 146GB disk where Ubuntu server and ISPconfig is installed.

    Which command should I use?
     

    Attached Files:

  16. srijan

    srijan New Member HowtoForge Supporter

    Can you please paste your df -kh

    Br//
    Srijan
     
  17. ikrudolf

    ikrudolf Member

    fgfgg


    This is the output.
     
  18. srijan

    srijan New Member HowtoForge Supporter

    Hi Skoena,

    Referring the above output I can conclude that your ISCpconfig server is configured on /dev/sdc
    So you need to clone the /dev/sdc
    It will back-up the whole data with MBR records.

    Br//
    Srijan
     
  19. ikrudolf

    ikrudolf Member

    So the command would be ?
     
  20. srijan

    srijan New Member HowtoForge Supporter

    Yupe :) that will be the correct command.

    Br//
    Srijan
     

Share This Page