Operating System - Linux
1827704 Members
2885 Online
109967 Solutions
New Discussion

system clone via tar - plz help

 
SOLVED
Go to solution
Maaz
Valued Contributor

system clone via tar - plz help

I have tar bacup of my entire system.

say e.g on Computer1 i did
#tar cjvf /system_backup.tar.bz /

is it possible that i use this backup to configure a new machine as a clone ?

i.e can I do this on Computer2 ?
#tar xjvf /system_backup.tar.gz


Regards
Maaz
7 REPLIES 7
Steven E. Protter
Exalted Contributor
Solution

Re: system clone via tar - plz help

No, it is not strictly possible.

If however you set up a second machine with the exact same disk partition structure and identical hadware, then it MIGHT work.

http://www.acronis.com

This is a system cloning product for Linux. It can make clones of running systems.

For something less expensive, try Norton Ghost or http://www.mondorescue.org

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Maaz
Valued Contributor

Re: system clone via tar - plz help

Thankx for such a nice reply

Regards
Maaz
Reiß, Thomas
Regular Advisor

Re: system clone via tar - plz help

Not exactly,

- shut down any Daemons/Databases/Services (or make "init S", better boot a rescue System from CD)
- sync filesystem
- exclude /proc/* (or sysfs), /var/run/* Filesystem from Backup
- make tar archive
- restore on other Machine
- change settings on /etc/fstab (when different)and /etc/modules (keep in Mind to load special modules for new Hardware)
- call lilo
- should run

Greetings
Thomas
Thomas Reiß
Alan_152
Honored Contributor

Re: system clone via tar - plz help

As mentioned, tar isn't the best solution because it requires that you rebuild your partitions, file systems, and some directories befor un-tar-ing. "dd" is a better choice, as are several of the ISV suites available.

There is also a GNU project out there called "Ghost for Linux" that will do an ok job of duplicating a box if you have an ftp server handy...
Maaz
Valued Contributor

Re: system clone via tar - plz help

Thankx Dear Thomas, u wrote:
>- exclude /proc/* (or sysfs), /var/run/* Filesystem from Backup

Plz le me know how to take tar Backup from '/'... excluding /proc and /var/run ?

Thanks Alan ;)

Regards
Maaz
Alan_152
Honored Contributor

Re: system clone via tar - plz help

If you check the tar man file, you'll find that there are a couple of "exlude" switches that you can use:

-W, --verify
attempt to verify the archive after writing it

--exclude FILE
exclude file FILE


taken from "http://unixhelp.ed.ac.uk/CGI/man-cgi?tar "
Reiß, Thomas
Regular Advisor

Re: system clone via tar - plz help

from "man tar"

--exclude=FILE
exclude file FILE

-X, --exclude-from=FILE
exclude files listed in FILE

so make a file like exclude.txt with

/var/run/*
/proc/*

an do

tar -cvj -X ./exclude.txt -f backup.tar.bz /
Thomas Reiß