Hi all,
I've been searching the mailing list archives and I've found several
threads about pax/tar/cpio issues regarding cloning, but I still have a
few doubts.
The aim is simple: to be able to clone quickly a Linux workstation. The
constraint is that not all machines are identical, and partition sizes may
vary (so no 'dd'). The idea is I create (compressed) archives of the
partitions to be cloned on the reference machine, and make them available
by NFS, for instance. Then I boot on the "virgin" box with tomsrtbt, do
the partitioning/mkfs'ing; then access the images of the reference machine
and unpack; then fix some files like /etc/hostname, IP config files, and
so on. Well, this is pretty much what Jim Dennis explained in msg
http://toms.net/tomsrtbt/199907/msg00009.html
OK, my question: what's the best utility to preserve the permissions,
UIDs, GIDs, sparse files,...? Woud GNU tar cut it? I was thinking about
something like this:
# Archive creation for /usr
# Note the options to tar:
# -S (to take care of sparse files)
# -l (to remain within the file system)
cd /scratch ; tar -czSlf usr.tar.gz /usr
-----
# Archive restoration for /usr
cd /mnt/new
tar --same-owner --same-permissions -xzf /mnt/reference/usr.tar.gz
-----
(just an example; similar scripts for / and the other partitions)
Will something like this work and not affect things like, say, the /dev
directory, or the lost+found dirs on every partition (I think it won't but
wanna make sure).
TIA,
Jose