LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Using rsync for imaging (https://www.linuxquestions.org/questions/linux-software-2/using-rsync-for-imaging-828803/)

Completely Clueless 08-27-2010 05:48 AM

Using rsync for imaging
 
Hi all,

I am getting a little fed up with the fiddly-ness of Clonezilla and checked out the Members' Choice Awards for a better solution. Seems like rsync is very popular as a backup tool. But can it be used for creating an image of a partition which could later be readily used for a bare metal complete system re-install? THanks.

CC.

MS3FGX 08-27-2010 05:55 AM

rsync is simply used to sync files between directories/systems. You could use scripts and some additional tools to create ISO images of the files copied from the source file system, but it would have nothing to do with rsync.

I think you are looking for something more akin to dd.

syg00 08-27-2010 06:17 AM

I don't like "image" solutions - never have. And of those "dd" is the worst.
Better to have a filesystem aware backup (rsync qualifies) - at least then you know the files were readable when they were backed up. I prefer something that verifies the backup with a CRC, but that's just past experience biting back.

Completely Clueless 08-27-2010 10:09 AM

Well now a lot of people swear by dd and even asked for it to be included in the MCA section for backup choices. What exactly can you mean by it being "the worst" - I have never heard anyone ever criticise it to this extent before. What's the problem??

teckk 08-27-2010 11:15 AM

To the OP

Here is the man page for rsync
http://www.samba.org/ftp/rsync/rsync.html

Quote:

But can it be used for creating an image of a partition which could later be readily used for a bare metal complete system re-install?
The system that you are restoring on may not have the same geometry as the original. Rsync will get all the files on a partiton or folder, and keep current backup of them. You may want to do a minimal install of the OS on the new system then bring all of your files over with rsync.

dd is a bitstream duplicator. It does not care about anything except bits. It will clone any partition, file, directory, drive exactly. You can read write MBR or any other part of the drive.
Problem with it is when you try and restore the .iso, it restores the exact same size. You do a
Code:

dd if=/dev/hda1 of=mypart.iso
You'll have a clone of hda1. If you want to write that to another drive where you want hda1 to be bigger, your out of luck. You'll have to use something else to try and expand the partition. (Some file systems can't be resized). But yes, you can clone a drive with it, MBR to the end.

Take a look at g4l, netcat, dd, rsync, tar...

DD can be used for what you want. It's just not a one button push.
You can clone a drive or partition with it to an .iso.
New drive, new machine....
Make partition's and format them on your new system
Use a live cd
Open the .iso and write the the wanted files from the backup to the new system.
Write the MBR from the .iso to the new drive.
Yu are still going to have to configure new-different hardware.

There are actually lots of options to restore your old system to a new one. Or just restore the contents of a backed up partition to a new hard drive.

MS3FGX 08-27-2010 11:27 AM

Quote:

Originally Posted by Completely Clueless (Post 4079649)
Well now a lot of people swear by dd and even asked for it to be included in the MCA section for backup choices. What exactly can you mean by it being "the worst" - I have never heard anyone ever criticise it to this extent before. What's the problem??

The problem is that dd is, for lack of a better word, stupid. It simply copies bytes from one device to another, with no regard to what the data actually is. All of the data on the source device could be corrupted beyond any hope of repair, and dd would still plow along and copy it over to the new device (possibly overwriting a good copy that could otherwise been used for backup) without ever throwing up a warning.

dd really isn't a backup tool, it is a very low level utility that can be used to make backups (of a sort). Relying on it completely with no additional checks or software is not a good idea.

Completely Clueless 08-27-2010 01:37 PM

Thanks, guys. Very interesting.

ISTR that dd is the basic engine that Clonezilla uses to do the donkey work. But the Clonezilla interface could be a heck of a lot better. It's a real slog to wade through the options and choices and if you screw up and accidentally choose the wrong source or destination, the "cancel" buttons don't work and the thing tries to continue to plow on regardless. The latest version is a bit quicker and it rips through the detecting attached drives section compared to the previous version which was pretty dire, but still has quite a lot of bugs. If they ever get it stable and more refined and simplified even, then it could be a real competitor. But it ain't close yet.

teckk 08-27-2010 03:32 PM

If you are interested in dd then read this
http://www.linuxquestions.org/questi...ommand-362506/

Completely Clueless 08-27-2010 05:26 PM

Quote:

Originally Posted by teckk (Post 4079990)
If you are interested in dd then read this
http://www.linuxquestions.org/questi...ommand-362506/

I saved a copy of this to disk around a year ago. Amazing!

syg00 08-27-2010 05:36 PM

@MS3FGX covered most of what I was going to say, but it's even worse. dd will actually contribute to that corruption (silently) if it does find errors.
You have to be *real* careful what options you use, and even then you still don't know what you get as output. I use dd all the time, but (outside of forensics) never as a backup.


All times are GMT -5. The time now is 11:08 PM.