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, opened gnome disk utility, and did "restore disk image" from my NFS-mounted img file.

This is where it gets weird.

After rebooting, I started getting the Grub menu (I only run Linux via UEFI and never get this menu) offering recovery mode. I booted normally, and couldn't enter text into the lightdm password field, although I could move the cursor. X kept restarting every 30 seconds or so, and I couldn't find any errors in /var/log/syslog. After tons of reading online, I tried running apt-get update, which failed an error about some list (I didn't take a screenshot in the heat of the moment). Thinking the nvidia driver might be acting up, I switched to my Intel card (Thinkpad with Optimus) and the exact same thing happened.

I'm back up and running with my Clonezilla image, but I can't figure out where I went wrong. Should I not use the disk utility to restore?

What else might I be doing wrong?

Big Millz
  • 325
  • 1
    First, kudos on a good question. Second, kudos on checking whether backups work. Third, can you provide more info on "where it gets weird." Are you restoring an install of the entire drive? If so, how did dd copy the root-owned files? Is that not where your problem can come from? Fourth, are you restoring on the same machine you made the backup from? – don.joey Mar 30 '15 at 08:55
  • Appreciate that - I'm usually the one saving others from backup disaster ha. It's a clone of the entire sda drive. My script (and thus dd) is run as root, but I'm not sure it copied everything correctly. It definitely behaves as if some permissions were screwed up. I am restoring to the exact same machine as well – Big Millz Mar 30 '15 at 11:34
  • I am afraid there is not much info we can work with here. If you figure out what the issue was, can you keep us posted so we can learn? – don.joey Mar 30 '15 at 13:33
  • Definitely will. I'll give it another shot in a couple days when I have time, and see if it restores properly. I'll try just dd as well, versus the gui approach. – Big Millz Mar 30 '15 at 16:45
  • Same result...posting here to keep it clean: http://askubuntu.com/questions/605580/system-hangs-after-being-restored-from-dd-backup – Big Millz Apr 05 '15 at 11:47

1 Answers1

0

Should I not use the disk utility to restore?

Correct. From your Ubuntu 14.10 live USB stick environment, you should:

dd if=/media/temp/image/image-YYYY-MM-DD.img of=/dev/sda

Where YYYY-MM-DD is the year, month, and day-of-month of the image you want.

  • Chances that /dev/sda is the correct device and that you'll not destroy the whole installation are small. Use /dev/disk/by-id/... or /dev/disk/by-uuid/... at least. – Kalle Richter Aug 26 '16 at 15:17