Skip to content

Creating a Full Disk Image Backup of a VPS Using dd

One of the best features of Linode is that, even though they offer paid backups, they also provide built-in tools (and Linux utilities) to create full disk images of your server.

Under your Linode VPS dashboard, you’ll find an option to reboot into recovery mode. While this might sound risky, it’s actually just a way to boot your server into a rescue environment—letting you control the VM externally.

Linode uses a browser-based console called LISH (Linode Shell), which gives you direct command-line access even if SSH is locked or the system is otherwise unreachable. Beyond disaster recovery, LISH is also perfect for creating full disk backups.

Step 1: Entering the Recovery Environment

Once in the recovery environment, set a temporary password using:

passwd


Then, enable SSH so you can connect remotely. Since this session uses a different SSH fingerprint than your normal server, you’ll need to either:

  • Temporarily disable host-key checking with ssh -o StrictHostKeyChecking=no user@your-server, or
  • Remove the old entry from ~/.ssh/known_hosts before connecting.

Once logged in, you’ll see your VPS’s main storage mounted and ready for backup.

Step 2: Creating a Full Disk Image with dd

Using dd, you can make a bit-for-bit copy of the entire disk. Since the raw image includes empty space, we’ll pipe it through pigz (parallel gzip) for compression:

dd if=/dev/sda | pigz -c | ssh user@local-machine "cat > backup.img.gz"


This command:

  • Reads from the disk (if=/dev/sda)
  • Compresses the data on the fly (pigz -c)
  • Streams it securely to your local machine via SSH

My original 25GB disk shrank to 17GB after compression. After cleaning unnecessary files (down to 8GB used space), a new backup would be even smaller—likely under 4GB with high-efficiency compression.

Step 3: Storing the Backup Securely

Once the .img.gz file is on your local machine, upload it to cloud storage (like Linode Object Storage, DigitalOcean Spaces, or Koofr with Rclone) for redundancy. This ensures that even a total server failure can be recovered by:

  1. Redeploying a fresh Linode instance.
  2. Writing the disk image back to the new VPS.
  3. Restoring any incremental backups made since the last full image.

Why This Method Works

Unlike file-level backups (e.g., rsync), dd captures everything—partition tables, boot sectors, and even deleted (but not yet overwritten) files. It’s the closest thing to a physical hard drive clone.

Best of all? It’s free. You just need basic Linux knowledge and comfort with the command line.

Published incompleted