Linode owners often need to download disk images for future use or for backup purpose.
And, at times wrong procedure can result in data loss during disk image download.
At Bobcares, we help Linode customers to properly backup disk images as part of our Managed Cloud Services.
Today, we’ll see how our Cloud Engineers download Linode disk image and fix usability issues with it.
Why we need to download Linode disk image?
Downloading Linode disk will help to copy a .img file to your computer. This file will contain all of the data that is present in your Linode’s disk.
Firstly, we’ll see the different scenarios where downloading disk images will help.
Often, Linode owners download disk image locally to be able to restore it to another node. Similarly, some server owners may prefer to download the image for safe keeping.
In addition to this, some may need to download Linode disk image for business purpose too. Here, they create a Linode, add various software and a firewall, and customize it. They would like to save that Linode state for future use. Having a disk image of this saved state will help to quickly provision new Linode with preset options.
Similarly, by downloading disk image, it is possible to save a bit in your Linode monthly bill too. You can easily get rid of a rarely used Linode server after creating a disk image.
Thus, there are many reasons to download Linode disk image.
How we download Linode disk image?
Recently, a Linode customer came to us looking options for downloading disk image. He wished to use it later while creating new Linodes.
Let’s now see how our Support Engineers helped him to download the disk.
1. Prepare destination computer
As the first step, we confirmed the details of the computer that will store the disk image. We then checked the resource usage to ensure that there is enough space to hold the disk image. Additionally, we allowed ssh connection between the source Linode and destination.
2. Put Linode in rescue mode
To copy the disk, we need to set the Linode in Rescue mode. Here, our Dedicated Engineers connect to the Linode via Lish console and then start SSH service using the command :
/etc/init.d/ssh start
3. Download the disk image
Now that SSH is running on the Linode server, we can copy the Linode disk image.
At the destination server, we issue the following command:
ssh root@linodeIP "dd if=/dev/sda " | dd of=/home/diskbackup/linode.img
This will create a backup image of the Linode disk available at /home/diskbackup/linode.img
Now, the copying of disk starts and the time to complete depends on the size of the disk.
Usability problems and their fix
Unfortunately, at times downloading Linode disk images can create usability issues. Let’s now have a look at them.
1. Retrieving the data from disk image
Linode’s backups are only directly readable by the Linode Backups service.
Recently, a customer wanted to retrieve files from a Linode backup image. But, he was not having Backup service.
Here, our Dedicated Engineers helped him restore the files by mounting this image on one of his servers.
For this, we used the command:
mount -o loop linode.img linode
And, all the directories at the Linode server was made available at the linode mount point.
2. Resource constraints
Similarly, server resource constraints can also create problems during disk image download. To avoid this, our Cloud Engineers always check the destination server resources well ahead. Again, this involves temporarily increasing the memory of the Linode server to handle the high usage during disk download.
3. Too much time for download
Downloading disk images can take a while. And, if the internet connection is really slow, things go for a toss.
In such cases, our Support Engineers enable gzip compression for data transfer via ssh. The exact command will be :
dd if=/dev/sda | gzip -c --fast | ssh user@linodeip 'dd of=/home/backup/sda.img.gz'
Here, Gzip will be used for compression, -c means Write on standard output, keep original files unchanged, –fast will compress data faster.
Again, using OpenSSH can slow down the download progress and specifically impact CPU load. But, since we are moving the data across the Internet, for security reasons, we still prefer to use OpenSSH.
[Need help to download Linode image? Our Linode Experts can help you.]
Conclusion
In short, downloading Linode disk image will be helpful in maintaining remote backup, new Linode provisioning and so on. Today, we saw how our Dedicated Engineers download Linode disk image and fix usability issues with it.
0 Comments