Good Way to Test Hard Drive Clone?

Curt Carpenter

New Member
Joined
May 12, 2018
Messages
5
Reaction score
9
Credits
0
Hello!

Yesterday I used the "dd" command to copy my active hard drive (/dev/sda) to a usb-connected hard drive (/dev/sdb). My intent was to create a full-system backup of my PC in case I have a drive failure at some point.

After the dd command finished (about an hour and a half later), both drives appear to be identical according to fdisk -l, which generates the following output:

Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00032351

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 305307647 305305600 145.6G 83 Linux
/dev/sda2 305309694 312580095 7270402 3.5G 5 Extended
/dev/sda5 305309696 312580095 7270400 3.5G 82 Linux swap / Solaris

Disk /dev/sdb: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00032351

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 305307647 305305600 145.6G 83 Linux
/dev/sdb2 305309694 312580095 7270402 3.5G 5 Extended
/dev/sdb5 305309696 312580095 7270400 3.5G 82 Linux swap / Solaris


Can anyone tell me if there is a way to verify that I've created a usable backup, short of opening up my computer and physically replacing the hard drive there now with my "clone?" I tried booting from the USB-connected clone drive, but it doesn't work, I assume because the Ubuntu system on the USB drive isn't configured correctly.

Any suggestions appreciated. I'm paranoid about actually swapping out the hard drives unless it's absolutely necessary, and I only have one PC to work on.
 


There are MANY backup solutions available, but no matter which you decide to place your trust in... you should learn how to restore it and have the same trust that it will work as expected when you need it to. A backup should not be just "a wish and a prayer." So my advice is to open up the box and swap the drives to be sure. Taking out (or just disconnecting) the original drive will not harm anything, and after a quick boot up on the backup, you will know that you have achieved your goal.

Our resident Wizard (@wizardfromoz) has a great tutorial on the Timeshift backup program... see it here. Timeshift is now included with Linux Mint, and maybe some other distros, but you can probably easily install it if it isn't included in your system. While dd is a competent backup solution too, it is probably not as efficient as Timeshift and maybe some others.

Cheers
 
What's this, a meeting of the local Senior Citizens Club? lol, Stan and I are in our 60s, Curt.

(Wizard appears in a puff of smoke, stumbles over Curt's disassembled hard drive, curses, realises he has turned Curt into a toad, turns him back again in a blink of the eye)

Actually I am quite pleased that someone has been intrepid enough to use dd to clone. dd gets a lot of bad press and I don't think it deserves half of it.

Yes, Curt, it certainly looks like you have succeeded, the figures certainly match.

May I ask:

  1. What version of 'buntu you are using, down to the desktop environment (DE)?
  2. Out of interest, how long did the dd operation take?
  3. Is the USB drive powered or unpowered?
  4. Can you give us the output of
    Code:
    df -H
    ?
Another option you have to the physical substitution of the drives is to use a command called "chroot" from the Terminal in your original drive, to "enter" the system on your backup drive. (we could also do this using a live install disk or stick that has Ubuntu on it) You could then install Grub from there, reboot and have a Grub Menu which included both drives.

But subject to what you feel your needs are, and how much perhaps of that USB drive you might like to reclaim for other purposes, and yet still have a recovery system in place... then we can tailor a solution that suits.

At my Timeshift Tute

https://www.linux.org/threads/timeshift-similar-solutions-safeguard-recover-your-linux.15241/

... the relevant part for installing Timeshift on Ubuntu is at #9 here https://www.linux.org/threads/times...afeguard-recover-your-linux.15241/#post-49536

I'll be in and out today (Thursday in Oz) but have a think about it and enjoy your Linux :)

Chris Turner
wizardfromoz
 
Well......if we are gonna have an 'old farts get together'.......then you just have to have the better looking one in on the act as well !!! (and the oldest)

On topic......I use Clonezilla. Downloaded it....stuck it on a usb...bootable....used unetbootin to achieve that

Boot to that usb....just go through the steps.....just be careful when selecting the first hdd.....the first selection is for the backup to be stored on.....(the Destination)...................Further along you will select the Source.....which will be your hdd containing your current OS.
You are also given the option to check files and test the backup to be sure it is able to be restored in case of some failure. Takes a little longer, but is quite reassuring.
My total time taken to create an image to another hdd, is approx 20 minutes...coffee included.
My ssd contains around 40GB of material.

I also use Timeshift. It creates a boot snapshot a couple of times a week....two daily snapshots, one weekly and one monthly snapshot.
I 'keep' 1 monthly, 2 weekly, 2 daily, and 1 boot snapshots
They are stored on yet another hdd. The process is automatic. I check every now and then to be sure it is still alive and kicking. It has not failed me.

Clonezilla..how to use etc
 
Last edited:
Lol, I hope we don't confuse Curt with too many options? :)

Hi Brian, good to see you :p

Taiwan's Steven Shiau is the author of Clonezilla, and it seems to have been around forever. Further, it is cross-platform, handling Windows, Linux and Macintosh OSes.

In its basic form, it can perform a low level, sector-by-sector cloning function, just as you, Curt, have done with dd. Meaning that the target drive (or partition) must be of at least equal size (preferably a fraction more in case of overheads) to the source drive or partition.

That option can take quite a while, perhaps less with an ssd.

What Brian is talking about, though, is more of an imaging process, takes less time, consumes less space, and is effective, nevertheless.

You can download a Clonezilla Live package, and burn to CD or DVD, or to a USB stick. Recommended reading is

https://clonezilla.org/clonezilla-live.php

Cheers

Wizard
 
might be time for gum boots......or mebbe even sun glasses...?!
 
I appreciate all the help and suggestions.

I opened my PC with the intent of doing the ultimate backup verification per atanere and of course discovered that a) this box wants a SATA drive, b) my backup is on an IDE drive, and c) the IDE drive fitted with an IDE-to-SATA adapter won't fit in the space available in the box. This has been my experience of such things in general -- it's always something.

I downloaded clonezilla and burned the .iso to CD, and will find the time to learn how to use it here in the next few days. I DID miss the fact that the first drive is the destination and not the source as VP9KS noted in looking the program over. Never actually committed to any copying though from drive to drive though, so probably avoided a major disaster by sheer dumb luck.

For now, I think I can do what I might need to do in an emergency using my Ubuntu 16.04 install DVD to build a new drive if this one fails, then dd the /dev/sdb1 partition to it. For now, I'm pretty comfortable that I'll be able to recover from a crash if I have to.

This all came up because I've been doing a lot of work with gnuradio over that last six or seven months and was starting to think about the pain I'd experience if I lost it all one day.

Thanks again for the help. I abandoned Windows for Linux a few years ago, and still have a lot to learn. I'm 71 by the way, so have a HUGE belief in the notion that wisdom comes with age :)
 
it's always something.

It certainly is :D, it keeps us on our toes.

...and not the source as VP9KS noted in looking the program over.

That was actually Brian (@Condobloke ) but it's no wonder we confused you :rolleyes:

I've been doing a lot of work with gnuradio over that last six or seven months

Paul (@VP9KS ), on the other hand, is not just a pretty face, and is a ham radio operator, if I recollect, so he may have some ideas there if you want to start a separate thread.

I abandoned Windows for Linux a few years ago, and still have a lot to learn

Don't we all? I love it when they talk like that :cool:

OK Curt if you're happy for now, that's fine, but keep Timeshift in mind too, it can do the lot in 10 minutes onto an EXT4 partition on your storage device, and has the capability to do incremental backups as well, and restore from an incremental (which is hardlinked to the previous full backup). I use it a couple of days a week to blow things away and put things back.

Cheers and enjoy your Linux :D

Wizard
 
This has been my experience of such things in general -- it's always something.
Curt,
I am assuming that you are familiar with Murply's law, But are you familiar with O'Riley's Law?

Simply put, Mr. O'Riley, in his first law, stated that Mr. Murphy was an optimist!

Just thought I'd toss that into the fray:D:p.

Happy Trails,
Paul
 
I abandoned Windows for Linux a few years ago, and still have a lot to learn. I'm 71 by the way, so have a HUGE belief in the notion that wisdom comes with age :)
We have a lot of old-timers here, so welcome to the club! But wisdom.... I'm not so sure! :eek::eek::D:D
 
I appreciate all the help and suggestions.

I opened my PC with the intent of doing the ultimate backup verification per atanere and of course discovered that a) this box wants a SATA drive, b) my backup is on an IDE drive, and c) the IDE drive fitted with an IDE-to-SATA adapter won't fit in the space available in the box. This has been my experience of such things in general -- it's always something.

I downloaded clonezilla and burned the .iso to CD, and will find the time to learn how to use it here in the next few days. I DID miss the fact that the first drive is the destination and not the source as VP9KS noted in looking the program over. Never actually committed to any copying though from drive to drive though, so probably avoided a major disaster by sheer dumb luck.

For now, I think I can do what I might need to do in an emergency using my Ubuntu 16.04 install DVD to build a new drive if this one fails, then dd the /dev/sdb1 partition to it. For now, I'm pretty comfortable that I'll be able to recover from a crash if I have to.

This all came up because I've been doing a lot of work with gnuradio over that last six or seven months and was starting to think about the pain I'd experience if I lost it all one day.

Thanks again for the help. I abandoned Windows for Linux a few years ago, and still have a lot to learn. I'm 71 by the way, so have a HUGE belief in the notion that wisdom comes with age :)
Curt,
I use an external usb adapter which will run 2.5 & 3.5 inch IDE, or sata drives. There are a bunch of different types available online most anywhere. The block type power supply that came with it gave up long ago, so I modified an old computer supply to use on the bench. I have an adapter for the sata power connection. It works just swell!

Happy Trails,
Paul
 


Latest posts

Top