Snapshots From DigitalOcean

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

8/1/23, 19:18 Download snapshots from DigitalOcean

Leonid Burceacov

Download snapshots from DigitalOcean


Leonid Burceacov
Senior Software Developer Seguir
Fecha de publicación: 2 de ene. de 2017

Since DigitalOcean is now (starting Oct 2016) charging 5 cents per gigabyte per month
for storing images, it's a good time as ever to take things into your own hands and
download snapshots to your own PC. To do that, you are going to make a copy of the
image's hard drive and save it to a local machine. For the purposes of this article I'm
going to copy my old Ubuntu server running Wordpress and MySQL.

First off, login into cloud.digitalocean.com and click on the Create Droplet button
located in the upper right corner. From there navigate to Snapshots (found under
Choose an image) and select the image that you want to copy. Choose the droplet
size, datacenter region, etc and click on Create.

After a about a minute your new droplet will be available. Connect via SSH to test if
it's working (you should be able to find the IP address in the Droplets section). Now
you can start copying the server's hard drive to your HDD. For this we'll use a tool
called dd. If you're on Linux, you're good to go; if you're on Windows, then you'll need
MinGW or something similar to run dd.

Now run on your machine (source):

ssh root@ipaddress "dd if=/dev/vda1 | gzip -1 -" | dd of=image.gz

Here "root" is the root-user, "ipaddress" is the IP address of the droplet you
recently created, "/dev/vda1" is the name of hard drive that you intend to copy (run
"df -h" on remote to find the actual name) and "image" is the name of resulting raw
https://www.linkedin.com/pulse/download-snapshots-from-digitalocean-leonid-burceacov 1/4
8/1/23, 19:18 Download snapshots from DigitalOcean

image. You might need to add "-p1234" if you changed the default port like I
Leonid Burceacov
originally did, where "1234" is the alternative port.

The reason for using root here is that by default you are not allowed to use dd as a non-
root user. One way to fix this this is to use sudo; I personally went with the less safe
way of allowing myself to connect as root via SSH, since on one hand I had Fail2Ban
already up and running, and on the other this droplet will be deleted in less than 2
hours.

After running that command you will be prompted to enter your root password. Note
that there will be no progress indication after that and in about 10-15 minutes (for the
20GB HDD that is about 10% full) you'll see something like:

41943040+0 records in

Which means you're good to go! After that you have several options:

Convert the raw image to something suitable for VirtualBox

Explore the image with help from DiskInternals Linux Reader

Now you can safely destroy the droplet and delete the snapshot. No more wasted
money, hooray!

30 ·
9 comentarios

Recomendar Comentar Compartir

José Roberto Brasil

3 años
Hi Leonid Burceacov,

All right?

However, I tried to do the restore.

gunzip -c /root/xxxx.gz | dd of = /dev/vda1

Did not work.

Did you use a different parameter in the command?

Thanks a lot!

https://www.linkedin.com/pulse/download-snapshots-from-digitalocean-leonid-burceacov 2/4
8/1/23, 19:18 Download snapshots from DigitalOcean

Recomendar
Responder
Leonid Burceacov
Usuario de LinkedIn

3 años
To see the progress of the dd use status=progress like below

ssh root@ipaddress "dd if=/dev/vda1 | gzip -1 -" | dd of=image.gz status=progress

So don't have to wait and see 10-15 minutes


Recomendar
Responder
3 recomendaciones

Satnam Singh

3 años
Leonid Burceacov, You shared very useful information, Thanks a lot.

Recomendar
Responder

Dat Van Dang

3 años
Hi Leonid,

I used this method to download a copy of my Ubuntu but I can't re-upload the gz file to
DO (for testing). Can you help? Thank you very much.

Recomendar
Responder

Usuario de LinkedIn

4 años
Thanks for the article. I tried to recover using virtual box without any luck. Getting error:
No bootable device found! Looks like the grub is missing? Were you able to restore the
droplet finally?

Recomendar
Responder

Roberto Giangreco

5 años
Thanks for this post!. Did you test to recover the snapshot backed up to other droplet
from local to DO infra?

Recomendar
Responder

Prikshit Gupta

5 años
Really thanks for this article, really appreciate that. Can you also write how to restore dro‐
plet to new droplet?

Recomendar
Responder
1 recomendación

Timothy Verry

5 años
Thanks, after seeing the invoice for this month I have been looking for a way to download
an image myself rather than paying DO to store them! I saw this tip on another forum, but
no one had replied back whether or not they have been able to successfully restore their
personally stored image. Have you tried it?

Recomendar
Responder
2 recomendaciones

José Cruz Chávez

5 años
Excelente información

Recomendar
Responder
Ver más comentarios

Para ver o añadir un comentario, inicia sesión

Otros usuarios han visto


https://www.linkedin.com/pulse/download-snapshots-from-digitalocean-leonid-burceacov 3/4
8/1/23, 19:18 Download snapshots from DigitalOcean

Thoughts after watching Odoo high-performance API: millions of daily


Leonid Burceacov the case of Go-Send
transactions,
Jack Shurui Liu
·
1 año

Best Sites to Download SketchUp Models for Free in 2022


Puja Devkota
·
11 meses

Adiabatic Mixing of Air Streams


Nikhilesh Mukherjee
·
2 años

44 Free Action Plan Templates Download by one click


Said Ebead
·
10 meses

Create a Branded Livestream Countdown Timer in 3 Easy Steps


Nika Stewart
·
1 año

Boost Your App Downloads With Linkedin Marketing


Ritesh Osta
·
3 años

Download LibFredo6 v7.2g for SketchUp


Arka Roy
·
1 año

Competitive Analysis of SodaStream


Tapobrata Behera
·
11 meses

3 Smart Ways to Download Free Full Text Articles for Your Literature Review
Dr. Ram Mishra
·
3 años

© 2023 Acerca de

Accesibilidad Condiciones de uso

Política de privacidad Política de cookies

Política de copyright Política de marca

Controles de invitados Pautas comunitarias

Idioma

https://www.linkedin.com/pulse/download-snapshots-from-digitalocean-leonid-burceacov 4/4

You might also like