[nflug] copying a backup OS parition

Boice evrgreen at netsync.net
Sat Oct 21 17:42:27 EDT 2006


Michael James wrote:
>> If I have a linux system, and want to create an exact backup on
>> another machine...is it as simple at tar the root dir and subdirs,
>> transfer tarball to a newly installed linux system (assuming same
>> version) and untar the tarball at the root level?  I have a
>> production system that beginning to act up hardware wise, so I'd like
>> to have a spare in reserve.  This is not a real time backup, as in
>> replication or clustering.  I just need to duplicate the original
>> linux system to a different box without spending hours or days
>> reconfiguring  or reinstalling the system or software.  Are there
>> certain directories that shouldn't be overwritten?  Any caveats?
>> Suggestions?
>>
>> Michael R. James
>> jamesm at thundertux.org
>>
>> _______________________________________________
>> nflug mailing list
>> nflug at nflug.org
>> http://www.nflug.org/mailman/listinfo/nflug
>>
>>   
> You could grab an extra hard drive of at least the required size and
> then "dump" it to the new hard drive. Recreate your partitions, mount
> both the original and new partitions with a rescue cd of some sort (or
> other ways too). Then tar one to the other. We do it here to replicate
> our "tweaked" OS's, saved tons of time. Let's say you have the
> original mounted at /mnt/orig and the new at /mnt/disk. To transfer it
> over with tar, you could do this "tar -cf - .|(cd /mnt/disk && tar -xf
> -)". You would then have an exact copy of what was on /mnt/orig on
> /mnt/disk. Edit fstab's accordingly, create new initrd and your good
> to go.
>
Hello, Michael.

Another way to do it that has worked out for me is to use the dd
command. For example, if you have already set up partitions equal [or
larger] on the second drive, you get into the CLI as root and type:

# dd if=/dev/hda1 if=/dev/hdb1 bs=32256

. . .assuming you want to copy all the contents, byte-for-byte from hda1
to hdb1. Obviously, it is better to do this from a Linux Live CD since
none of the partotions you are messing with should be mounted. I usually
use Mepis, but Knoppix or any of the others ought to be fine, too.

I have even moved a bootable Windows 2000 partition this way and it ran
fine in it's new location!  For Linux, you will need to adjust the fstab
and GRUB or LILO menu to make things work right, but the new partition,
PROVIDED IT HAS ENOUGH ROOM, will have identical data to the one from
which it was copied.

Email me if you have any questions, & I'll do my best to answer.

--John G. Boice
evrgreen at netsync.net
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list