On Sunday 14 September 2003 21:22, Mike Vanecek wrote: > > MKlinke wrote: > > [snip] > > The technique you describe below builds a new bootable image on the > destination disk. I would assume that the destination disk would have > to be partitioned exactly the same as the source?
Yes, the destination disk will end up partitioned exactly the same as the source disk. > > Would I would like to do is ghost my operational system to a > removeable hard disk on a second machine as a file. I.e., I would > like to create a file of the source file as a total system backup. > Should the source system need to be rebuilt, I would like to be able > to dd the file on the destination disk back to the source disk. In > case of hardware failure or intrusion I want to be able to recover > quickly from a total system failure without having to apply patches > and tweaks that one does over the years to tune a system. > > My need is complete system backup rather than creating a mirror on a > second machine (much like what is discussed at > > http://www.rajeevnet.com/hacks_hints/os_clone/os_cloning.html ). > > He uses NFS as well, which I do not have installed. > > > >I've used this method with surprising success on linux and windows > > >system alike. For example, I have a couple of desktop systems that > > > are clones of my dual-OS (using grub) laptop. > > > > > >Boot up both systems with the bootnet.img and use "linux rescue" > > > at the boot prompt. (You'll need a network source for the redhat > > > software) > > I was thinking boot with the RH CD into rescue mode and have a floppy > (or a ZIP or CD, if nc is too big for a floppy) with the needed > progams to avoid the network source for the RH software? This would work too. I used the RH installation disk since it was handy and has the necessary utilities but any way that'll get you to the utilities will work. > > > >Proceed to a shell prompt on both systems > > > > > >On the destination (new disk you are creating) type: > > >"nc -l -p <port> | dd of=/dev/hdx" > > > > > >On the source (system you wish to duplicate) type: > > > "dd if=/dev/hdx | nc <addr of other machine> <port as above>" > > I.e., I'd like the clone on the destination hda to be a file rather > than an image. However, it may be easier to just partition the > destination hda and make an image except that the destination hda may > not be the same size. > > Also, could one not do the clone with the source system running as > normal? I.e., one would only need to linux rescue boot the > destination (slave) machine? I'd be reluctant to depend on everything working right on a live, heavily used linux box since this may take more than an hour if you are using large disks and the file system would be likely to change while you're doing the copy. > > At http://security.raffy.ch/index.php3?ogy.html, I found > > >The Over the Network Approach > > > >On the receiver: > >nc -p 6666 -l > file > >or: > >nc -p 6666 -l -v -w 60 < /dev/null | gzip -dc | dd of=/dev/hda > > bs=512 > > However, I am not exactly sure why the two are equivalent? I don't believe they are. In the first instance I assume that there is an implied file; e.g. "file.txt" so you are streaming receive data to a file in an existing file system and in the second you are streaming data to the disk drive overwriting whatever is there already; boot sectors, partitions, the whole works. > > >On the sender: > >cat data | gzip -c | nc -v -w 120 -p 6666 -l IP > >or: > >dd if=/dev/hda1 bs=512 | gzip -c | nc -v -w 60 IP -p 2020 > Same here, in the first instance it looks like you're reading some file in an existing file system and streaming it out to the network and the second entry is streaming out an entire partition to the network. > Ditto here... > > I have rambled a bit, but maybe you could please point me in the > right direction? I haven't tried to do what you're asking but it seems you'd want a variation that might look something like: Backup =========== Source: dd if=/dev/hdx | nc -p <port> -I <address> Destination: (Assuming a already partitioned disk where the current partition is large enough to store a file that contains all the source disk's data.) nc -l -p <port> | dd of=destination.dat which, it seems, would create a file in the current partition named "destination.dat" that contained the entire source drive data. =================== Restore ============ Source: dd if=destination.dat | nc -p <port> -I <address> Destination: nc -l -p <port> | dd of=/dev/hdx =================== You can probably work out the compression/decompression stuff if desired. Out of curiosity, why does this method appeal to you as opposed to a more conventional backup/restore scenario using, say, rsync. Regards, Mike Klinke -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list
