O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  



Cloning linux
Cloning a running linux-system with rsync

Contributed by:
Peter Schillerwein
[05/31/03 | Discuss (1) | Link to this hack]

This clones a running linux-system (really):

rsync -v -r -p -o -g -D -t -S -l -H \
--exclude /mnt/   \
--exclude /proc/ \
--exclude /tmp/ \
--exclude /home/ / /mnt/fireball/
The target-disk is /mnt/fireball in my case. We assume the target-disk is empty at the first time. My home is on a another disk, so i skip it . The options are:
--verbose
--recursive
--perms
--owner
--group
--devices
--times
--sparse
--links
--hard-links
# next time(s):
--delete 
If you want to see first what happens, add:
--dry-run 
Boot from a CD-ROM and mount the target-disk. Fix fstab and lilo.conf. Create /mnt and /proc and set the right permissions (for this directories). Then run lilo and reboot. Next time you run rsync, add these option to the command-line:
--exclude /etc/fstab \
--exclude /etc/lilo.conf \
--delete 
Be carefull. This procedure works with a full-blown woody (~70,000 files).

See also: man rsync


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.