1

I've been using Clonezilla for weekly image backups, which is obviously a little bit of a hassle. I've been trying to switch to dd, so I can have cron run it for me.

This is what my backup script looks like:

#!/bin/bash
#dd whole drive
dd if=/dev/sda of=/media/temp/image/"image-$(date +"%Y-%m-%d").img"

I ended up with a 256gb img file, and decided to give it a test run. I booted from the Ubuntu 14.10 live USB stick, mounted the remote filesystem, and ran the following:

sudo -i
dd if=/media/temp/image/image-2015-04-04.img of=/dev/sda

Upon rebooting, the system hangs at the "Ubuntu" logo screen. I'm unable to switch to tty1, ctrl+alt+del, or anything. I then restored from my Clonezilla backup (which was made immediately before the dd backup), and it worked fine.

What am I doing wrong? Should I just ditch dd and take a different route?

Big Millz
  • 325
  • 3
  • 17

1 Answers1

2

In order to avoid filesystem corruption, you need to run dd from a Live CD/USB. This ensures that the filesystem you copy does not change while dd copies it.

mikewhatever
  • 33,013