clonning linux with tar
For those who dont have the time to go through all my ordeal, my question is simple. How can I clone a linux machine with tar (and not dd)?
Here is my story.
I needed to install 20-something machines with Linux (Redhat 9) and since they needed to have the same configuration, I decided to try to clone them instead of installing each separately. I googled for some pointers towards, didnt find any, so decided to take matters into my own hands.
I did the original installation with no problem, created four partitions [/, /usr, /home and swap, formatted with ext3]. After installing the machine just as I wanted it, i did a 'tar zcvpf' on / and /usr (i started the machine with a boot cd, mounted the partitions and then did the tar'ing). All was fine, until i started to clone the first machine.
In my mind, the procedure was simple. All I needed to do was create 4 partitions, and then untar the files on the corresponding partitions, do a grub-install and that was it. BUT NO!! The first problem I had was that unless the created partitions were the exact match (cylinder to cylinder) to the original, the machine will not boot (boot process stops with kernel panic). Though I feel st00pid, I created the exact partitions and did the installation and everything worked fine ... until yesterday (about 2 weeks from the day i did the installation).
The problem I have now is that on all machines, df -k shows that / is used only 1% (when in fact 20-something% is in use) and when i try to create a file (either touch or mkdir) i get a 'no space left on device'. If I reboot it i get a grub 117 error, and when i try to mount the / partition from a boot cd, i see that everything is corrupted. Now, I have to do the installation again ... unless someone points out the do's and dont's of machine cloning using tar.
I am now totally lost! I dont know what to do!