Important remark: try creating the new droplet in the same data-center as the droplet you want to clone. With Digital Ocean’s pricing, this should cost only a few cents. When we’are done we’ll delete the new droplet altogether. Instead, I’ll create another droplet (VPS) with twice the storage capacity just to perform this clone. Since this is probably going to take some time (because my internet connection is pathetic) during which our server is inaccessible, I’ll not download to my local machine. Sudo -s and exit are because there’s a redirect in the echo command, so a regular sudo wouldn’t work. Make sure all the changes were actually carried out (not really necessary, but just in case),įinally, remove the small and the huge files, Lets do that,ĭd if=/dev/zero of= bs=1024 count=102400Ĭonsume all the remaining disk space in another zeroes file, To avoid having the system run out of disk-space for a long time, we’ll create a small zeroes file before creating the large one then delete it before deleting the large one. This will render the system out of disk space for a while, since deleting such file will take some time. To do this, we’ll create a huge zeroes file the occupies all the remaining disk space then delete it. The disk image size can be greatly reduced if we overwrite the empty disk-space with zeroes. However, in order to be in the safe side, we’ll shutdown the services that actively modify the disk, mount it as read-only, pull the backup and then restart the machine.įirst, ssh into the Linux machine you want to clone, then stop the services, Just like vCenter Converter, this method allows you to take a backup without shutting down the server. I investigated this method after stumbling upon this post. So this is also out of question.īut since VMware vCenter Converter could do it through ssh, then I know for sure that I can do it as well. It’s funny that they don’t tell you that they will expire on the download pages. When you create an account (and write a LOT of information about yourself) you’ll be able to download TRIAL versions of these programs that expire after 60 days. If you have some service running that modifies the disk data (like an active database server), your backup data could end up being inconsistent/corrupt.Īnyway, this method requires installing lots of VMware programs, and VMware doesn’t allow you to download these programs without creating an account. This could be a feature, but it’s also dangerous. You don’t have to shutdown the machine you want to clone in order for this to work. You can then use the VMware vSphere client to connect to the ESXi server and download the disk image. It then pulls the HDD data from there and creates a new virtual machine image on the ESXi server using these data. Using the vCenter Converter, you connect to the machine you want to clone using ssh (you provide root credentials for that, and obviously the machine must have an accessible ssh server installed). You have to have a VMWare ESXi server deployed somewhere. Don’t know much about it, but it’s for PC and Mac only. My VPS uses Linux, so this is out of question. It uses the Windows Volume Snapshot feature, which obviously works only on Windows. It allows you to create the image without shutting down the system. Do this on your own risk.Īfter lots of searching I’ve found several ways to achieve this. Note: I’m not responsible for the loss of your data (if it happens). I wanted to clone the server and run it as a virtual machine on my end. Since it’s my data, I believe its correct place is within my hands. However, they don’t allow you to download your backup image. They offer excellent service (so far) and have nice backup options. I wanted to make a backup of my Digital Ocean VPS. How to make and download a raw Linux HDD image remotely using ssh and dd in Linux.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |