DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: *NIX: Commands / software to verify partition backups / clones?  (Read 10,266 times)

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Am trying out a cloning dock -- one of those things that let's one clone a drive to another without the use of a PC.

Would like to verify the results though -- perhaps not every time.

I'm currently doing something like:

Quote
md5sum /dev/sda1
...
md5sum /dev/sdaN

for N partitions and comparing with analogous results from the other drive.

I'm not that concerned about MBR / GPT metadata at the moment.  (Thought of just doing the whole drive (e.g. /dev/sda) but then realized that drive sizes differ some times :))

Also tried the cksum command as perhaps that's good enough to detect errors.  I/O is probably so much more of a bottleneck that may be there won't be a detectable difference...

Any favorites or recommendations for this sort of procedure?



Some numbers and additional details:

Cloning a c. 320 GB drive has taken around 80 min (have done this a couple of times now).

Verifying (i.e. using the md5sum program above on 4 partitions) I didn't track very closely, but it may have exceeded an hour total.

Three of the partitions contained ext4 filesystems and the fourth was swap -- yes, working with the swap partition was probably pointless :)
« Last Edit: January 17, 2015, 07:51 AM by ewemoa »

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,027
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Linux User
Re: *NIX: Commands / software to verify partition backups / clones?
« Reply #1 on: January 17, 2015, 08:52 PM »
What tool are you using to do the backup?  Good ol' Rsync? Cp?  

In the case of Rsync, use the --log-file option to keep a log of all transfers and then grep the log for incompletes.
Code
rsync --log-file=$HOME/rsync.log [file syncing bits here]
 
In the case of cp, you could use crccp (part of the crcsum tools) from  here:
https://sourceforge.net/projects/crcsum/
which will do CRC hash checks on all copy operations.

... or use ZFS  :-[
https://clusterhq.com/blog/state-zfs-on-linux/
All children left unattended will be given a mocha and a puppy.

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,861
Re: *NIX: Commands / software to verify partition backups / clones?
« Reply #2 on: January 17, 2015, 08:58 PM »
IMO it's just easier to use Clonezilla. Get an inexpensive dual-drive dock, plug it in and have at it. I've never encountered a data corruption issue doing it that way either for Windows or Linux.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: *NIX: Commands / software to verify partition backups / clones?
« Reply #3 on: January 17, 2015, 11:09 PM »
Thanks for the replies.

My recent tool of choice has been Clonezilla for some time but that ties up a machine (and the process of setting up the backup is not a process I enjoy physically as well as ncursesly) so I'm experimenting with a dock that doesn't require a PC.

The dock is a dual drive dock -- one nice feature is that it's clear which slot is the source and which is the target.  There is a progress indicator so one can get a rough sense of how much to wait.

After looking around some more I see that there are docks that can perform verification of some sort, but have not found one in a price range that seems acceptable -- plus I just got one...

May be it'll be worth writing a small verification script...attaching the dock to a PC after finishing the clone and running a comparison in the background seems better than doing the backup via a dock / PC combination but perhaps that's not actually a very useful illusion :)

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,027
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Linux User
Re: *NIX: Commands / software to verify partition backups / clones?
« Reply #4 on: January 19, 2015, 02:35 AM »
Ah, hadn't realized you were using an all-hardware solution.  In that case, checksums should do just fine.
All children left unattended will be given a mocha and a puppy.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: *NIX: Commands / software to verify partition backups / clones?
« Reply #5 on: January 19, 2015, 04:33 AM »
Thanks :)

Original address: https://www.donationcoder.com/forum/index.php?topic=40024.0